80 #ifndef ARRAY_UDF_UTILITY_MACRO_H
81 #define ARRAY_UDF_UTILITY_MACRO_H
92 #define COUNT_CELLS(start_address_p, end_address_p, cells_count_p) \
94 assert(start_address_p.size() == end_address_p.size()); \
96 for (int i = 0; i < start_address_p.size(); i++) \
98 cells_count_p = cells_count_p * (end_address_p[i] - start_address_p[i] + 1); \
106 #define COUNT_RANGES(start_address_p, end_address_p, count_p) \
108 assert(start_address_p.size() == end_address_p.size()); \
109 if (count_p.size() != start_address_p.size()) \
111 count_p.resize(start_address_p.size()); \
113 for (int i = 0; i < start_address_p.size(); i++) \
115 count_p[i] = end_address_p[i] - start_address_p[i] + 1; \
123 #ifndef ROW_MAJOR_ORDER_MACRO
124 #define ROW_MAJOR_ORDER_MACRO(dsize, dsize_len, coordinate, offset) \
126 offset = coordinate[0]; \
127 for (int iii = 1; iii < dsize_len; iii++) \
129 offset = offset * dsize[iii] + coordinate[iii]; \
134 #ifndef ROW_MAJOR_ORDER_REVERSE_MACRO
135 #define ROW_MAJOR_ORDER_REVERSE_MACRO(offset, dsize, dsize_len, result_coord_v) \
137 unsigned long long temp_offset = offset; \
138 for (int iii = dsize_len - 1; iii >= 1; iii--) \
140 result_coord_v[iii] = temp_offset % dsize[iii]; \
141 temp_offset = temp_offset / dsize[iii]; \
143 result_coord_v[0] = temp_offset; \
147 #define AU_EXIT(info) \
149 std::cout << "Exit happens at file: " << __FILE__ << ", function: " << __func__ << ", line: " << __LINE__ << std::endl; \
150 std::cout << "Log : " << info << std::endl; \
151 std::exit(EXIT_FAILURE); \
154 #define AU_INFO(info) \
156 std::cout << "Info at " << __FILE__ << ", " << __func__ << ", " << __LINE__ << std::endl; \
157 std::cout << "Info : " << info << std::endl; \
159 #define AU_VERBOSE(info_p, rank_p) \
161 if (ft_rank == rank_p) \
162 std::cout << info_p << std::endl \
int ft_rank
Definition: ft.cpp:86
int ft_mpi_size_global
Definition: ft.cpp:82
int ft_size
Definition: ft.cpp:85
int ft_mpi_rank_global
Definition: ft.cpp:83