| 
    Bridge++
    Ver. 1.3.x
    
   | 
 
Communication library which wraps MPI. More...
#include <communicator.h>
Classes | |
| class | Base | 
| base case  More... | |
Static Public Member Functions | |
| static int | init (int *pargc, char ***pargv) | 
| initialize communicator  More... | |
| static int | finalize () | 
| finalize communicator  More... | |
| static void | abort () | 
| terminate communicator  More... | |
| static int | setup (int ninstance=1) | 
| setup communicator  More... | |
| static bool | is_primary () | 
| check if the present node is primary in small communicator.  More... | |
| static bool | is_primary_master () | 
| check if the present node is primary in global communicator.  More... | |
| static int | self () | 
| rank within small world.  More... | |
| static int | nodeid () | 
| alternative name for self().  More... | |
| static int | size () | 
| size of small world.  More... | |
| static int | ipe (const int dir) | 
| logical coordinate of current proc.  More... | |
| static int | npe (const int dir) | 
| logical grid extent  More... | |
| static int | grid_rank (int *rank, const int *grid_coord) | 
| find rank number from grid coordinate.  More... | |
| static int | grid_coord (int *grid_coord, const int rank) | 
| find grid coordinate from rank number.  More... | |
| static int | grid_dims (int *grid_dims) | 
| find grid dimensions.  More... | |
| static int | sync () | 
| synchronize within small world.  More... | |
| static int | broadcast (int count, double *data, int sender) | 
| broadcast array of double from sender.  More... | |
| static int | broadcast (int count, int *data, int sender) | 
| broadcast array of integer from sender.  More... | |
| static int | broadcast (int count, string &data, int sender) | 
| broadcast a string from sender. count is insignificant.  More... | |
| static int | exchange (int count, double *recv_buf, double *send_buf, int idir, int ipm, int tag) | 
| receive array of double from upstream specified by idir and ipm, and send array to downstream.  More... | |
| static int | exchange (int count, int *recv_buf, int *send_buf, int idir, int ipm, int tag) | 
| receive array of int from upstream specified by idir and ipm, and send array to downstream.  More... | |
| static int | send_1to1 (int count, double *recv_buf, double *send_buf, int p_to, int p_from, int tag) | 
| send array of double from rank p_from to rank p_to. communication distinguished by tag.  More... | |
| static int | send_1to1 (int count, int *recv_buf, int *send_buf, int p_to, int p_from, int tag) | 
| send array of int from rank p_from to rank p_to. communication distinguished by tag.  More... | |
| static int | reduce_sum (int count, double *recv_buf, double *send_buf, int pattern=0) | 
| make a global sum of an array of double over the communicator. pattern specifies the dimensions to be reduced.  More... | |
| static int | reduce_sum (int count, int *recv_buf, int *send_buf, int pattern=0) | 
| make a global sum of an array of int over the communicator. pattern specifies the dimensions to be reduced.  More... | |
| static int | reduce_max (int count, double *recv_buf, double *send_buf, int pattern=0) | 
| find a global maximum of an array of double over the communicator. pattern specifies the dimensions to be reduced.  More... | |
| static int | reduce_max (int count, int *recv_buf, int *send_buf, int pattern=0) | 
| find a global maximum of an array of int over the communicator. pattern specifies the dimensions to be reduced.  More... | |
| static int | reduce_min (int count, double *recv_buf, double *send_buf, int pattern=0) | 
| find a global minimum of an array of double over the communicator. pattern specifies the dimensions to be reduced.  More... | |
| static int | reduce_min (int count, int *recv_buf, int *send_buf, int pattern=0) | 
| find a global minimum of an array of int over the communicator. pattern specifies the dimensions to be reduced.  More... | |
| static double | reduce_sum (double) | 
| alternative interface to reduce_sum(). returns the global sum of a double over the whole communicator.  More... | |
| static double | reduce_max (double) | 
| alternative interface to reduce_max(). returns the global sum of a double over the whole communicator.  More... | |
| static double | reduce_min (double) | 
| alternative interface to reduce_min(). returns the global sum of a double over the whole communicator.  More... | |
| static double | get_time () | 
| obtain a wall-clock time.  More... | |
| static Channel * | send_init (int count, int idir, int ipm) | 
| static Channel * | recv_init (int count, int idir, int ipm) | 
| static int | status () | 
Private Member Functions | |
| Communicator () | |
| no instance at all  More... | |
| Communicator (const Communicator &) | |
| Communicator & | operator= (const Communicator &) | 
| ~Communicator () | |
Communication library which wraps MPI.
This class provides communication library which wraps MPI (message passing interface) if the implementation file communicator_mpi.cpp is bound. For single processor environment with no MPI library, communicator_dummy.cpp should be bound instead. [28 Dec 2011 H.Matsufuru]
This class defines interface of inter-node communication routines. All methods are static, i.e. class-methods (like global). The explicit definitions are hidden in the implementation classes.
Definition at line 46 of file communicator.h.
      
  | 
  inlineprivate | 
no instance at all
communicator class is not indented to be instantiated. constructor, copy constroctor, assignment operator, and destructor are defined as private.
Definition at line 171 of file communicator.h.
      
  | 
  inlineprivate | 
Definition at line 172 of file communicator.h.
      
  | 
  inlineprivate | 
Definition at line 175 of file communicator.h.
      
  | 
  static | 
terminate communicator
terminate communicator immediately at some erroneous situations.
Definition at line 41 of file communicator.cpp.
      
  | 
  static | 
broadcast array of double from sender.
Definition at line 153 of file communicator.cpp.
      
  | 
  static | 
broadcast array of integer from sender.
Definition at line 160 of file communicator.cpp.
      
  | 
  static | 
broadcast a string from sender. count is insignificant.
Definition at line 167 of file communicator.cpp.
      
  | 
  static | 
receive array of double from upstream specified by idir and ipm, and send array to downstream.
Definition at line 174 of file communicator.cpp.
      
  | 
  static | 
receive array of int from upstream specified by idir and ipm, and send array to downstream.
Definition at line 184 of file communicator.cpp.
      
  | 
  static | 
finalize communicator
finalize communicator. terminates communication environment.
Definition at line 34 of file communicator.cpp.
      
  | 
  static | 
obtain a wall-clock time.
Definition at line 306 of file communicator.cpp.
      
  | 
  static | 
find grid coordinate from rank number.
Definition at line 118 of file communicator.cpp.
      
  | 
  static | 
find grid dimensions.
Definition at line 125 of file communicator.cpp.
      
  | 
  static | 
find rank number from grid coordinate.
Definition at line 111 of file communicator.cpp.
      
  | 
  static | 
initialize communicator
initialize communicator.
| pargc | pointer to argc passed from main function. | 
| pargv | pointer to argv passed from main function. | 
they would further be passed to communication library for hints to machine-dependent configurations.
MPI implementation of Communicator class which delegates to Communicator_impl class.
Definition at line 27 of file communicator.cpp.
      
  | 
  static | 
logical coordinate of current proc.
Definition at line 97 of file communicator.cpp.
      
  | 
  static | 
check if the present node is primary in small communicator.
Definition at line 55 of file communicator.cpp.
      
  | 
  static | 
check if the present node is primary in global communicator.
Definition at line 62 of file communicator.cpp.
      
  | 
  inlinestatic | 
alternative name for self().
Definition at line 92 of file communicator.h.
      
  | 
  static | 
logical grid extent
Definition at line 104 of file communicator.cpp.
      
  | 
  private | 
      
  | 
  static | 
Definition at line 320 of file communicator.cpp.
      
  | 
  static | 
find a global maximum of an array of double over the communicator. pattern specifies the dimensions to be reduced.
Definition at line 235 of file communicator.cpp.
      
  | 
  static | 
find a global maximum of an array of int over the communicator. pattern specifies the dimensions to be reduced.
Definition at line 245 of file communicator.cpp.
      
  | 
  static | 
alternative interface to reduce_max(). returns the global sum of a double over the whole communicator.
Definition at line 286 of file communicator.cpp.
      
  | 
  static | 
find a global minimum of an array of double over the communicator. pattern specifies the dimensions to be reduced.
Definition at line 255 of file communicator.cpp.
      
  | 
  static | 
find a global minimum of an array of int over the communicator. pattern specifies the dimensions to be reduced.
Definition at line 265 of file communicator.cpp.
      
  | 
  static | 
alternative interface to reduce_min(). returns the global sum of a double over the whole communicator.
Definition at line 296 of file communicator.cpp.
      
  | 
  static | 
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be reduced.
Definition at line 215 of file communicator.cpp.
      
  | 
  static | 
make a global sum of an array of int over the communicator. pattern specifies the dimensions to be reduced.
Definition at line 225 of file communicator.cpp.
      
  | 
  static | 
alternative interface to reduce_sum(). returns the global sum of a double over the whole communicator.
Definition at line 275 of file communicator.cpp.
      
  | 
  static | 
rank within small world.
Definition at line 69 of file communicator.cpp.
      
  | 
  static | 
send array of double from rank p_from to rank p_to. communication distinguished by tag.
Definition at line 194 of file communicator.cpp.
      
  | 
  static | 
send array of int from rank p_from to rank p_to. communication distinguished by tag.
Definition at line 204 of file communicator.cpp.
      
  | 
  static | 
Definition at line 313 of file communicator.cpp.
      
  | 
  static | 
setup communicator
setup communicator environment such as logical layout. called after the parameters are obtained.
| ninstance | specifies multiplicity of trivial parallelism. (expects 1 at present). | 
Definition at line 48 of file communicator.cpp.
      
  | 
  static | 
size of small world.
Definition at line 76 of file communicator.cpp.
      
  | 
  static | 
Definition at line 327 of file communicator.cpp.
      
  | 
  static | 
synchronize within small world.
Definition at line 132 of file communicator.cpp.