Source: group.h


Annotated List
Files
Globals
Hierarchy
Index
#ifndef GROUP_FILE
#define GROUP_FILE

/*#include */
#include 
using namespace std;
#include 

//##############################################################################

/**  A subset of processors forms its own communication group.
*/
class Communicator
{
  public:
  /**  Form the communication subgroup
   @param parent_comm communication supergroup
   @param proc_list   array of processes that form the subgroup
   @param node2proc   array of processes a node belongs to
  */
   Communicator(const MPI::Intracomm &parent_comm, 
                 const vector &proc_list,
                 const vector< vector > &node2proc );
  
   Communicator();
  
   Communicator(const Communicator &orig);

   ~Communicator();
   
   int groupSize() const { return comm_.Get_size(); };
   
   int bufferSize() const { return buf2loc_.size(); }; 
   
   const MPI::Intracomm & getComm() const { return comm_; };
   
   const vector & getProcs() const { return procs_; };
   
   int Root() const { return procs_[0]; };
/*   int Root() const { return 0; };*/

   bool isRoot() const { return isroot_; };
   
   bool isValid() const { return isvalid_; };

  
/*  private:*/
    const vector procs_;     /** processes in communicator*/

    const MPI::Intracomm &parent_comm_; /** original communicator */
          MPI::Intracomm comm_;         /** subgroup communicator */
    
    vector buf2loc_;    /** mapping from buffer to local numbering */
    
          bool isvalid_;     /** is this communication group valid for my proc? */
    const bool isroot_;      /** Are am I the root of this group? */
  
};

//##############################################################################

#endif

Generated by: ghaase on mephisto on Fri Apr 11 18:03:43 2008, using kdoc 2.0a54.