Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
topology.h
Go to the documentation of this file.
1 /*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/
2 
3 #ifndef __INT_TOPOLOGY_H__
4 #define __INT_TOPOLOGY_H__
5 
6 #include "../interface/common.h"
7 
8 namespace CTF_int {
9  class mapping;
12 
13  /* \brief mesh/torus topology configuration */
14  class topology {
15  public:
16  int order;
17  int * lens;
18  int * lda;
22 
23  //topology();
24  ~topology();
25 
30  topology(topology const & other);
31 
39  topology(int order_,
40  int const * lens_,
41  CommData cdt,
42  bool activate=false);
43 
44  /* \brief create (split off) MPI communicators, re-entrant */
45  void activate();
46 
47  /* \breif free MPI communicators, re-entrant */
48  void deactivate();
49  };
50 
58  TOPOLOGY mach);
59 
64  std::vector< topology* > get_generic_topovec(CommData cdt);
65 
71  std::vector< topology* > peel_perm_torus(topology * phys_topology,
72  CommData cdt);
78  std::vector< topology* > peel_torus(topology const * topo,
80 
87  int find_topology(topology const * topo,
88  std::vector< topology* > & topovec);
89 
90 
100  int get_best_topo(int64_t nvirt,
101  int topo,
102  CommData global_comm,
103  int64_t bcomm_vol=0,
104  int64_t bmemuse=0);
105 
106 
118  void extract_free_comms(topology const * topo,
119  int order_A,
120  mapping const * edge_map_A,
121  int order_B,
122  mapping const * edge_map_B,
123  int & num_sub_phys_dims,
124  CommData * * psub_phys_comm,
125  int ** pcomm_idx);
126 
127 
134  int can_morph(topology const * topo_keep,
135  topology const * topo_change);
136 
144  void morph_topo(topology const * new_topo,
145  topology const * old_topo,
146  int order,
147  mapping * edge_map);
148 }
149 
150 #endif
std::vector< topology * > peel_torus(topology const *topo, CommData glb_comm)
folds specified topology into all configurations of lesser dimensionality
Definition: topology.cxx:537
int find_topology(topology const *topo, std::vector< topology * > &topovec)
searches for an equivalent topology in avector of topologies
Definition: topology.cxx:571
int get_best_topo(int64_t nvirt, int topo, CommData global_comm, int64_t bcomm_vol, int64_t bmemuse)
get the best topologoes (least nvirt) over all procs
Definition: topology.cxx:591
std::vector< topology * > peel_perm_torus(topology *phys_topology, CommData cdt)
folds specified topology and all of its permutations into all configurations of lesser dimensionality...
Definition: topology.cxx:488
topology * get_phys_topo(CommData glb_comm, TOPOLOGY mach)
get dimension and torus lengths of specified topology
Definition: topology.cxx:94
CommData * dim_comm
Definition: topology.h:20
int can_morph(topology const *topo_keep, topology const *topo_change)
determines if two topologies are compatible with each other
Definition: topology.cxx:683
CommData glb_comm
Definition: topology.h:21
topology(topology const &other)
copy constructor
Definition: topology.cxx:28
void extract_free_comms(topology const *topo, int order_A, mapping const *edge_map_A, int order_B, mapping const *edge_map_B, int &num_sub_phys_dims, CommData **psub_phys_comm, int **pcomm_idx)
extracts the set of physical dimensions still available for mapping
Definition: topology.cxx:628
std::vector< topology * > get_generic_topovec(CommData cdt)
computes all topology configurations given undelying physical topology information ...
Definition: topology.cxx:449
TOPOLOGY
Definition: topology.h:10
void morph_topo(topology const *new_topo, topology const *old_topo, int order, mapping *edge_map)
morphs a tensor topology into another
Definition: topology.cxx:700