Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
distribution.h
Go to the documentation of this file.
1 /*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/
2 
3 #ifndef __INT_DISTRIBUTION_H__
4 #define __INT_DISTRIBUTION_H__
5 
6 #include "mapping.h"
7 
8 namespace CTF_int {
9 
10  class tensor;
11 
12  inline
13  int get_distribution_size(int order){
14  return sizeof(int)*2 + sizeof(int64_t) + order*sizeof(int)*7;
15  }
16 
17  // \brief data distribution object used for redistribution
18  class distribution {
19  public:
20  int order;
21  int * phase;
22  int * virt_phase;
23  int * phys_phase;
24  int * pe_lda;
25  int * pad_edge_len;
26  int * padding;
27  int * perank;
28  int is_cyclic;
29  int64_t size;
30 
31  distribution();
32  ~distribution();
33 
38  distribution(tensor const * tsr);
39 
44  distribution(char const * buffer);
45 
51  void serialize(char ** buffer, int * size);
52  private:
53  void free_data();
54  };
55 
66  void calc_dim(int order,
67  int64_t size,
68  int const * edge_len,
69  mapping const * edge_map,
70  int64_t * vrt_sz,
71  int * vrt_edge_len,
72  int * blk_edge_len);
73 }
74 
75 #endif
void calc_dim(int order, int64_t size, int const *edge_len, mapping const *edge_map, int64_t *vrt_sz, int *vrt_edge_len, int *blk_edge_len)
calculate the block-sizes of a tensor
void serialize(char **buffer, int *size)
serialize object into contiguous data buffer
int get_distribution_size(int order)
Definition: distribution.h:13
internal distributed tensor class