|
HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Compute the n-dimensional rank. More...
#include <mpivars.h>Go to the source code of this file.
Functions | |
| int | MPIRanknD (int ndims, int rank, int *iproc, int *ip) |
Compute the n-dimensional rank.
Definition in file MPIRanknD.c.
| int MPIRanknD | ( | int | ndims, |
| int | rank, | ||
| int * | iproc, | ||
| int * | ip | ||
| ) |
This function computes the n-dimensional rank, given the 1D rank and the total number of MPI ranks along each spatial dimension.
1D Rank: This is the rank of the process in the communicator.
n-Dimensional Rank: This represents an integer array, where each element is the rank of the process along a spatial dimension.
Consider a 2D simulation running with 21 MPI ranks - 7 along the x direction, and 3 along the y direction, as shown in the following figure:
Note:
| ndims | Number of spatial dimensions |
| rank | 1D rank |
| iproc | Integer array whose elements are the number of MPI ranks along each dimension |
| ip | Integer array whose elements are the rank of this process along each dimesion |
Definition at line 27 of file MPIRanknD.c.