Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
world.h
Go to the documentation of this file.
1 #ifndef __WORLD_H__
2 #define __WORLD_H__
3 
4 #include "common.h"
5 #include <set>
6 #include "../mapping/topology.h"
7 
8 namespace CTF {
19  class World {
20  public:
22  MPI_Comm comm;
24  int rank;
26  int np;
28  std::vector< CTF_int::topology* > topovec;
36  std::mersenne_twister_engine<std::uint_fast64_t, 64, 312, 156, 31,
37  0xb5026f5aa96619e9, 29,
38  0x5555555555555555, 17,
39  0x71d67fffeda60000, 37,
40  0xfff7eee000000000, 43, 6364136223846793005> glob_wrld_rng;
41 
42 
43 
50  World(int argc, char * const * argv);
51 
56  World(World const & other);
57 
65  World(MPI_Comm comm = MPI_COMM_WORLD,
66  int argc = 0,
67  char * const * argv = NULL);
68 
77  World(int order,
78  int const * lens,
79  MPI_Comm comm = MPI_COMM_WORLD,
80  int argc = 0,
81  char * const * argv = NULL);
82 
87  World(char const * emptystring);
88 
89 
93  ~World();
94 
95 
96  bool operator==(World const & other){ return comm==other.comm; }
97  bool is_copy;
98  private:
99  /* whether this world is a copy of the universe object */
100 
106  int initialize(int argc,
107  const char * const * argv);
108 
119  int init(MPI_Comm global_context,
121  int argc = 0,
122  const char * const * argv = NULL);
123 
124 
137  int init(MPI_Comm global_context,
138  int order,
139  int const * dim_len,
140  int argc = 0,
141  const char * const * argv = NULL);
142  };
143 
144  World & get_universe();
149 }
150 
151 namespace CTF_int {
152  class grid_wrapper {
153  public:
154  int pr;
155  int pc;
156  int ctxt;
157 
158  bool operator<(grid_wrapper const & other) const;
159  };
160  extern std::set<grid_wrapper> scalapack_grids;
161 
162 }
163 #endif
bool initialized
whether the world has been initialized
Definition: world.h:30
CTF_int::CommData cdt
communicator data for MPI comm defining this world
Definition: world.h:32
an instance of the CTF library (world) on a MPI communicator
Definition: world.h:19
int rank
rank of local processor
Definition: world.h:24
bool is_copy
Definition: world.h:97
std::set< grid_wrapper > scalapack_grids
index for ScaLAPACK processor grids
Definition: world.cxx:27
CTF_int::topology * phys_topology
main torus topology corresponding to the world
Definition: world.h:34
World & get_universe()
Definition: world.cxx:309
~World()
frees CTF library
Definition: world.cxx:96
bool operator==(World const &other)
Definition: world.h:96
Definition: apsp.cxx:17
std::vector< CTF_int::topology * > topovec
derived topologies
Definition: world.h:28
World(int argc, char *const *argv)
creates CTF library on comm that can output profile data into a file with a name based on the main ar...
Definition: world.cxx:34
std::mersenne_twister_engine< std::uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9, 29, 0x5555555555555555, 17, 0x71d67fffeda60000, 37, 0xfff7eee000000000, 43, 6364136223846793005 > glob_wrld_rng
random number generator for this world object (same seed for each rank)
Definition: world.h:40
TOPOLOGY
Definition: topology.h:10
int np
number of processors
Definition: world.h:26
MPI_Comm comm
set of processors making up this world
Definition: world.h:22