ArrayLib functions to decompose the domain among the MPI processes. More...
#include "al_hidden.h"
Functions | |
int | AL_Find_decomp_ (int sz_ptr, int mode, int *procs) |
int | AL_Global_to_local_ (int sz_ptr) |
int | AL_Decomp1d_ (int gdim, int lproc, int lloc, int *start, int *end) |
int | AL_Decompose (int sz_ptr, int *procs, int mode) |
ArrayLib functions to decompose the domain among the MPI processes.
int AL_Decomp1d_ | ( | int | gdim, |
int | lproc, | ||
int | lloc, | ||
int * | start, | ||
int * | end | ||
) |
Decompose a 1D array, given the number of processors along the direction
[in] | gdim | integer size of the global dimension |
[in] | lproc | integer size of the number of processors along the dimension |
[in] | lloc | integer location of this node along the dimension |
[out] | start | integer pointer to start address for the array (C-convention) |
[out] | end | integer pointer to end address for the array (C-convention) |
int AL_Decompose | ( | int | sz_ptr, |
int * | procs, | ||
int | mode | ||
) |
Create a distributed array descriptor and compile it
[in] | sz_ptr | integer pointer to the distributed array descriptor |
[in,out] | procs | array with the processor decomposition |
[in] | mode | available value: AL_AUTO_DECOMP (internal decomposition) [Only for powers of two dimensions]; AL_MPI_DECOMP (MPI decomposition); AL_USER_DECOMP (user defined) |
Bug fixed on Aug 26, 2012: When the global view of the file for a staggered variable is computed, the gdims[nd] has to be computed and then passed to the function AL_Type_create_subarray.
Since gdims[nd]=s->arrdim[nd], and in s->arrdim[nd] is taking into account that the variable is staggered, we comment the line "gdims[istag]++;" because it is no more needed.
Bug fixed on Aug 26, 2012: The following "if" has been modified:
OLD version: if (s->beg[istag] == s->bg[istag]) { ldims[istag]++; }else{ starts[istag]++; }
NEW version: if (s->beg[istag] == s->bg[istag]) { }else{ starts[istag]++; ldims[istag]–; }
Bugs fixed on Aug 26, 2012: The following if has been modified:
OLD version: if (s->beg[istag] == s->bg[istag]) { ldims[istag]++; starts[istag]–; }
NEW version: if (s->beg[istag] == s->bg[istag]) { }else{ ldims[istag]–; starts[istag]++; }
int AL_Find_decomp_ | ( | int | sz_ptr, |
int | mode, | ||
int * | procs | ||
) |
Find the decomposition for a distributed array given its global size and the number of nodes
[in] | sz_ptr | integer pointer to the SZ structure |
[in] | mode | mode parameter: AL_AUTO_DECOMP, AL_MPI_DECOMP, AL_USER_DECOMP |
[in,out] | procs | array of processor decomposition |
int AL_Global_to_local_ | ( | int | sz_ptr | ) |
Compute addresses of local portions of array from global dimensions and processor decomposition
[in] | sz_ptr | integer pointer to SZ structure |
Bug fixed on Dec 7, 2011: The lines:
if( s->isstaggered[i] == AL_TRUE ){ s->lend[i] = (end-start+1+s->lbeg[i]);}
if( s->isstaggered[i] == AL_TRUE ){ s->larrdim_gp[i] = (end-start+1+s->bg[i]+s->eg[i]+1);}
if( s->isstaggered[i] == AL_TRUE ){ s->larrdim[i] = (end-start+1+1);}
have been added to manage in the right way the correspondence among global and local indeces for staggered variables.