OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RandomStrategy Class Reference

#include <RandomStrategy.h>

Inheritance diagram for RandomStrategy:
Inheritance graph
[legend]
Collaboration diagram for RandomStrategy:
Collaboration graph
[legend]

Public Member Functions

 RandomStrategy (size_t num_masters, boost::shared_ptr< CommTopology > topology, MPI_Comm comm=MPI_COMM_WORLD)
 
virtual ~RandomStrategy ()
 
void split ()
 

Private Member Functions

void fillPids (int num)
 
int nextRandomPid ()
 

Private Attributes

std::set< int > pids_
 
boost::random::mt19937 rng_
 

Additional Inherited Members

- Protected Member Functions inherited from SplitStrategy
 SplitStrategy (CmdArguments_t args, MPI_Comm comm=MPI_COMM_WORLD)
 
virtual ~SplitStrategy ()
 
virtual int getNrWorkerGroups () const =0
 Get number of worker groups. More...
 
MPI_Comm getComm () const
 
int getRank () const
 
int getGlobalRank () const
 
int getNP () const
 
Role_t getRole () const
 
int getLeader () const
 
int getPoller () const
 
- Protected Attributes inherited from SplitStrategy
int rank_
 
int global_rank_
 
int num_procs_
 
int group_id_
 
CmdArguments_t cmd_args_
 
Role_t role_
 
std::vector< unsigned int > colorings_
 defines comm splitting More...
 
int leader_
 every core specifies a leader (master is its own leader) More...
 
int poller_
 every core can specifies a master More...
 

Detailed Description

Randomly select num_masters master cores.

Definition at line 14 of file RandomStrategy.h.

Constructor & Destructor Documentation

RandomStrategy::RandomStrategy ( size_t  num_masters,
boost::shared_ptr< CommTopology topology,
MPI_Comm  comm = MPI_COMM_WORLD 
)
inline

Definition at line 18 of file RandomStrategy.h.

References fillPids(), and SplitStrategy::num_procs_.

Here is the call graph for this function:

virtual RandomStrategy::~RandomStrategy ( )
inlinevirtual

Definition at line 26 of file RandomStrategy.h.

Member Function Documentation

void RandomStrategy::fillPids ( int  num)
inlineprivate

Definition at line 72 of file RandomStrategy.h.

References pids_.

Referenced by RandomStrategy().

int RandomStrategy::nextRandomPid ( )
inlineprivate

Definition at line 78 of file RandomStrategy.h.

References pids_, and rng_.

Referenced by split().

void RandomStrategy::split ( )
inlinevirtual

Forcing concrete implementation to split and assign poller, optimizer and worker nodes.

Implements SplitStrategy.

Definition at line 30 of file RandomStrategy.h.

References nextRandomPid(), pids_, SplitStrategy::rank_, and SplitStrategy::role_.

Here is the call graph for this function:

Member Data Documentation

std::set<int> RandomStrategy::pids_
private

Definition at line 68 of file RandomStrategy.h.

Referenced by fillPids(), nextRandomPid(), and split().

boost::random::mt19937 RandomStrategy::rng_
private

Definition at line 69 of file RandomStrategy.h.

Referenced by nextRandomPid().


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