19 #include "../shared/model.h" 74 #define IASSERT(...) \ 75 do { if (!(__VA_ARGS__)){ int rank; MPI_Comm_rank(MPI_COMM_WORLD,&rank); if (rank == 0){ printf("CTF ERROR: %s:%d, ASSERT(%s) failed\n",__FILE__,__LINE__,#__VA_ARGS__); } CTF_int::handler(); assert(__VA_ARGS__); } } while (0) 94 int64_t
packed_size(
int order,
const int* len,
const int* sym);
99 template <
typename type=
char>
104 template <
typename type=
char>
112 template <
typename type=
char>
155 CommData(
int rank,
int color,
int np);
169 void activate(MPI_Comm parent);
175 double estimate_bcast_time(int64_t msg_sz);
178 double estimate_allred_time(int64_t msg_sz, MPI_Op op);
181 double estimate_red_time(int64_t msg_sz, MPI_Op op);
187 double estimate_alltoall_time(int64_t chunk_sz);
190 double estimate_alltoallv_time(int64_t tot_sz);
195 void bcast(
void * buf, int64_t count, MPI_Datatype mdtype,
int root);
200 void allred(
void * inbuf,
void * outbuf, int64_t count, MPI_Datatype mdtype, MPI_Op op);
205 void red(
void * inbuf,
void * outbuf, int64_t count, MPI_Datatype mdtype, MPI_Op op,
int root);
218 void all_to_allv(
void * send_buffer,
219 int64_t
const * send_counts,
220 int64_t
const * send_displs,
223 int64_t
const * recv_counts,
224 int64_t
const * recv_displs);
228 int alloc_ptr(int64_t len,
void **
const ptr);
230 void *
alloc(int64_t len);
258 bool get_mpi_dt(int64_t count, int64_t datum_size, MPI_Datatype & dt);
OP
reduction types for tensor data deprecated types: OP_NORM1=OP_SUMABS, OP_NORM2=call norm2()...
bool get_mpi_dt(int64_t count, int64_t datum_size, MPI_Datatype &dt)
gives a datatype for arbitrary datum_size, errors if exceeding 32-bits
void * mst_alloc(int64_t len)
mst_alloc allocates buffer on the specialized memory stack
double get_rand48()
returns new random number in [0,1)
void * alloc(int64_t len)
alloc abstraction
void init_rng(int rank)
initialized random number generator
void flops_add(int64_t n)
int mst_alloc_ptr(int64_t len, void **const ptr)
mst_alloc abstraction
int alloc_ptr(int64_t len, void **const ptr)
alloc abstraction
int cdealloc(void *ptr)
free abstraction
int64_t packed_size(int order, const int *len, const int *sym)
computes the size of a tensor in packed symmetric (SY, SH, or AS) layout
int64_t sy_packed_size(int order, const int *len, const int *sym)
computes the size of a tensor in SY (NOT HOLLOW) packed symmetric layout
int conv_idx(int order, type const *cidx, int **iidx)
void cvrt_idx(int order, int const *lens, int64_t idx, int *idx_arr)