File data_stager.hpp

This file contains a class which implements the data staging logic for the trajectory data. The first partition reads the trajectory data from disc and distributes the trajectory to any other partition.

Author

Benjamin Lindner ben@benlabs.net

Version

See VERSION in CMakeLists.txt

Copyright

GNU General Public License

class DataStagerByFrame
#include <data_stager.hpp>

Loads coordinate data, performs frame decomposition of the trajectory data and places it efficiently into the distributed memory of the parallel partition by using div logic.

Public Functions

DataStagerByFrame(Sample &sample, boost::mpi::communicator &allcomm, boost::mpi::communicator &partitioncomm, Timer &timer)

Initializes a data staging object which decomposes the trajectory by frames using div logic (consecutive frames are assigned to the same node)

Parameters:
  • sample[in] Sample interface, which is used to load the frames.

  • allcomm[in] MPI Communicator which contains all nodes which participate in the analysis

  • partitioncomm[in] MPI Communicator which contains all nodes of the local partition.

  • timer[inout] Timer object which is used to store timing information

coor_t *stage()

Triggers the staging procedure. Data is staged on the first partition and then cloned to all other partitions.

Returns:

Pointer to the local memory which contains the staged coordinates (2D data, atoms x assigned frames)

Private Functions

void stage_firstpartition()

Loads trajectory data into the first partition.

void distribute_coordinates(coor_t *p_coordinates_buffer, std::vector<std::vector<size_t>> &framesbuffer, size_t s)
void stage_fillpartitions()

Clones coordinates from the first to all remaining partitions.

void write(const std::string &filename, const std::string &format)

Dumps the coordinates to an output file. Writes in parallel.

Private Members

Sample &m_sample
boost::mpi::communicator &allcomm_
boost::mpi::communicator &partitioncomm_
Timer &timer_
size_t NFN
size_t NN
size_t NNPP
size_t NP
size_t NA
size_t NF
coor_t *p_coordinates
class DataStagerByAtom
#include <data_stager.hpp>

Loads coordinate data, performs atom decomposition of the trajectory data and places it efficiently into the distributed memory of the parallel partition by using div logic.

Public Functions

DataStagerByAtom(Sample &sample, boost::mpi::communicator &allcomm, boost::mpi::communicator &partitioncomm, Timer &timer)

Initializes a data staging object which decomposes the trajectory by atoms using modulo logic (consecutive atoms are assigned to different nodes)

Parameters:
  • sample[in] Sample interface, which is used to load the frames.

  • allcomm[in] MPI Communicator which contains all nodes which participate in the analysis

  • partitioncomm[in] MPI Communicator which contains all nodes of the local partition.

  • timer[inout] Timer object which is used to store timing information

coor_t *stage()

Triggers the staging procedure. Data is staged on the first partition and then cloned to all other partitions.

Returns:

Pointer to the local memory which contains the staged coordinates (2D data, frames x assigned atoms)

inline size_t staged_data_size() const

Private Functions

void fill_coordinates(coor_t *p_localdata, size_t len, std::vector<size_t> frames)
void stage_firstpartition()

Loads trajectory data into the first partition. Performs transposition of the data on the fly by making heavy use of buffers and MPI all to all communication.

void stage_fillpartitions()

Clones coordinates from the first to all remaining partitions.

void write(std::string filename, std::string format)

Dumps the coordinates to an output file. Writes in parallel.

Private Members

Sample &m_sample
boost::mpi::communicator &allcomm_
boost::mpi::communicator &partitioncomm_
Timer &timer_
size_t NFN
size_t NN
size_t NNPP
size_t NP
size_t NA
size_t NF
size_t staged_data_size_ = 0
coor_t *p_coordinates