OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Classes | Public Member Functions | Private Attributes | List of all members
MasterNode< SolutionState_t, NeighborStrategy_t > Class Template Reference

#include <MasterNode.h>

Inherits NeighborStrategy_t.

Classes

struct  Meta_t
 

Public Member Functions

 MasterNode (MPI_Comm master_comm, std::size_t buf_size_upper_bound, std::size_t dim, int island_id)
 
 ~MasterNode ()
 
void store (char *local_state, std::size_t buffer_size)
 store my best values
 
void collect (std::ostringstream &states)
 collect all best values from all other masters
 

Private Attributes

char * serialized_best_values_
 pointer to MPI window holding header (revision + size) and best solution state
 
std::size_t buf_size_upper_bound_
 upper bound on the serialized payload (excludes the header)
 
std::size_t win_bytes_
 total window size in bytes: sizeof(Meta_t) + buf_size_upper_bound_
 
std::size_t numMasters_
 
MPI_Comm master_comm_
 
MPI_Win win_
 
std::size_t myID_
 
std::set< std::size_t > collectFrom_
 neighbors we collect solution states from
 
std::size_t revision_
 my solution state revision number
 
std::vector< std::size_t > revision_state_
 revision numbers of my neighbors
 

Detailed Description

template<class SolutionState_t, class NeighborStrategy_t>
class MasterNode< SolutionState_t, NeighborStrategy_t >

Definition at line 53 of file MasterNode.h.

Constructor & Destructor Documentation

◆ MasterNode()

template<class SolutionState_t , class NeighborStrategy_t >
MasterNode< SolutionState_t, NeighborStrategy_t >::MasterNode ( MPI_Comm  master_comm,
std::size_t  buf_size_upper_bound,
std::size_t  dim,
int  island_id 
)
inline

◆ ~MasterNode()

template<class SolutionState_t , class NeighborStrategy_t >
MasterNode< SolutionState_t, NeighborStrategy_t >::~MasterNode ( )
inline

Member Function Documentation

◆ collect()

template<class SolutionState_t , class NeighborStrategy_t >
void MasterNode< SolutionState_t, NeighborStrategy_t >::collect ( std::ostringstream &  states)
inline

◆ store()

template<class SolutionState_t , class NeighborStrategy_t >
void MasterNode< SolutionState_t, NeighborStrategy_t >::store ( char *  local_state,
std::size_t  buffer_size 
)
inline

Member Data Documentation

◆ buf_size_upper_bound_

template<class SolutionState_t , class NeighborStrategy_t >
std::size_t MasterNode< SolutionState_t, NeighborStrategy_t >::buf_size_upper_bound_
private

upper bound on the serialized payload (excludes the header)

Definition at line 174 of file MasterNode.h.

Referenced by MasterNode< SolutionState_t, NeighborStrategy_t >::store().

◆ collectFrom_

template<class SolutionState_t , class NeighborStrategy_t >
std::set<std::size_t> MasterNode< SolutionState_t, NeighborStrategy_t >::collectFrom_
private

neighbors we collect solution states from

Definition at line 188 of file MasterNode.h.

Referenced by MasterNode< SolutionState_t, NeighborStrategy_t >::collect(), and MasterNode< SolutionState_t, NeighborStrategy_t >::MasterNode().

◆ master_comm_

template<class SolutionState_t , class NeighborStrategy_t >
MPI_Comm MasterNode< SolutionState_t, NeighborStrategy_t >::master_comm_
private

Definition at line 178 of file MasterNode.h.

◆ myID_

template<class SolutionState_t , class NeighborStrategy_t >
std::size_t MasterNode< SolutionState_t, NeighborStrategy_t >::myID_
private

◆ numMasters_

template<class SolutionState_t , class NeighborStrategy_t >
std::size_t MasterNode< SolutionState_t, NeighborStrategy_t >::numMasters_
private

◆ revision_

template<class SolutionState_t , class NeighborStrategy_t >
std::size_t MasterNode< SolutionState_t, NeighborStrategy_t >::revision_
private

my solution state revision number

Definition at line 190 of file MasterNode.h.

Referenced by MasterNode< SolutionState_t, NeighborStrategy_t >::store().

◆ revision_state_

template<class SolutionState_t , class NeighborStrategy_t >
std::vector<std::size_t> MasterNode< SolutionState_t, NeighborStrategy_t >::revision_state_
private

◆ serialized_best_values_

template<class SolutionState_t , class NeighborStrategy_t >
char* MasterNode< SolutionState_t, NeighborStrategy_t >::serialized_best_values_
private

pointer to MPI window holding header (revision + size) and best solution state

Definition at line 171 of file MasterNode.h.

Referenced by MasterNode< SolutionState_t, NeighborStrategy_t >::MasterNode(), MasterNode< SolutionState_t, NeighborStrategy_t >::store(), and MasterNode< SolutionState_t, NeighborStrategy_t >::~MasterNode().

◆ win_

template<class SolutionState_t , class NeighborStrategy_t >
MPI_Win MasterNode< SolutionState_t, NeighborStrategy_t >::win_
private

single window for header + solution state; all ranks must call MPI_Win_fence on it the same number of times, in the same order, which requires collectFrom_ to have equal cardinality on every rank

Definition at line 183 of file MasterNode.h.

Referenced by MasterNode< SolutionState_t, NeighborStrategy_t >::collect(), MasterNode< SolutionState_t, NeighborStrategy_t >::MasterNode(), MasterNode< SolutionState_t, NeighborStrategy_t >::store(), and MasterNode< SolutionState_t, NeighborStrategy_t >::~MasterNode().

◆ win_bytes_

template<class SolutionState_t , class NeighborStrategy_t >
std::size_t MasterNode< SolutionState_t, NeighborStrategy_t >::win_bytes_
private

total window size in bytes: sizeof(Meta_t) + buf_size_upper_bound_

Definition at line 176 of file MasterNode.h.

Referenced by MasterNode< SolutionState_t, NeighborStrategy_t >::collect(), and MasterNode< SolutionState_t, NeighborStrategy_t >::MasterNode().


The documentation for this class was generated from the following file: