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 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:
Perform a memory check to ensure sufficient resources.
Call the virtual
stage_data()method to load and distribute atom coordinates data.Call the
runner()method, which loops through all assigned q-vectors.Inside the loop, call the virtual
compute()method to perform the core calculation.After the loop, finalize services and clean up.
- Throws:
sassena::terminate_request – If a non-recoverable error (like insufficient memory) occurs.
-
inline virtual ~IScatterDevice()
-
virtual void run() = 0