Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
dgtog_redist.cxx
Go to the documentation of this file.
1 
2 
3 #include "dgtog_calc_cnt.h"
4 #include "dgtog_redist.h"
5 #include "../shared/util.h"
6 #include "dgtog_bucket.h"
7 namespace CTF_int {
8  //static double init_mdl[] = {COST_LATENCY, COST_LATENCY, COST_NETWBW};
10 
11  double dgtog_est_time(int64_t tot_sz, int np){
12  double ps[] = {1.0, (double)log2(np), (double)tot_sz*log2(np)};
13  return dgtog_res_mdl.est_time(ps);
14  }
15 }
16 
17 #define MTAG 777
18 namespace CTF_redist_noror {
19  #include "dgtog_redist_ror.h"
20 }
21 
22 namespace CTF_redist_ror {
23  #define ROR
24  #include "dgtog_redist_ror.h"
25  #undef ROR
26 }
27 
28 namespace CTF_redist_ror_isr {
29  #define ROR
30  #define IREDIST
31  #include "dgtog_redist_ror.h"
32  #undef IREDIST
33  #undef ROR
34 }
35 
36 namespace CTF_redist_ror_put {
37  #define ROR
38  #define PUTREDIST
39  #include "dgtog_redist_ror.h"
40  #undef PUTREDIST
41  #undef ROR
42 }
43 
45  #define ROR
46  #define IREDIST
47  #define WAITANY
48  #include "dgtog_redist_ror.h"
49  #undef WAITANY
50  #undef IREDIST
51  #undef ROR
52 }
53 
54 #ifdef USE_FOMPI
55 namespace CTF_redist_ror_put_any {
56  #define ROR
57  #define IREDIST
58  #define PUTREDIST
59  #define WAITANY
60  #define PUT_NOTIFY
61  #include "dgtog_redist_ror.h"
62  #undef PUT_NOTIFY
63  #undef WAITANY
64  #undef PUTREDIST
65  #undef IREDIST
66  #undef ROR
67 }
68 #endif
69 
70 
71 namespace CTF_int {
72 
73 
74  void dgtog_reshuffle(int const * sym,
75  int const * edge_len,
76  distribution const & old_dist,
77  distribution const & new_dist,
78  char ** ptr_tsr_data,
79  char ** ptr_tsr_new_data,
80  algstrct const * sr,
81  CommData ord_glb_comm){
82  switch (CTF::DGTOG_SWITCH){
83  case 0:
84  CTF_redist_noror::dgtog_reshuffle(sym, edge_len, old_dist, new_dist, ptr_tsr_data, ptr_tsr_new_data, sr, ord_glb_comm);
85  break;
86  case 1:
87  CTF_redist_ror::dgtog_reshuffle(sym, edge_len, old_dist, new_dist, ptr_tsr_data, ptr_tsr_new_data, sr, ord_glb_comm);
88  break;
89  case 2:
90  CTF_redist_ror_isr::dgtog_reshuffle(sym, edge_len, old_dist, new_dist, ptr_tsr_data, ptr_tsr_new_data, sr, ord_glb_comm);
91  break;
92  case 3:
93  CTF_redist_ror_put::dgtog_reshuffle(sym, edge_len, old_dist, new_dist, ptr_tsr_data, ptr_tsr_new_data, sr, ord_glb_comm);
94  break;
95  case 4:
96  CTF_redist_ror_isr_any::dgtog_reshuffle(sym, edge_len, old_dist, new_dist, ptr_tsr_data, ptr_tsr_new_data, sr, ord_glb_comm);
97  break;
98 #ifdef USE_FOMPI
99  case 5:
100  CTF_redist_ror_put_any::dgtog_reshuffle(sym, edge_len, old_dist, new_dist, ptr_tsr_data, ptr_tsr_new_data, sr, ord_glb_comm);
101  break;
102 #else
103  case 5:
104  if (ord_glb_comm.rank == 0) printf("FOMPI needed for this redistribution, ABORTING\n");
105  assert(0);
106  break;
107 #endif
108  default:
109  assert(0);
110  break;
111  }
112 
113  }
114 }
double dgtog_res_mdl_init[]
Definition: init_models.cxx:28
double dgtog_est_time(int64_t tot_sz, int np)
estimates execution time, given this processor sends a receives tot_sz across np procs ...
void dgtog_reshuffle(int const *sym, int const *edge_len, distribution const &old_dist, distribution const &new_dist, char **ptr_tsr_data, char **ptr_tsr_new_data, algstrct const *sr, CommData ord_glb_comm)
Linear performance models, which given measurements, provides new model guess.
Definition: model.h:32
void dgtog_reshuffle(int const *sym, int const *edge_len, distribution const &old_dist, distribution const &new_dist, char **ptr_tsr_data, char **ptr_tsr_new_data, algstrct const *sr, CommData ord_glb_comm)
void dgtog_reshuffle(int const *sym, int const *edge_len, distribution const &old_dist, distribution const &new_dist, char **ptr_tsr_data, char **ptr_tsr_new_data, algstrct const *sr, CommData ord_glb_comm)
void dgtog_reshuffle(int const *sym, int const *edge_len, distribution const &old_dist, distribution const &new_dist, char **ptr_tsr_data, char **ptr_tsr_new_data, algstrct const *sr, CommData ord_glb_comm)
void dgtog_reshuffle(int const *sym, int const *edge_len, distribution const &old_dist, distribution const &new_dist, char **ptr_tsr_data, char **ptr_tsr_new_data, algstrct const *sr, CommData ord_glb_comm)
void dgtog_reshuffle(int const *sym, int const *edge_len, distribution const &old_dist, distribution const &new_dist, char **ptr_tsr_data, char **ptr_tsr_new_data, algstrct const *sr, CommData ord_glb_comm)
algstrct (algebraic structure) defines the elementwise operations computed in each tensor contraction...
Definition: algstrct.h:34
LinModel< 3 > dgtog_res_mdl(dgtog_res_mdl_init,"dgtog_res_mdl")
int DGTOG_SWITCH
Definition: common.cxx:12
void dgtog_reshuffle(int const *sym, int const *edge_len, distribution const &old_dist, distribution const &new_dist, char **ptr_tsr_data, char **ptr_tsr_new_data, algstrct const *sr, CommData ord_glb_comm)
def np(self)
Definition: core.pyx:315