#include <GAServices.h>
Public Methods | |
| GAServices () | |
| Null-constructor. More... | |
| ~GAServices () | |
| Destructor. More... | |
| GlobalArray * | createGA (int type, int ndim, int dims[], char *arrayname, int chunk[]) |
| Creates an ndim-dimensional array using the regular distribution model and returns integer handle representing the array. More... | |
| GlobalArray * | createGA (int type, int ndim, int dims[], char *arrayname, int block[], int maps[]) |
| Creates an array by following the user-specified distribution and returns integer handle representing the array. More... | |
| GlobalArray * | createGA (const GlobalArray *g_b, char *arrayname) |
| Creates a new array by applying all the properties of another existing array. More... | |
| GlobalArray * | createGA (const GlobalArray &g_b) |
| Creates a new array by applying all the properties of another existing array. More... | |
| GlobalArray * | createGA () |
| Creates a 10x10 global array of type "double"(default). More... | |
| GlobalArray * | createGA_Ghosts (int type, int ndim, int dims[], int width[], char *array_name, int chunk[]) |
| Creates an ndim-dimensional array with a layer of ghost cells around the visible data on each processor using the regular distribution model and returns an integer handle representing the array. More... | |
| GlobalArray * | createGA_Ghosts (int type, int ndim, int dims[], int width[], char *array_name, int map[], int nblock[]) |
| Creates an array with ghost cells by following the user-specified distribution and returns integer handle representing the array. More... | |
| void | brdcst (void *buf, int lenbuf, int root) |
| int | clusterNnodes () |
| This functions returns the total number of nodes that the program is running on. More... | |
| int | clusterNodeid () |
| This function returns the node ID of the process. More... | |
| int | clusterNprocs (int inode) |
| This function returns the number of processors available on node inode. More... | |
| int | clusterProcid (int inode, int iproc) |
| This function returns the processor id associated with node inode and the local processor id iproc. More... | |
| int | createMutexes (int number) |
| Creates a set containing the number of mutexes. More... | |
| int | destroyMutexes () |
| Destroys the set of mutexes created with ga_create_mutexes. More... | |
| void | dgop (double x[], int n, char *op) |
| int | duplicate (int g_a, char *array_name) |
| void | error (const char *message, int code) |
| To be called in case of an error. More... | |
| void | fence () |
| Blocks the calling process until all the data transfers corresponding to GA operations called after ga_init_fence complete. More... | |
| void | igop (Integer x[], int n, char *op) |
| void | initFence () |
| Initializes tracing of completion status of data movement operations. More... | |
| size_t | inquireMemory () |
| Returns amount of memory (in bytes) used in the allocated global arrays on the calling processor. More... | |
| void | lock (int mutex) |
| void | maskSync (int first, int last) |
| GA Collective calls has Sync calls at the begining and ending of of the call. More... | |
| int | memoryAvailable () |
| int | memoryLimited () |
| Indicates if limit is set on memory usage in Global Arrays on the calling processor. More... | |
| int | nodeid () |
| Returns the GA process id (0, ..., ga_Nnodes()-1) of the requesting compute process. More... | |
| int | nodes () |
| Returns the number of the GA compute (user) processes. More... | |
| void | printStats () |
| This non-collective (MIMD) operation prints information about:. More... | |
| void | setMemoryLimit (size_t limit) |
| void | summarize (int verbose) |
| void | sync () |
| Synchronize processes (a barrier) and ensure that all GA operations completed. More... | |
| void | unlock (int mutex) |
| int | usesMA () |
| Returns "1" if memory in global arrays comes from the Memory Allocator (MA). More... | |
| int | usesFAPI () |
| Returns "1" if uses fortran API, else returns "0". More... | |
Author: Manoj Kumar Krishnan, PNNL.
Collecting the global information: who am I, and how many processors are being used. Initialize the communication library (either MPI or TCSMSG) and Global array. Allocate momory to be used by GA by calling MA and create global arrays.
Definition at line 12 of file GAServices.h.
|
|
Null-constructor. The component won't really be 'alive' much at all until after setServices is called on it. |
|
|
Destructor.
|
|
||||||||||||||||||||||||
|
Creates an ndim-dimensional array using the regular distribution model and returns integer handle representing the array. The array can be distributed evenly or not. The control over the distribution is accomplished by specifying chunk (block) size for all or some of array dimensions. For example, for a 2-dimensional array, setting chunk[0]=dim[0] gives distribution by vertical strips (chunk[0]*dims[0]); setting chunk[1]=dim[1] gives distribution by horizontal strips (chunk[1]*dims[1]). Actual chunks will be modified so that they are at least the size of the minimum and each process has either zero or one chunk. Specifying chunk[i] as <1 will cause that dimension to be distributed evenly. As a convenience, when chunk is specified as NULL, the entire array is distributed evenly.
|
|
||||||||||||||||||||||||||||
|
Creates an array by following the user-specified distribution and returns integer handle representing the array. The distribution is specified as a Cartesian product of distributions for each dimension. The array indices start at 0. For example, the following figure demonstrates distribution of a 2-dimensional array 8x10 on 6 (or more) processors. nblock[2]={3,2}, the size of map array is s=5 and array map contains the following elements map={0,2,6,0,5}. The distribution is nonuniform because, P1 and P4 get 20 elements each and processors P0,P2,P3, and P5 only 10 elements each.
|
|
||||||||||||
|
Creates a new array by applying all the properties of another existing array.
|
|
|
Creates a new array by applying all the properties of another existing array.
|
|
|
Creates a 10x10 global array of type "double"(default).
|
|
||||||||||||||||||||||||||||
|
Creates an ndim-dimensional array with a layer of ghost cells around the visible data on each processor using the regular distribution model and returns an integer handle representing the array. The array can be distributed evenly or not evenly. The control over the distribution is accomplished by specifying chunk (block) size for all or some of the array dimensions. For example, for a 2-dimensional array, setting chunk(1)=dim(1) gives distribution by vertical strips (chunk(1)*dims(1)); setting chunk(2)=dim(2) gives distribution by horizontal strips (chunk(2)*dims(2)). Actual chunks will be modified so that they are at least the size of the minimum and each process has either zero or one chunk. Specifying chunk(i) as <1 will cause that dimension (i-th) to be distributed evenly. The width of the ghost cell layer in each dimension is specified using the array width(). The local data of the global array residing on each processor will have a layer width[n] ghosts cells wide on either side of the visible data along the dimension n.
|
|
||||||||||||||||||||||||||||||||
|
Creates an array with ghost cells by following the user-specified distribution and returns integer handle representing the array. The distribution is specified as a Cartesian product of distributions for each dimension. For example, the following figure demonstrates distribution of a 2-dimensional array 8x10 on 6 (or more) processors. nblock(2)={3,2}, the size of map array is s=5 and array map contains the following elements map={1,3,7, 1, 6}. The distribution is nonuniform because, P1 and P4 get 20 elements each and processors P0,P2,P3, and P5 only 10 elements each.
The array width[] is used to control the width of the ghost cell boundary around the visible data on each processor. The local data of the global array residing on each processor will have a layer width[n] ghosts cells wide on either side of the visible data along the dimension n.
|
|
||||||||||||||||
|
This is a collective operation. |
|
|
This functions returns the total number of nodes that the program is running on.
On SMP architectures, this will be less than or equal to the total number of processors. |
|
|
This function returns the node ID of the process.
On SMP architectures with more than one processor per node, several processes may return the same node id. |
|
|
This function returns the number of processors available on node inode.
|
|
||||||||||||
|
This function returns the processor id associated with node inode and the local processor id iproc. If node inode has N processors, then the value of iproc lies between 0 and N-1.
|
|
|
Creates a set containing the number of mutexes.
Returns 0 if the opereation succeeded or 1 when failed. Mutex is a simple synchronization object used to protect Critical Sections. Only one set of mutexes can exist at a time. Array of mutexes can be created and destroyed as many times as needed. Mutexes are numbered: 0, ..., number -1.
|
|
|
Destroys the set of mutexes created with ga_create_mutexes.
Returns 0 if the operation succeeded or 1 when failed. |
|
||||||||||||||||
|
X(1:N) is a vector present on each process. DGOP 'sums' elements of X accross all nodes using the commutative operator OP. The result is broadcast to all nodes. Supported operations include '+', '*', 'max', 'min', 'absmax', 'absmin'. The use of lowerecase for operators is necessary. This is operation is provided only for convenience purposes: it is available regardless of the message-passing library that GA is running with. |
|
||||||||||||
|
This is a collective operation. |
|
||||||||||||
|
To be called in case of an error. Print an error message and an integer value that represents error code. Releases some system resources. This is the required way of aborting the program execution. This operation is local.
|
|
|
Blocks the calling process until all the data transfers corresponding to GA operations called after ga_init_fence complete. For example, since ga_put might return before the data reaches the final destination, ga_init_fence and ga_fence allow process to wait until the data tranfer is fully completed: ga_init_fence(); ga_put(g_a, ...); ga_fence(); ga_fence must be called after ga_init_fence. A barrier, ga_sync, assures completion of all data transfers and implicitly cancels all outstanding ga_init_fence calls. ga_init_fence and ga_fence must be used in pairs, multiple calls to ga_fence require the same number of corresponding ga_init_fence calls. ga_init_fence/ga_fence pairs can be nested. ga_fence works for multiple GA operations. For example: ga_init_fence(); ga_put(g_a, ...); ga_scatter(g_a, ...); ga_put(g_b, ...); ga_fence(); The calling process will be blocked until data movements initiated by two calls to ga_put and one ga_scatter complete. |
|
||||||||||||||||
|
This is a collective operation. |
|
|
Initializes tracing of completion status of data movement operations. This operation is local. |
|
|
Returns amount of memory (in bytes) used in the allocated global arrays on the calling processor. This operation is local. |
|
|
|
|
||||||||||||
|
GA Collective calls has Sync calls at the begining and ending of of the call. Sometimes there may be some redundacy in sync calls, which can be avoided by masking the sync operations. @ param first - masks the sync at the begining of the collective call. @ param last - masks the sync at the end of the collective call. setting the parameters as zero will mask (disable) the call. Any non-zero value will enable the call. Initially these params are set to non-zero value. |
|
|
|
|
|
Indicates if limit is set on memory usage in Global Arrays on the calling processor. "1" means "yes", "0" means "no". This operation is local. |
|
|
Returns the GA process id (0, ..., ga_Nnodes()-1) of the requesting compute process. This operation is local. |
|
|
Returns the number of the GA compute (user) processes. This operation is local. |
|
|
This non-collective (MIMD) operation prints information about:. number of calls to the GA create/duplicate, destroy, get, put, scatter, gather, and read_and_inc operations total amount of data moved in the GA primitive operations amount of data moved in GA primitive operations to logicaly remote locations maximum memory consumption in global arrays, and number of requests serviced in the interrupt-driven implementations by the calling process. This operation is local. |
|
|
This is a local operation. |
|
|
|
|
|
Synchronize processes (a barrier) and ensure that all GA operations completed.
|
|
|
|
|
|
Returns "1" if memory in global arrays comes from the Memory Allocator (MA). "0"means that memory comes from another source, for example System V shared memory is used. This operation is local. |
|
|
Returns "1" if uses fortran API, else returns "0".
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002