FORM
4.2.1
|
Go to the source code of this file.
Data Structures | |
struct | longMultiStruct |
Macros | |
#define | PF_PACKSIZE 1600 |
#define | MPI_ERRCODE_CHECK(err) |
Typedefs | |
typedef struct longMultiStruct | PF_LONGMULTI |
Functions | |
LONG | PF_RealTime (int i) |
int | PF_LibInit (int *argcp, char ***argvp) |
int | PF_LibTerminate (int error) |
int | PF_Probe (int *src) |
int | PF_ISendSbuf (int to, int tag) |
int | PF_RecvWbuf (WORD *b, LONG *s, int *src) |
int | PF_IRecvRbuf (PF_BUFFER *r, int bn, int from) |
int | PF_WaitRbuf (PF_BUFFER *r, int bn, LONG *size) |
int | PF_Bcast (void *buffer, int count) |
int | PF_RawSend (int dest, void *buf, LONG l, int tag) |
LONG | PF_RawRecv (int *src, void *buf, LONG thesize, int *tag) |
int | PF_RawProbe (int *src, int *tag, int *bytesize) |
int | PF_PrintPackBuf (char *s, int size) |
int | PF_PreparePack (void) |
int | PF_Pack (const void *buffer, size_t count, MPI_Datatype type) |
int | PF_Unpack (void *buffer, size_t count, MPI_Datatype type) |
int | PF_PackString (const UBYTE *str) |
int | PF_UnpackString (UBYTE *str) |
int | PF_Send (int to, int tag) |
int | PF_Receive (int src, int tag, int *psrc, int *ptag) |
int | PF_Broadcast (void) |
int | PF_PrepareLongSinglePack (void) |
int | PF_LongSinglePack (const void *buffer, size_t count, MPI_Datatype type) |
int | PF_LongSingleUnpack (void *buffer, size_t count, MPI_Datatype type) |
int | PF_LongSingleSend (int to, int tag) |
int | PF_LongSingleReceive (int src, int tag, int *psrc, int *ptag) |
int | PF_PrepareLongMultiPack (void) |
int | PF_LongMultiPackImpl (const void *buffer, size_t count, size_t eSize, MPI_Datatype type) |
int | PF_LongMultiUnpackImpl (void *buffer, size_t count, size_t eSize, MPI_Datatype type) |
int | PF_LongMultiBroadcast (void) |
Variables | |
LONG | PF_maxDollarChunkSize = 0 |
MPI dependent functions of parform
This file contains all the functions for the parallel version of form3 that explicitly need to call mpi routines. This is the only file that really needs to be linked to the mpi-library!
Definition in file mpi.c.
#define MPI_ERRCODE_CHECK | ( | err | ) |
A macro which exits the caller with a non-zero return value if err is not MPI_SUCCESS.
err | The return value of a MPI function to be checked. |
Definition at line 84 of file mpi.c.
Referenced by PF_Broadcast(), PF_Pack(), PF_Receive(), PF_Send(), and PF_Unpack().
LONG PF_RealTime | ( | int | i | ) |
int PF_LibInit | ( | int * | argcp, |
char *** | argvp | ||
) |
int PF_LibTerminate | ( | int | error | ) |
Exits mpi, when there is an error either indicated or happening, returnvalue is 1, else returnvalue is 0.
error | an error code. |
Definition at line 209 of file mpi.c.
Referenced by PF_Terminate().
int PF_Probe | ( | int * | src | ) |
Probes the next incoming message. If src == PF_ANY_SOURCE this operation is blocking, otherwise nonbloking.
[in,out] | src | the source process number. In output, the process number of actual found source. |
int PF_ISendSbuf | ( | int | to, |
int | tag | ||
) |
Nonblocking send operation. It sends everything from buff
to fill
of the active buffer. Depending on tag it also can do waiting for other sends to finish or set the active buffer to the next one.
to | the destination process number. |
tag | the message tag. |
Definition at line 261 of file mpi.c.
Referenced by FlushOut(), PF_Processor(), and PutOut().
int PF_RecvWbuf | ( | WORD * | b, |
LONG * | s, | ||
int * | src | ||
) |
Blocking receive of a WORD
buffer.
[out] | b | the buffer to store the received data. |
[in,out] | s | the size of the buffer. The output value is the actual size of the received data. |
[in,out] | src | the source process number. The output value is the process number of actual source. |
int PF_IRecvRbuf | ( | PF_BUFFER * | r, |
int | bn, | ||
int | from | ||
) |
int PF_WaitRbuf | ( | PF_BUFFER * | r, |
int | bn, | ||
LONG * | size | ||
) |
Waits for the buffer bn to finish a pending nonblocking receive. It returns the received tag and in *size
the number of field received. If the receive is already finished, just return the flag and size, else wait for it to finish, but also check for other pending receives.
r | the PF_BUFFER struct for the pending nonblocking receive. | |
bn | the index of the cyclic buffer. | |
[out] | size | the actual size of received data. |
int PF_Bcast | ( | void * | buffer, |
int | count | ||
) |
Broadcasts a message from the master to slaves.
[in,out] | buffer | the starting address of buffer. The contents in this buffer on the master will be transferred to those on the slaves. |
count | the length of the buffer in bytes. |
Definition at line 440 of file mpi.c.
Referenced by PF_BroadcastBuffer(), and PF_BroadcastNumber().
int PF_RawSend | ( | int | dest, |
void * | buf, | ||
LONG | l, | ||
int | tag | ||
) |
Sends l bytes from buf to dest. Returns 0 on success, or -1.
dest | the destination process number. |
buf | the send buffer. |
l | the size of data in the send buffer in bytes. |
tag | the message tag. |
Definition at line 463 of file mpi.c.
Referenced by PF_MUnlock(), and PF_SendFile().
LONG PF_RawRecv | ( | int * | src, |
void * | buf, | ||
LONG | thesize, | ||
int * | tag | ||
) |
Receives not more than thesize bytes from src, returns the actual number of received bytes, or -1 on failure.
[in,out] | src | the source process number. In output, that of the actual received message. |
[out] | buf | the receive buffer. |
thesize | the size of the receive buffer in bytes. | |
[out] | tag | the message tag of the actual received message. |
Definition at line 484 of file mpi.c.
Referenced by PF_RecvFile().
int PF_RawProbe | ( | int * | src, |
int * | tag, | ||
int * | bytesize | ||
) |
Probes an incoming message.
[in,out] | src | the source process number. In output, that of the actual received message. |
[in,out] | tag | the message tag. In output, that of the actual received message. |
[out] | bytesize | the size of incoming data in bytes. |
int PF_PrintPackBuf | ( | char * | s, |
int | size | ||
) |
int PF_PreparePack | ( | void | ) |
Prepares for the next pack operations on the sender.
Definition at line 624 of file mpi.c.
Referenced by PF_BroadcastPreDollar(), PF_BroadcastString(), and PF_Init().
int PF_Pack | ( | const void * | buffer, |
size_t | count, | ||
MPI_Datatype | type | ||
) |
Adds data into the pack buffer.
buffer | the pointer to the buffer storing the data to be packed. |
count | the number of elements in the buffer. |
type | the data type of elements in the buffer. |
Definition at line 642 of file mpi.c.
References MPI_ERRCODE_CHECK.
Referenced by PF_BroadcastPreDollar(), and PF_Init().
int PF_Unpack | ( | void * | buffer, |
size_t | count, | ||
MPI_Datatype | type | ||
) |
Retrieves the next data in the pack buffer.
[out] | buffer | the pointer to the buffer to store the unpacked data. |
count | the number of elements of data to be received. | |
type | the data type of elements of data to be received. |
Definition at line 671 of file mpi.c.
References MPI_ERRCODE_CHECK.
Referenced by PF_BroadcastPreDollar(), and PF_Init().
int PF_PackString | ( | const UBYTE * | str | ) |
Packs a string str into the packed buffer PF_packbuf, including the trailing zero.
The first element (PF_INT) is the length of the packed portion of the string. If the string does not fit to the buffer PF_packbuf, the function packs only the initial portion. It returns the number of packed bytes, so if (str[length-1]=='\0') then the whole string fits to the buffer, if not, then the rest (str+length) bust be packed and send again. On error, the function returns the negative error code.
One exception: the string "\0!\0" is used as an image of the NULL, so all 3 characters will be packed.
str | a string to be packed. |
Definition at line 706 of file mpi.c.
Referenced by PF_BroadcastString().
int PF_UnpackString | ( | UBYTE * | str | ) |
Unpacks a string to str from the packed buffer PF_packbuf, including the trailing zero.
It returns the number of unpacked bytes, so if (str[length-1]=='\0') then the whole string was unpacked, if not, then the rest must be appended to (str+length). On error, the function returns the negative error code.
[out] | str | the buffer to store the unpacked string |
Definition at line 774 of file mpi.c.
Referenced by PF_BroadcastString().
int PF_Send | ( | int | to, |
int | tag | ||
) |
Sends the contents in the pack buffer to the process specified by to.
Example:
to | the destination process number. |
tag | the message tag. |
Definition at line 822 of file mpi.c.
References MPI_ERRCODE_CHECK.
int PF_Receive | ( | int | src, |
int | tag, | ||
int * | psrc, | ||
int * | ptag | ||
) |
Receives data into the pack buffer from the process specified by src. This function allows &src == psrc or &tag == ptag. Either psrc or ptag can be NULL.
See the example of PF_Send().
src | the source process number (can be PF_ANY_SOURCE). | |
tag | the source message tag (can be PF_ANY_TAG). | |
[out] | psrc | the actual source process number of received message. |
[out] | ptag | the received message tag. |
Definition at line 848 of file mpi.c.
References MPI_ERRCODE_CHECK.
int PF_Broadcast | ( | void | ) |
Broadcasts the contents in the pack buffer on the master to those on the slaves.
Example:
Definition at line 883 of file mpi.c.
References MPI_ERRCODE_CHECK.
Referenced by PF_BroadcastPreDollar(), PF_BroadcastString(), and PF_Init().
int PF_PrepareLongSinglePack | ( | void | ) |
Prepares for the next long-single-pack operations on the sender.
Definition at line 1451 of file mpi.c.
Referenced by PF_CollectModifiedDollars(), and PF_Processor().
int PF_LongSinglePack | ( | const void * | buffer, |
size_t | count, | ||
MPI_Datatype | type | ||
) |
Adds data into the "long single" pack buffer.
buffer | the pointer to the buffer storing the data to be packed. |
count | the number of elements in the buffer. |
type | the data type of elements in the buffer. |
Definition at line 1469 of file mpi.c.
Referenced by PF_CollectModifiedDollars(), and PF_Processor().
int PF_LongSingleUnpack | ( | void * | buffer, |
size_t | count, | ||
MPI_Datatype | type | ||
) |
Retrieves the next data in the "long single" pack buffer.
[out] | buffer | the pointer to the buffer to store the unpacked data. |
count | the number of elements of data to be received. | |
type | the data type of elements of data to be received. |
Definition at line 1503 of file mpi.c.
Referenced by PF_CollectModifiedDollars(), and PF_Processor().
int PF_LongSingleSend | ( | int | to, |
int | tag | ||
) |
Sends the contents in the "long single" pack buffer to the process specified by to.
Example:
to | the destination process number. |
tag | the message tag. |
Definition at line 1540 of file mpi.c.
Referenced by PF_CollectModifiedDollars(), and PF_Processor().
int PF_LongSingleReceive | ( | int | src, |
int | tag, | ||
int * | psrc, | ||
int * | ptag | ||
) |
Receives data into the "long single" pack buffer from the process specified by src. This function allows &src == psrc or &tag == ptag. Either psrc or ptag can be NULL.
See the example of PF_LongSingleSend().
src | the source process number (can be PF_ANY_SOURCE). | |
tag | the source message tag (can be PF_ANY_TAG). | |
[out] | psrc | the actual source process number of received message. |
[out] | ptag | the received message tag. |
Definition at line 1583 of file mpi.c.
Referenced by PF_CollectModifiedDollars(), and PF_Processor().
int PF_PrepareLongMultiPack | ( | void | ) |
Prepares for the next long-multi-pack operations on the sender.
Definition at line 1643 of file mpi.c.
Referenced by PF_BroadcastCBuf(), PF_BroadcastExpFlags(), PF_BroadcastModifiedDollars(), and PF_BroadcastRedefinedPreVars().
int PF_LongMultiPackImpl | ( | const void * | buffer, |
size_t | count, | ||
size_t | eSize, | ||
MPI_Datatype | type | ||
) |
Adds data into the "long multi" pack buffer.
buffer | the pointer to the buffer storing the data to be packed. |
count | the number of elements in the buffer. |
eSize | the byte size of each element of data. |
type | the data type of elements in the buffer. |
Definition at line 1662 of file mpi.c.
References PF_LongMultiPackImpl().
Referenced by PF_LongMultiPackImpl().
int PF_LongMultiUnpackImpl | ( | void * | buffer, |
size_t | count, | ||
size_t | eSize, | ||
MPI_Datatype | type | ||
) |
Retrieves the next data in the "long multi" pack buffer.
[out] | buffer | the pointer to the buffer to store the unpacked data. |
count | the number of elements of data to be received. | |
eSize | the byte size of each element of data. | |
type | the data type of elements of data to be received. |
Definition at line 1721 of file mpi.c.
References PF_LongMultiUnpackImpl().
Referenced by PF_LongMultiUnpackImpl().
int PF_LongMultiBroadcast | ( | void | ) |
Broadcasts the contents in the "long multi" pack buffer on the master to those on the slaves.
Example:
Definition at line 1807 of file mpi.c.
Referenced by PF_BroadcastCBuf(), PF_BroadcastExpFlags(), PF_BroadcastModifiedDollars(), and PF_BroadcastRedefinedPreVars().