OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
ManyMasterSplit< TopoDiscoveryStrategy > Class Template Reference

#include <ManyMasterSplit.h>

Inheritance diagram for ManyMasterSplit< TopoDiscoveryStrategy >:
Collaboration diagram for ManyMasterSplit< TopoDiscoveryStrategy >:

Public Member Functions

 ManyMasterSplit (CmdArguments_t args, MPI_Comm comm=MPI_COMM_WORLD)
virtual ~ManyMasterSplit ()
virtual void split ()
virtual int getNrWorkerGroups () const
 Get number of worker groups.

Protected Member Functions

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

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
int leader_
 every core specifies a leader (master is its own leader)
int poller_
 every core can specifies a master

Private Member Functions

void parseArguments ()

Private Attributes

size_t num_masters_
size_t num_coworkers_worker_
MPI_Comm comm_
 communicator we are splitting

Detailed Description

template<class TopoDiscoveryStrategy>
class ManyMasterSplit< TopoDiscoveryStrategy >

A very simple splitting strategy where we have a one core optimizer and pilot (and k of those "islands") and many-core worker groups. The number of islands and co-workers is retrieved from the passed command line arguments:

  • num-masters

  • num-coworkers

Definition at line 22 of file ManyMasterSplit.h.

Constructor & Destructor Documentation

◆ ManyMasterSplit()

template<class TopoDiscoveryStrategy>
ManyMasterSplit< TopoDiscoveryStrategy >::ManyMasterSplit ( CmdArguments_t args,
MPI_Comm comm = MPI_COMM_WORLD )
inline

Definition at line 26 of file ManyMasterSplit.h.

References SplitStrategy::SplitStrategy().

Here is the call graph for this function:

◆ ~ManyMasterSplit()

template<class TopoDiscoveryStrategy>
virtual ManyMasterSplit< TopoDiscoveryStrategy >::~ManyMasterSplit ( )
inlinevirtual

Definition at line 31 of file ManyMasterSplit.h.

Member Function Documentation

◆ getComm()

MPI_Comm SplitStrategy::getComm ( ) const
inlineinherited

Definition at line 49 of file SplitStrategy.h.

References comm_.

Referenced by ManyMasterSplit< TopoDiscoveryStrategy >::parseArguments().

◆ getGlobalRank()

int SplitStrategy::getGlobalRank ( ) const
inlineinherited

Definition at line 52 of file SplitStrategy.h.

References global_rank_.

◆ getLeader()

int SplitStrategy::getLeader ( ) const
inlineinherited

Definition at line 56 of file SplitStrategy.h.

References leader_.

◆ getNP()

int SplitStrategy::getNP ( ) const
inlineinherited

Definition at line 53 of file SplitStrategy.h.

References num_procs_.

◆ getNrWorkerGroups()

template<class TopoDiscoveryStrategy>
virtual int ManyMasterSplit< TopoDiscoveryStrategy >::getNrWorkerGroups ( ) const
inlinevirtual

Get number of worker groups.

Implements SplitStrategy.

Definition at line 97 of file ManyMasterSplit.h.

References num_coworkers_worker_, num_masters_, and SplitStrategy::num_procs_.

◆ getPoller()

int SplitStrategy::getPoller ( ) const
inlineinherited

Definition at line 57 of file SplitStrategy.h.

References poller_.

◆ getRank()

int SplitStrategy::getRank ( ) const
inlineinherited

Definition at line 51 of file SplitStrategy.h.

References rank_.

◆ getRole()

Role_t SplitStrategy::getRole ( ) const
inlineinherited

Definition at line 55 of file SplitStrategy.h.

References role_.

◆ parseArguments()

template<class TopoDiscoveryStrategy>
void ManyMasterSplit< TopoDiscoveryStrategy >::parseArguments ( )
inlineprivate

Definition at line 106 of file ManyMasterSplit.h.

References SplitStrategy::cmd_args_, SplitStrategy::getComm(), num_coworkers_worker_, num_masters_, and SplitStrategy::num_procs_.

Referenced by split().

Here is the call graph for this function:

◆ split()

template<class TopoDiscoveryStrategy>
virtual void ManyMasterSplit< TopoDiscoveryStrategy >::split ( )
inlinevirtual

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

Implements SplitStrategy.

Definition at line 35 of file ManyMasterSplit.h.

References SplitStrategy::colorings_, SplitStrategy::group_id_, SplitStrategy::leader_, num_coworkers_worker_, num_masters_, SplitStrategy::num_procs_, OPTIMIZER, parseArguments(), POLLER, SplitStrategy::poller_, SplitStrategy::rank_, SplitStrategy::role_, and WORKER.

Here is the call graph for this function:

Member Data Documentation

◆ cmd_args_

CmdArguments_t SplitStrategy::cmd_args_
protectedinherited

◆ colorings_

std::vector<unsigned int> SplitStrategy::colorings_
protectedinherited

defines comm splitting

Definition at line 78 of file SplitStrategy.h.

Referenced by ManyMasterSplit< TopoDiscoveryStrategy >::split().

◆ comm_

MPI_Comm SplitStrategy::comm_
privateinherited

communicator we are splitting

Definition at line 63 of file SplitStrategy.h.

Referenced by getComm(), and SplitStrategy().

◆ global_rank_

int SplitStrategy::global_rank_
protectedinherited

Definition at line 69 of file SplitStrategy.h.

Referenced by getGlobalRank(), and SplitStrategy().

◆ group_id_

int SplitStrategy::group_id_
protectedinherited

◆ leader_

int SplitStrategy::leader_
protectedinherited

every core specifies a leader (master is its own leader)

Definition at line 81 of file SplitStrategy.h.

Referenced by getLeader(), and ManyMasterSplit< TopoDiscoveryStrategy >::split().

◆ num_coworkers_worker_

template<class TopoDiscoveryStrategy>
size_t ManyMasterSplit< TopoDiscoveryStrategy >::num_coworkers_worker_
private

Definition at line 104 of file ManyMasterSplit.h.

Referenced by getNrWorkerGroups(), parseArguments(), and split().

◆ num_masters_

template<class TopoDiscoveryStrategy>
size_t ManyMasterSplit< TopoDiscoveryStrategy >::num_masters_
private

Definition at line 103 of file ManyMasterSplit.h.

Referenced by getNrWorkerGroups(), parseArguments(), and split().

◆ num_procs_

◆ poller_

int SplitStrategy::poller_
protectedinherited

every core can specifies a master

Definition at line 84 of file SplitStrategy.h.

Referenced by getPoller(), and ManyMasterSplit< TopoDiscoveryStrategy >::split().

◆ rank_

int SplitStrategy::rank_
protectedinherited

◆ role_

Role_t SplitStrategy::role_
protectedinherited

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