Wrappers for MPI functions. More...
#include "mytype.h"

Go to the source code of this file.
Data Structures | |
| struct | RankReduceDataSt |
| Structure for use with MPI_MINLOC and MPI_MAXLOC operations. More... | |
Typedefs | |
| typedef struct RankReduceDataSt | RankReduceData |
| Structure for use with MPI_MINLOC and MPI_MAXLOC operations. More... | |
Functions | |
| int | getNRanks (void) |
| Return total number of processors. More... | |
| int | getMyRank (void) |
| Return local rank. More... | |
| int | printRank (void) |
| Return non-zero if printing occurs from this rank. More... | |
| void | timestampBarrier (const char *msg) |
| Print a timestamp and message when all tasks arrive. More... | |
| void | initParallel (int *argc, char ***argv) |
| Wrapper for MPI_Init. More... | |
| void | destroyParallel (void) |
| Wrapper for MPI_Finalize. More... | |
| void | barrierParallel (void) |
| Wrapper for MPI_Barrier(MPI_COMM_WORLD). More... | |
| int | sendReceiveParallel (void *sendBuf, int sendLen, int dest, void *recvBuf, int recvLen, int source) |
| Wrapper for MPI_Sendrecv. More... | |
| void | addIntParallel (int *sendBuf, int *recvBuf, int count) |
| Wrapper for MPI_Allreduce integer sum. More... | |
| void | addRealParallel (real_t *sendBuf, real_t *recvBuf, int count) |
| Wrapper for MPI_Allreduce real sum. More... | |
| void | addDoubleParallel (double *sendBuf, double *recvBuf, int count) |
| Wrapper for MPI_Allreduce double sum. More... | |
| void | maxIntParallel (int *sendBuf, int *recvBuf, int count) |
| Wrapper for MPI_Allreduce integer max. More... | |
| void | minRankDoubleParallel (RankReduceData *sendBuf, RankReduceData *recvBuf, int count) |
| Wrapper for MPI_Allreduce double min with rank. More... | |
| void | maxRankDoubleParallel (RankReduceData *sendBuf, RankReduceData *recvBuf, int count) |
| Wrapper for MPI_Allreduce double max with rank. More... | |
| void | bcastParallel (void *buf, int len, int root) |
| Wrapper for MPI_Bcast. More... | |
| int | builtWithMpi (void) |
| Return non-zero if code was built with MPI active. More... | |
Wrappers for MPI functions.
Definition in file parallel.h.
| typedef struct RankReduceDataSt RankReduceData |
Structure for use with MPI_MINLOC and MPI_MAXLOC operations.
| void addDoubleParallel | ( | double * | sendBuf, |
| double * | recvBuf, | ||
| int | count | ||
| ) |
Wrapper for MPI_Allreduce double sum.
Definition at line 133 of file parallel.c.

| void addIntParallel | ( | int * | sendBuf, |
| int * | recvBuf, | ||
| int | count | ||
| ) |
Wrapper for MPI_Allreduce integer sum.
Definition at line 113 of file parallel.c.

Wrapper for MPI_Allreduce real sum.
Definition at line 123 of file parallel.c.

| void barrierParallel | ( | void | ) |
Wrapper for MPI_Barrier(MPI_COMM_WORLD).
Definition at line 79 of file parallel.c.

| void bcastParallel | ( | void * | buf, |
| int | count, | ||
| int | root | ||
| ) |
Wrapper for MPI_Bcast.
| [in] | count | Length of buf in bytes. |
Definition at line 181 of file parallel.c.

| int builtWithMpi | ( | void | ) |
Return non-zero if code was built with MPI active.
Definition at line 188 of file parallel.c.

| void destroyParallel | ( | void | ) |
Wrapper for MPI_Finalize.
Definition at line 72 of file parallel.c.

| int getMyRank | ( | void | ) |
Return local rank.
Definition at line 36 of file parallel.c.

| int getNRanks | ( | void | ) |
Return total number of processors.
Definition at line 31 of file parallel.c.

| void initParallel | ( | int * | argc, |
| char *** | argv | ||
| ) |
Wrapper for MPI_Init.
Definition at line 63 of file parallel.c.

| void maxIntParallel | ( | int * | sendBuf, |
| int * | recvBuf, | ||
| int | count | ||
| ) |
Wrapper for MPI_Allreduce integer max.
Definition at line 143 of file parallel.c.

| void maxRankDoubleParallel | ( | RankReduceData * | sendBuf, |
| RankReduceData * | recvBuf, | ||
| int | count | ||
| ) |
Wrapper for MPI_Allreduce double max with rank.
Definition at line 167 of file parallel.c.

| void minRankDoubleParallel | ( | RankReduceData * | sendBuf, |
| RankReduceData * | recvBuf, | ||
| int | count | ||
| ) |
Wrapper for MPI_Allreduce double min with rank.
Definition at line 154 of file parallel.c.

| int printRank | ( | void | ) |
Return non-zero if printing occurs from this rank.
For now this is just a check for rank 0 but in principle it could be more complex. It is also possible to suppress practically all output by causing this function to return 0 for all ranks.
Definition at line 45 of file parallel.c.

| int sendReceiveParallel | ( | void * | sendBuf, |
| int | sendLen, | ||
| int | dest, | ||
| void * | recvBuf, | ||
| int | recvLen, | ||
| int | source | ||
| ) |
Wrapper for MPI_Sendrecv.
| [in] | sendBuf | Data to send. |
| [in] | sendLen | Number of bytes to send. |
| [in] | dest | Rank in MPI_COMM_WORLD where data will be sent. |
| [out] | recvBuf | Received data. |
| [in] | recvLen | Maximum number of bytes to receive. |
| [in] | source | Rank in MPI_COMM_WORLD from which to receive. |
Definition at line 93 of file parallel.c.

| void timestampBarrier | ( | const char * | msg | ) |
Print a timestamp and message when all tasks arrive.
Definition at line 51 of file parallel.c.

