PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions
al_sz_get.c File Reference

Miscellaneous functions to obtain informations about the properties of the distributed array. More...

#include "al_hidden.h"

Functions

int AL_Get_size (int isz, int *size)
 
int AL_Get_rank (int isz, int *rank)
 
int AL_Get_comm (int isz, MPI_Comm *comm)
 
int AL_Get_cart_comm (int isz, MPI_Comm *cart_comm)
 
int AL_Get_dimensions (int isz, int *ndim)
 
int AL_Get_type (int isz, MPI_Datatype *type)
 
int AL_Get_type_size (int isz, int *tsize)
 
int AL_Get_buffsize (int sz_ptr, int *buffsize)
 
int AL_Get_global_dim (int isz, int *gdims)
 
int AL_Get_local_dim (int isz, int *ldims)
 
int AL_Get_local_dim_gp (int sz_ptr, int *ldims_gp)
 
int AL_Get_offsets (int sz_ptr, int *offset)
 
int AL_Get_stride (int sz_ptr, int *stride)
 
int AL_Get_cart_sizes (int isz, int *cart_sizes)
 
int AL_Get_parallel_dim (int isz, int *pardims)
 
int AL_Get_periodic_dim (int isz, int *periods)
 
int AL_Get_staggered_dim (int isz, int *stagger)
 
int AL_Get_ghosts (int isz, int *ghosts)
 
int AL_Get_lbounds (int isz, int *lbeg, int *lend, int *gp, int style)
 
int AL_Get_bounds (int isz, int *beg, int *end, int *gp, int style)
 
int AL_Get_gbounds (int isz, int *gbeg, int *gend, int *gp, int style)
 

Detailed Description

Author
A. Malagoli (University of Chicago)
Date
Jul 17, 1999

Function Documentation

int AL_Get_bounds ( int  isz,
int *  beg,
int *  end,
int *  gp,
int  style 
)

Get the global indexes for the local portion of a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]begArray of ndim integers containing the start points
[out]endArray of ndim integers containing the end points
[out]gpArray of ndim integers containing the ghost points
[in]styleIndex style: AL_C_INDEXES or AL_FORTRAN_INDEXES
int AL_Get_buffsize ( int  sz_ptr,
int *  buffsize 
)

Get the local buffer size for a distributed array, including the number of elements of the ghsot regions.

Parameters
[in]sz_ptrInteger pointer to the input array descriptor
[out]buffsizeBuffer size [in number of elements]
int AL_Get_cart_comm ( int  isz,
MPI_Comm *  cart_comm 
)

Get the cartesian communicator for a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]cart_commPointer to cartesian communicator
int AL_Get_cart_sizes ( int  isz,
int *  cart_sizes 
)

Get the sizes of the cartesian communicator

Parameters
[in]iszInteger pointer to the input array descriptor
[out]cart_sizesArray of integers with cartesian sizes
int AL_Get_comm ( int  isz,
MPI_Comm *  comm 
)

Get the communicator for a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]commPointer to communicator
int AL_Get_dimensions ( int  isz,
int *  ndim 
)

Get the dimensions of the distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]ndimPointer to integer number of dimensions
int AL_Get_gbounds ( int  isz,
int *  gbeg,
int *  gend,
int *  gp,
int  style 
)

Get the global bounds of the global array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]gbegArray of ndim integers containing the start points
[out]gendArray of ndim integers containing the end points
[out]gpArray of ndim integers containing the ghost points
[in]styleIndex style: AL_C_INDEXES or AL_FORTRAN_INDEXES
int AL_Get_ghosts ( int  isz,
int *  ghosts 
)

Get the ghost points of the distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]ghostArray of integers with size of ghost points in each dimension
int AL_Get_global_dim ( int  isz,
int *  gdims 
)

Get the global dimensions of the distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]gdimsArray of integers with global dimensions
int AL_Get_lbounds ( int  isz,
int *  lbeg,
int *  lend,
int *  gp,
int  style 
)

Get the local indexes for the local portion of a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]lbegArray of ndim integers containing the start points
[out]lendArray of ndim integers containing the end points
[out]gpArray of ndim integers containing the ghost points
[in]styleIndex style: AL_C_INDEXES or AL_FORTRAN_INDEXES
int AL_Get_local_dim ( int  isz,
int *  ldims 
)

Get the local dimensions of a distributed array WITHOUT GHOST POINTS

Parameters
[in]iszInteger pointer to the input array descriptor
[out]ldimsArray of integers with local dimensions
int AL_Get_local_dim_gp ( int  sz_ptr,
int *  ldims_gp 
)

Get the local dimensions of a distributed array WITH GHOST POINTS

Parameters
[in]sz_ptrInteger pointer to the input array descriptor
[out]ldims_gpArray of integers with local dimensions (including ghost points)
int AL_Get_offsets ( int  sz_ptr,
int *  offset 
)

Get the offsets for the for loop index calculation

NOTE: The typical multidimensional C for loop will look like, for example:

... ;

AL_Get_offsets(sz_ptr, offset);

for(k=kbeg; k<=kend; k++){ koff = k*offset[2]; for(j=jbeg; j<=jend; j++){ joff = j*offset[1]; for(i=ibeg; i<=iend; i++){ ioff = i*offset[0]+joff+koff; a[ioff] = ... ; } } } ... ;

Where a[ioff] is a generic 3D array.

Parameters
[in]sz_ptrInteger pointer to the input array descriptor
[out]offsetArray of integers with offsets
int AL_Get_parallel_dim ( int  isz,
int *  pardims 
)

Get the parallel dimensions of a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]pardimsArray of integers with parallel dimensions [AL_TRUE|AL_FALSE]
int AL_Get_periodic_dim ( int  isz,
int *  periods 
)

Get the periodic dimensions of the distributed arrays

Parameters
[in]iszInteger pointer to the input array descriptor
[out]periodsArray of integers with periodic dimensions [AL_TRUE|AL_FALSE]
int AL_Get_rank ( int  isz,
int *  rank 
)

Get the rank of this node in the communicator associated with a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]rankInteger pointer to rank
Returns
If the current node does not belong to the communicator, AL_UNDEFINED (same as MPI_UNDEFINED) is returned. Otherwise AL_SUCCESS is returned.
int AL_Get_size ( int  isz,
int *  size 
)

Get the size of the communicator associated with a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor (input)
[in]sizeInteger pointer to size (output)
int AL_Get_staggered_dim ( int  isz,
int *  stagger 
)

Get the staggered dimensions of the distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]staggerArray of integers with staggered dimensions [AL_TRUE|AL_FALSE]
int AL_Get_stride ( int  sz_ptr,
int *  stride 
)

Get the strides for the for loop index calculation NOTE: The typical multidimensional C for loop will look like, for example:

... ;

AL_Get_stride(sz_ptr, stride);

for(k=kbeg; k<=kend; k++){ koff = k*stride[2]; for(j=jbeg; j<=jend; j++){ joff = j*stride[1]; for(i=ibeg; i<=iend; i++){ ioff = i*stride[0]+joff+koff; a[ioff] = ... ; } } } ... ;

Where a[ioff] is a generic 3D array.

Parameters
[in]sz_ptrInteger pointer to the input array descriptor
[out]strideArray of strides
int AL_Get_type ( int  isz,
MPI_Datatype *  type 
)

Get the basic data type of a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]typePointer to datatype
int AL_Get_type_size ( int  isz,
int *  tsize 
)

Get size of the basic data type of a distributed array

Parameters
[in]iszInteger pointer to the input array descriptor
[out]tsizeInteger pointer to size of datatype.