File scatter_device_factory.hpp
This file contains a class which generates the scattering device based on user input provides through the CONTROL module. The constructing routine only return a pointer to the interface.
- Author
Benjamin Lindner ben@benlabs.net
- Version
See VERSION in CMakeLists.txt
- Copyright
GNU General Public License
-
class ScatterDeviceFactory
- #include <scatter_device_factory.hpp>
A factory class for creating different types of scattering devices.
This class inspects the user’s configuration and the parallel environment to decide which concrete IScatterDevice implementation to instantiate.
Public Static Functions
-
static std::unique_ptr<IScatterDevice> create(boost::mpi::communicator &scatter_comm, Sample &sample, const boost::asio::ip::tcp::endpoint &fileservice_endpoint, const boost::asio::ip::tcp::endpoint &monitorservice_endpoint, std::vector<CartesianCoor3D> &qvectors)
Creates and configures a scatter device based on the application’s parameters.
- Parameters:
scatter_comm – The MPI communicator for all nodes involved in the calculation.
sample – The sample data (see
Sampleclass), including set of atom coordinates and types.fileservice_endpoint – The network endpoint for the HDF5 file writing service.
monitorservice_endpoint – The network endpoint for the progress monitoring service.
qvectors – The list of q-vectors (computational tasks) to be processed.
- Returns:
A
std::unique_ptrto a concreteIScatterDeviceimplementation. The specific type of device created depends on the configuration parameters, particularlyscattering.typeandscattering.average.orientation.type. Possible returned types include:-
This function is responsible for creating the parallel decomposition plan. As a result, some MPI nodes may be designated as “spare” and will not participate in the computation. For these spare nodes, this function returns an empty
std::unique_ptr. For all other nodes, it returns a fully configured device ready for execution.
-
static std::unique_ptr<IScatterDevice> create(boost::mpi::communicator &scatter_comm, Sample &sample, const boost::asio::ip::tcp::endpoint &fileservice_endpoint, const boost::asio::ip::tcp::endpoint &monitorservice_endpoint, std::vector<CartesianCoor3D> &qvectors)