HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Compute the 1D rank. More...
#include <mpivars.h>
Go to the source code of this file.
Functions | |
int | MPIRank1D (int ndims, int *iproc, int *ip) |
Compute the 1D rank.
Definition in file MPIRank1D.c.
int MPIRank1D | ( | int | ndims, |
int * | iproc, | ||
int * | ip | ||
) |
This function returns the 1D rank, given the n-dimensional 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:
ndims | Number of spatial dimensions |
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 dimension |
Definition at line 26 of file MPIRank1D.c.