Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

MPIGroup.h

Go to the documentation of this file.
00001 #ifndef MPIGROUP_H
00002 #define MPIGROUP_H
00003 
00004 #ifdef USE_MPI_GROUPS /* we're ignoring MPI groups for now */
00005 
00006 #include "SundanceDefs.h"
00007 #include "TSFArray.h"
00008 
00009 #if HAVE_MPI
00010 #include "mpi.h"
00011 #endif
00012 
00013 
00014 
00015 namespace Sundance
00016 {
00017   using std::string;
00018 
00019   class MPIGroup
00020     {
00021       friend class MPIComm;
00022     public:
00023       /** create a subgroup of a communicator */
00024       MPIGroup(const MPIComm& parent,
00025                const TSFArray<int>& procList,
00026                const string& name);
00027 
00028       /** return a human-readable name for the group */
00029       const string& name() const {return name_;}
00030 
00031       /** Determine whether a group contains a given process */
00032       bool containsProc(int pid) const ;
00033 
00034       /** get the number of processes in the group */
00035       int getNProc() const ;
00036 
00037 #if HAVE_MPI
00038       MPI_Group getGroup() const {return group_;}
00039 
00040     private:
00041       MPI_Group group_;
00042 #endif
00043       string name_;
00044     };
00045 
00046 }
00047 
00048 #endif /* USE_MPI_GROUPS */
00049 
00050 #endif
00051 

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by