Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEDCoupling::MPIProcessorGroup Class Reference
Inheritance diagram for MEDCoupling::MPIProcessorGroup:
Collaboration diagram for MEDCoupling::MPIProcessorGroup:

Public Member Functions

bool containsMyRank () const
 
ProcessorGroupcreateComplementProcGroup () const
 
ProcessorGroupcreateProcGroup () const
 
virtual MPIProcessorGroupdeepCopy () const
 
virtual ProcessorGroupfuse (const ProcessorGroup &) const
 
const MPI_Comm * getComm () const
 
MPI_Comm getWorldComm ()
 
void intersect (ProcessorGroup &)
 
 MPIProcessorGroup (const CommInterface &interface)
 
 MPIProcessorGroup (const CommInterface &interface, std::set< int > proc_ids, const MPI_Comm &world_comm=MPI_COMM_WORLD)
 
 MPIProcessorGroup (const ProcessorGroup &proc_group, std::set< int > proc_ids)
 
 MPIProcessorGroup (const CommInterface &interface, int pstart, int pend, const MPI_Comm &world_comm=MPI_COMM_WORLD)
 
 MPIProcessorGroup (const MPIProcessorGroup &other)
 
int myRank () const
 
int translateRank (const ProcessorGroup *group, int rank) const
 
virtual ~MPIProcessorGroup ()
 
- Public Member Functions inherited from MEDCoupling::ProcessorGroup
bool contains (int rank) const
 
const CommInterfacegetCommInterface () const
 
virtual const std::set< int > & getProcIDs () const
 
 ProcessorGroup (const CommInterface &interface)
 
 ProcessorGroup (const CommInterface &interface, std::set< int > proc_ids)
 
 ProcessorGroup (const ProcessorGroup &proc_group, std::set< int > proc_ids)
 
 ProcessorGroup (const ProcessorGroup &other)
 
 ProcessorGroup (const CommInterface &interface, int start, int end)
 
int size () const
 
virtual ~ProcessorGroup ()
 

Additional Inherited Members

- Protected Attributes inherited from MEDCoupling::ProcessorGroup
const CommInterface _comm_interface
 
std::set< int > _proc_ids
 

Detailed Description

The MPIProcessorGroup class represents a set of distinct "processors" (computation nodes) in a MPI code. It is used to define the MPI topology of code couplings.

Groups can be set up in various ways, the most common being the use of the MPIProcessorGroup(Comminterface, int pfirst, int plast) constructor.

The following code excerpt creates two processor groups on respectively 3 and 2 processors.

int main()
{
MPI_Init(&argc,&argv);
CommInterface comm_interface;
MPIProcessorGroup codeA_group(comm_interface, 0, 2);  // groups processors 0, 1 and 2
MPIProcessorGroup codeB_group(comm_interface, 3, 4);  // groups processors 3 and 4

...
}

Constructor & Destructor Documentation

MEDCoupling::MPIProcessorGroup::MPIProcessorGroup ( const CommInterface interface)

Creates a processor group that is based on all the processors of MPI_COMM_WORLD .This routine must be called by all processors in MPI_COMM_WORLD.

Parameters
interfaceCommInterface object giving access to the MPI communication layer

References MEDCoupling::ProcessorGroup::_comm_interface, MEDCoupling::ProcessorGroup::_proc_ids, MEDCoupling::CommInterface::commGroup(), MEDCoupling::CommInterface::commSize(), and MEDCoupling::ProcessorGroup::size().

Referenced by createComplementProcGroup(), createProcGroup(), deepCopy(), and fuse().

MEDCoupling::MPIProcessorGroup::MPIProcessorGroup ( const CommInterface interface,
std::set< int >  proc_ids,
const MPI_Comm &  world_comm = MPI_COMM_WORLD 
)
MEDCoupling::MPIProcessorGroup::MPIProcessorGroup ( const ProcessorGroup proc_group,
std::set< int >  proc_ids 
)
MEDCoupling::MPIProcessorGroup::MPIProcessorGroup ( const CommInterface comm_interface,
int  pstart,
int  pend,
const MPI_Comm &  world_comm = MPI_COMM_WORLD 
)

Creates a processor group that is based on the processors between pstart and pend. This routine must be called by all processors in MPI_COMM_WORLD.

Parameters
comm_interfaceCommInterface object giving access to the MPI communication layer
pstartid in MPI_COMM_WORLD of the first processor in the group
pendid in MPI_COMM_WORLD of the last processor in the group

References MEDCoupling::ProcessorGroup::_comm_interface, MEDCoupling::CommInterface::commCreate(), MEDCoupling::CommInterface::commGroup(), MEDCoupling::CommInterface::commRank(), MEDCoupling::CommInterface::commSize(), MEDCoupling::CommInterface::groupFree(), and MEDCoupling::CommInterface::groupIncl().

MEDCoupling::MPIProcessorGroup::MPIProcessorGroup ( const MPIProcessorGroup other)
MEDCoupling::MPIProcessorGroup::~MPIProcessorGroup ( )
virtual

Member Function Documentation

MPIProcessorGroup * MEDCoupling::MPIProcessorGroup::deepCopy ( ) const
virtual
ProcessorGroup * MEDCoupling::MPIProcessorGroup::fuse ( const ProcessorGroup group) const
virtual

Adding processors of group group to local group.

Parameters
groupgroup that is to be fused with current group
Returns
new group formed by the fusion of local group and group.

Implements MEDCoupling::ProcessorGroup.

References MEDCoupling::ProcessorGroup::_comm_interface, MEDCoupling::ProcessorGroup::_proc_ids, MEDCoupling::ProcessorGroup::getProcIDs(), and MPIProcessorGroup().

void MEDCoupling::MPIProcessorGroup::intersect ( ProcessorGroup )
virtual
int MEDCoupling::MPIProcessorGroup::myRank ( ) const
virtual
bool MEDCoupling::MPIProcessorGroup::containsMyRank ( ) const
virtual
int MEDCoupling::MPIProcessorGroup::translateRank ( const ProcessorGroup group,
int  rank 
) const
virtual

Translation of the rank id between two processor groups. This method translates rank rank on the current processor group to the rank on group pointed by group.

Parameters
groupgroup from which the rank is expected
rankrank on group group of the processor which is to be translated
Returns
rank on local group

Implements MEDCoupling::ProcessorGroup.

Referenced by MEDCoupling::StructuredCoincidentDEC::prepareSourceDE(), MEDCoupling::StructuredCoincidentDEC::prepareTargetDE(), MEDCoupling::ExplicitCoincidentDEC::prepareTargetDE(), MEDCoupling::StructuredCoincidentDEC::recvData(), MEDCoupling::ExplicitCoincidentDEC::recvData(), MEDCoupling::BlockTopology::serialize(), and MEDCoupling::ExplicitCoincidentDEC::transferMappingToSource().

const MPI_Comm* MEDCoupling::MPIProcessorGroup::getComm ( ) const
ProcessorGroup * MEDCoupling::MPIProcessorGroup::createComplementProcGroup ( ) const
virtual

Creates a processor group that is the complement of the current group inside MPI_COMM_WORLD

Returns
pointer to the new ProcessorGroup structure.

Implements MEDCoupling::ProcessorGroup.

References MEDCoupling::ProcessorGroup::_comm_interface, MEDCoupling::ProcessorGroup::_proc_ids, MPIProcessorGroup(), and MEDCoupling::CommInterface::worldSize().

ProcessorGroup * MEDCoupling::MPIProcessorGroup::createProcGroup ( ) const
virtual
MPI_Comm MEDCoupling::MPIProcessorGroup::getWorldComm ( )