FasTensor  1.0.0
Transform Supercomputing for AI
Macros | Variables
ft_utility_macro.h File Reference

Go to the source code of this file.

Macros

#define COUNT_CELLS(start_address_p, end_address_p, cells_count_p)
 help function to counts cells between start/end More...
 
#define COUNT_RANGES(start_address_p, end_address_p, count_p)
 help function to counts cells between start/end More...
 
#define ROW_MAJOR_ORDER_MACRO(dsize, dsize_len, coordinate, offset)
 macro version of above two functions for speed More...
 
#define ROW_MAJOR_ORDER_REVERSE_MACRO(offset, dsize, dsize_len, result_coord_v)
 
#define AU_EXIT(info)
 
#define AU_INFO(info)
 
#define AU_VERBOSE(info_p, rank_p)
 

Variables

int ft_mpi_size_global
 
int ft_mpi_rank_global
 
int ft_size
 
int ft_rank
 

Macro Definition Documentation

◆ AU_EXIT

#define AU_EXIT (   info)
Value:
{ \
std::cout << "Exit happens at file: " << __FILE__ << ", function: " << __func__ << ", line: " << __LINE__ << std::endl; \
std::cout << "Log : " << info << std::endl; \
std::exit(EXIT_FAILURE); \
}

◆ AU_INFO

#define AU_INFO (   info)
Value:
{ \
std::cout << "Info at " << __FILE__ << ", " << __func__ << ", " << __LINE__ << std::endl; \
std::cout << "Info : " << info << std::endl; \
}

◆ AU_VERBOSE

#define AU_VERBOSE (   info_p,
  rank_p 
)
Value:
{ \
if (ft_rank == rank_p) \
std::cout << info_p << std::endl \
<< std::flush; \
}
int ft_rank
Definition: ft.cpp:86

◆ COUNT_CELLS

#define COUNT_CELLS (   start_address_p,
  end_address_p,
  cells_count_p 
)
Value:
{ \
assert(start_address_p.size() == end_address_p.size()); \
cells_count_p = 1; \
for (int i = 0; i < start_address_p.size(); i++) \
{ \
cells_count_p = cells_count_p * (end_address_p[i] - start_address_p[i] + 1); \
} \
}

help function to counts cells between start/end

◆ COUNT_RANGES

#define COUNT_RANGES (   start_address_p,
  end_address_p,
  count_p 
)
Value:
{ \
assert(start_address_p.size() == end_address_p.size()); \
if (count_p.size() != start_address_p.size()) \
{ \
count_p.resize(start_address_p.size()); \
} \
for (int i = 0; i < start_address_p.size(); i++) \
{ \
count_p[i] = end_address_p[i] - start_address_p[i] + 1; \
} \
}

help function to counts cells between start/end

◆ ROW_MAJOR_ORDER_MACRO

#define ROW_MAJOR_ORDER_MACRO (   dsize,
  dsize_len,
  coordinate,
  offset 
)
Value:
{ \
offset = coordinate[0]; \
for (int iii = 1; iii < dsize_len; iii++) \
{ \
offset = offset * dsize[iii] + coordinate[iii]; \
} \
}

macro version of above two functions for speed

◆ ROW_MAJOR_ORDER_REVERSE_MACRO

#define ROW_MAJOR_ORDER_REVERSE_MACRO (   offset,
  dsize,
  dsize_len,
  result_coord_v 
)
Value:
{ \
unsigned long long temp_offset = offset; \
for (int iii = dsize_len - 1; iii >= 1; iii--) \
{ \
result_coord_v[iii] = temp_offset % dsize[iii]; \
temp_offset = temp_offset / dsize[iii]; \
} \
result_coord_v[0] = temp_offset; \
}

Variable Documentation

◆ ft_mpi_rank_global

int ft_mpi_rank_global
extern

◆ ft_mpi_size_global

int ft_mpi_size_global
extern

Author: Bin Dong dbin@.nosp@m.lbl..nosp@m.gov Web: https://crd.lbl.gov/bin-dong Scientific Data Management Research Group Lawrence Berkeley National Laboratory

◆ ft_rank

int ft_rank
extern

◆ ft_size

int ft_size
extern

Author: Bin Dong dbin@.nosp@m.lbl..nosp@m.gov Web: https://crd.lbl.gov/bin-dong Scientific Data Management Research Group Lawrence Berkeley National Laboratory