|
HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Partition an essentially 1D array. More...
#include <stdio.h>#include <stdlib.h>#include <basic.h>#include <arrayfunctions.h>#include <mpivars.h>Go to the source code of this file.
Functions | |
| int | MPIPartitionArray1D (void *m, double *xg, double *x, int istart, int iend, int N_local, int ghosts) |
Partition an essentially 1D array.
Definition in file MPIPartitionArray1D.c.
| int MPIPartitionArray1D | ( | void * | m, |
| double * | xg, | ||
| double * | x, | ||
| int | istart, | ||
| int | iend, | ||
| int | N_local, | ||
| int | ghosts | ||
| ) |
Partitions the contents of a global 1D array on the root rank (rank 0) to local arrays on all the MPI ranks. See documentation of MPIExchangeBoundaries1D() on what a "1D array" is in the context of a multidimensional simulation. The 1D array must be the same along spatial dimensions normal to the one it represents.
Notes:
| m | MPI object of type MPIVariables |
| xg | Global 1D array (must be preallocated) without ghost points |
| x | Local 1D array to be gathered |
| istart | Starting index (global) of this rank's portion of the array |
| iend | Ending index (global) of this rank's portion of the array + 1 |
| N_local | Local size of the array |
| ghosts | Number of ghost points |
Definition at line 25 of file MPIPartitionArray1D.c.