Init_Task_Grid_order

Initialize the continuous block data array, Task_Grid[], according to each element's location in the global grid. e.g. Task_Grid[3][2][1], in C convention, will be assigned a number iseed*10^(Ndim+1) + 321 formated according to its type. The routine checks the inter-process communication of the ghost point region of the task grids

Synopsis


void Init_Task_Grid_order(
                           int           Ndim,
                           int           Glb_Grid_sz[],
                           int           task_Grid_endpts[],
                           int           stride_width[],
                           int           iseed,
                           MPI_Datatype  MD_type,

                           void         *Task_Grid
                         )

Unmodified Input Variables

Ndim - Dimensionality of the Grid (Integer)
Glb_Grid_sz - Integer Array, of size Ndim, specifies the maximum grid size of the global grid. Glb_Grid_sz[ ii ] is the maximum grid size in the dimension ii, where the minimum is assumed to be 1.
task_Grid_endpts - Integer Array, of size 2 x Ndim, of the two end-points' coordinates of the LOCAL task grid. It is implicitly assumed to be declared as task_Grid_endpts[ 2 ][ Ndim ].
stride_width - Integer Array, of size Ndim, of the stride width of the task grid. It is implicitly assumed to be declared as stride_width[ Ndim ].
iseed - Integer specifies the starting digit in each grid element.
MD_type - the MPI_Datatype of the data stored in the task grids, Task_Grid.

Modified Output Variables

Task_Grid - Void pointer to the Block data array stored in the task grids.

Notes on Fortran Interface

The RGX routines which have this message have a Fortran interface. If the C function that is defined here has a returned integer status, the Fortran interface will have an additional argument, ierr, at the end of its argument list.

Notes on Minimal Set of Variables

In order to use RGX for a regualr grid calculation. There is a minimal set of variables needed to be used with the RGX_XXX routines. The set of variables is listed as follows,


   const int     MD_type = MPI_DOUBLE_PRECISION;
   double       *Task_xGrid;         // Data of Local Task Grid              
   int           Ndim;               // Dimensionality of the 
   //                                // grid           
   MPI_Comm      RGX_Comm;           // Communicator of all 
   //                                // sub-grids        
   int           N_task;             // No. of process/tasks 
   //                                // in Communicator 
   int          *Glb_Grid_sz;        // Global grid sizes :
   //                                // Glb_Grid_sz(Ndim) 
   int          *task_Ngbrs;         // the tid of the nearest
   //                                // neighbor task :
   //                                // task_Ngbrs(2, Ndim)                
   int          *task_Grid_endpts;   // local sub-grid's end
   //                                // points :
   //                                // task_Grid_endpts(Ndim, 2)          
   int          *N_task_1dims;       // No of task 
   //                                // per dimension :             
   //                                // N_task_1dims(Ndim)                 
   int          *stride_width;       // width of the stride of
   //                                // ghost point :
   //                                // stride_width(Ndim)                 
   MPI_Datatype *task_bndry_strides; // local task/grid's 
   //                                // boundary strides :
   //                                // task_bndry_strides(Ndim)           

Memory for each of these pointer variables can be allocated dynammically/statically, but it has to be continuous.

Supported Data Type of the Block Array

There are currently 5 datatypes supported in RGX. The types are identified by MPI_Datatype. They are MPI_INTEGER, MPI_REAL, MPI_DOUBLE_PRECISION, MPI_COMPLEX and MPI_DOUBLE_COMPLEX.

Definition Location

This subroutine is defined in the librgx.a.

Location:../src/librgx/Init_Task_Grid_order.c