MALOC
0.1
|
Virtual (currently just MPI) communications layer. More...
Files | |
file | vcom.h |
Class Vcom: virtual (currently just MPI) communications layer. | |
Classes | |
struct | sVcom |
Contains public data members for Vcom class. More... | |
Typedefs | |
typedef struct sVcom | Vcom |
Declaration of the Vcom class as the Vcom structure More... | |
Functions | |
int | Vcom_init (int *argc, char ***argv) |
The Vmp initializer. More... | |
int | Vcom_finalize (void) |
The Vmp finalizer. More... | |
Vcom * | Vcom_ctor (int commtype) |
Construct the communications object. This routine sets up data members of class and initializes MPI. More... | |
int | Vcom_ctor2 (Vcom *thee, int commtype) |
Construct the communications object. This routine sets up data members of class and initializes MPI. This is broken into two parts to be callable from FORTRAN. More... | |
void | Vcom_dtor (Vcom **thee) |
Destroy the communications object. More... | |
void | Vcom_dtor2 (Vcom *thee) |
Destroy the communications object. This is broken into two parts to be callable from FORTRAN. More... | |
int | Vcom_send (Vcom *thee, int des, void *buf, int len, int type, int block) |
Send a buffer. Returns 1 on success. More... | |
int | Vcom_recv (Vcom *thee, int src, void *buf, int len, int type, int block) |
Receive a (character) buffer. The blocking flag is present, but not used. All receives are assumed to be blocking. A non-blocking receive would be very ugly to implement (signals or something?). More... | |
int | Vcom_getCount (Vcom *thee, int src, int *length, int type) |
Perform a blocking probe to get the length (in number of items of specified type) of an incoming message and place it in the argument ``length". More... | |
int | Vcom_reduce (Vcom *thee, void *sendbuf, void *recvbuf, int length, int type, int op) |
Perform a reduction of the data across all processors. This is equivalent (and in the case of MPI is identical to) MPI_Allreduce. Basically, the specified operations are appleed to each member of the sendbuf across all processors and the results are written to recvbuf. More... | |
int | Vcom_size (Vcom *thee) |
Get the number of PEs in communicator. More... | |
int | Vcom_resize (Vcom *thee, int newsize) |
Resize (shrink) the communications group to include only newsize number of processors. Obsolete processes are given rank of -1 and size of 0. More... | |
int | Vcom_rank (Vcom *thee) |
Get the ID of the local PE More... | |
int | Vcom_barr (Vcom *thee) |
Synchronization barrier. More... | |
Virtual (currently just MPI) communications layer.
int Vcom_barr | ( | Vcom * | thee | ) |
Synchronization barrier.
thee | Pointer to the communications object |
Vcom* Vcom_ctor | ( | int | commtype | ) |
Construct the communications object. This routine sets up data members of class and initializes MPI.
commtype | type of communications object |
int Vcom_ctor2 | ( | Vcom * | thee, |
int | commtype | ||
) |
Construct the communications object. This routine sets up data members of class and initializes MPI. This is broken into two parts to be callable from FORTRAN.
thee | Pointer to the new allocated communications object. |
commtype | type of communications object |
void Vcom_dtor | ( | Vcom ** | thee | ) |
Destroy the communications object.
thee | Pointer to the communications object. |
void Vcom_dtor2 | ( | Vcom * | thee | ) |
Destroy the communications object. This is broken into two parts to be callable from FORTRAN.
thee | Pointer to the communications object. |
int Vcom_finalize | ( | void | ) |
The Vmp finalizer.
int Vcom_getCount | ( | Vcom * | thee, |
int | src, | ||
int * | length, | ||
int | type | ||
) |
Perform a blocking probe to get the length (in number of items of specified type) of an incoming message and place it in the
argument ``length".
thee | Pointer to the communications object. |
src | rank of receiving processor |
length | Pointer to perform a blocking probe |
type | type of items in message. 0 => MPI_BYTE, 1 => MPI_INT, 2 => MPI_DOUBLE, 3 => MPI_CHAR |
int Vcom_init | ( | int * | argc, |
char *** | argv | ||
) |
The Vmp initializer.
argc | number of the command line arguments |
argv | the command line arguments |
int Vcom_rank | ( | Vcom * | thee | ) |
Get the ID of the local PE
thee | Pointer to the communications object |
int Vcom_recv | ( | Vcom * | thee, |
int | src, | ||
void * | buf, | ||
int | len, | ||
int | type, | ||
int | block | ||
) |
Receive a (character) buffer.
The blocking flag is present, but not used. All receives are assumed to be blocking. A non-blocking receive would be very ugly to implement (signals or something?).
thee | Pointer to the communications object. |
src | rank of receiving processor |
buf | pointer to buffer of previously allocated memory |
len | number of items (of declared type) in buffer |
type | type of items in message. 0 => MPI_BYTE, 1 => MPI_INT, 2 => MPI_DOUBLE, 3 => MPI_CHAR |
block | toggles blocking on (=1) and off (=0) |
int Vcom_reduce | ( | Vcom * | thee, |
void * | sendbuf, | ||
void * | recvbuf, | ||
int | length, | ||
int | type, | ||
int | op | ||
) |
Perform a reduction of the data across all processors. This is equivalent (and in the case of MPI is identical to) MPI_Allreduce. Basically, the specified operations are appleed to each member of
the sendbuf across all processors and the results are written to recvbuf.
thee | Pointer to the communications object |
sendbuf | buffer containing length items of the specified type to be operated on |
recvbuf | buffer containing length items of the specified type after operation |
length | number of items |
type | type of items in message 0 => MPI_BYTE, 1 => MPI_INT, 2 => MPI_DOUBLE, 3 => MPI_CHAR |
op | operation to perform 0 => MPI_SUM, 1 => MPI_PROD, 2 => MPI_MIN, 3 => MPI_MAX |
int Vcom_resize | ( | Vcom * | thee, |
int | newsize | ||
) |
Resize (shrink) the communications group to include only newsize number of processors.
Obsolete processes are given rank of -1 and size of 0.
thee | Pointer to the communications object |
newsize | number of processors |
int Vcom_send | ( | Vcom * | thee, |
int | des, | ||
void * | buf, | ||
int | len, | ||
int | type, | ||
int | block | ||
) |
Send a buffer. Returns 1 on success.
thee | Pointer to the communications object. |
des | rank of receiving processor |
buf | buffer containing message |
len | number of items (of declared type) in buffer |
type | type of items in message. 0 => MPI_BYTE, 1 => MPI_INT, 2 => MPI_DOUBLE, 3 => MPI_CHAR |
block | toggles blocking on (=1) and off (=0) |
int Vcom_size | ( | Vcom * | thee | ) |
Get the number of PEs in communicator.
thee | Pointer to the communications object |