cgma
CGMProcConfig Class Reference

Multi-CPU information for parallel CGM. More...

#include <CGMProcConfig.hpp>

List of all members.

Public Member Functions

 CGMProcConfig (MPI_Comm proc_comm=MPI_COMM_WORLD)
 Constructor.
 ~CGMProcConfig ()
unsigned proc_rank () const
 Get the current processor number.
unsigned proc_size () const
 Get the number of processors.
MPI_Comm proc_comm () const
 get/set the communicator for this proc config
void proc_comm (MPI_Comm this_comm)
void set_master (unsigned int proc)
unsigned int get_master ()

Private Attributes

MPI_Comm procComm
 MPI communicator set for this instance.
unsigned procRank
 rank of this processor
unsigned procSize
 number of processors
unsigned int master

Detailed Description

Multi-CPU information for parallel CGM.

Definition at line 12 of file CGMProcConfig.hpp.


Constructor & Destructor Documentation

Constructor.

Definition at line 4 of file CGMProcConfig.cpp.

  : procComm(proc_comm),
    master(0)
{
#ifdef USE_MPI
  int rank, size;
  MPI_Comm_rank(procComm, &rank); 
  procRank = (unsigned int) rank;
  MPI_Comm_size(procComm, &size); 
  procSize = (unsigned int) size;
#else
  procRank = 0;
  procSize = 1;
#endif
}

Definition at line 20 of file CGMProcConfig.cpp.

{
}

Member Function Documentation

unsigned int CGMProcConfig::get_master ( ) [inline]

Definition at line 53 of file CGMProcConfig.hpp.

                                              {
  return master;
}
MPI_Comm CGMProcConfig::proc_comm ( ) const [inline]

get/set the communicator for this proc config

Definition at line 28 of file CGMProcConfig.hpp.

{return procComm;}
void CGMProcConfig::proc_comm ( MPI_Comm  this_comm) [inline]

Definition at line 29 of file CGMProcConfig.hpp.

{procComm = this_comm;}
unsigned CGMProcConfig::proc_rank ( ) const [inline]

Get the current processor number.

Definition at line 20 of file CGMProcConfig.hpp.

    { return procRank; }
unsigned CGMProcConfig::proc_size ( ) const [inline]

Get the number of processors.

Definition at line 24 of file CGMProcConfig.hpp.

    { return procSize; }
void CGMProcConfig::set_master ( unsigned int  proc) [inline]

Definition at line 49 of file CGMProcConfig.hpp.

                                                       {
  master = proc;
}

Member Data Documentation

unsigned int CGMProcConfig::master [private]

Definition at line 45 of file CGMProcConfig.hpp.

MPI communicator set for this instance.

Definition at line 37 of file CGMProcConfig.hpp.

unsigned CGMProcConfig::procRank [private]

rank of this processor

Definition at line 40 of file CGMProcConfig.hpp.

unsigned CGMProcConfig::procSize [private]

number of processors

Definition at line 43 of file CGMProcConfig.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines