File i_scatter_device.hpp

class IScatterDevice
#include <i_scatter_device.hpp>

Interface for all scattering device implementations.

This abstract class defines the essential contract for a “scatter device”, which is responsible for executing a parallel scattering calculation.

Subclassed by AbstractScatterDevice, AbstractXPUScatterDevice

Public Functions

virtual std::map<boost::thread::id, Timer> &getTimer() = 0
virtual void run() = 0

Starts the main computational workload for the device.

This function orchestrates the entire calculation process for the q-vectors assigned to this device’s partition. It follows a template method pattern, executing a fixed sequence of steps while delegating the specific implementation of key steps (like data staging and the core computation) to the concrete derived classes.

The typical sequence of operations is:

  1. Perform a memory check to ensure sufficient resources.

  2. Call the virtual stage_data() method to load and distribute atom coordinates data.

  3. Call the runner() method, which loops through all assigned q-vectors.

  4. Inside the loop, call the virtual compute() method to perform the core calculation.

  5. After the loop, finalize services and clean up.

Throws:

sassena::terminate_request – If a non-recoverable error (like insufficient memory) occurs.

inline virtual ~IScatterDevice()

Protected Functions

virtual void runner() = 0
virtual bool status() = 0
virtual double progress() = 0