17 static int find_coord_map(
const char map_expr[],
int ndim,
int *map);
28 for (
int i =
m_ndim - 1; i >= 0; --i) {
45 for (
int i = 0; i < m_ndim; ++i) {
46 int k = m_physical_to_logical[i];
48 gcoord[k] = r % m_grid_dims[k];
63 printf(
"DEBUG: %s: m_map_grid = \"%s\"\n", __func__, m_map_grid);
67 m_physical_to_logical =
new int [m_ndim];
78 delete [] m_physical_to_logical;
88 int len = strlen(map_expr);
91 fprintf(stderr,
"ERROR: find_map: length mismatch: %d, expected %d.\n", len, ndim);
95 for (
int i = 0; i < len; ++i) {
122 fprintf(stderr,
"ERROR: find_map: unknown symbol %c.\n", c);
static char default_grid_map[16]
static int grid_coord(int *gcoord, const int rank)
find grid coordinate corresponding to rank.
static int grid_rank(int *rank, const int *gcoord)
find rank from grid coordinate.
static int * m_grid_dims
grid dimensions in directions.
static int find_coord_map(const char map_expr[], int ndim, int *map)
static int * m_physical_to_logical
map between physical and logical grid
static int m_ndim
number of dimensions.
static int physical_map_delete()
static int physical_map_setup()