|
IBAMR
IBAMR version 0.19.
|
Provides C++ wrapper around MPI routines. More...
#include <tbox/SAMRAI_MPI.h>
Classes | |
| struct | DoubleIntStruct |
| struct | FloatIntStruct |
| struct | IntIntStruct |
Public Types | |
| typedef MPI_Comm | comm |
| typedef MPI_Group | group |
| typedef MPI_Request | request |
| typedef MPI_Status | status |
Static Public Member Functions | |
| static void | setCallAbortInSerialInsteadOfExit (bool flag=true) |
| static void | abort () |
| static void | init (int *argc, char **argv[]) |
| static void | finalize () |
| static void | initialize () |
| static void | setCommunicator (SAMRAI_MPI::comm communicator) |
| static SAMRAI_MPI::comm | getCommunicator () |
| static int | getRank () |
| static int | getNodes () |
| static void | updateOutgoingStatistics (const int messages, const int bytes) |
| static void | updateIncomingStatistics (const int messages, const int bytes) |
| static int | getOutgoingMessages () |
| static int | getOutgoingBytes () |
| static int | getIncomingMessages () |
| static int | getIncomingBytes () |
| static int | getTreeDepth () |
| static void | barrier () |
| static double | sumReduction (const double x) |
| static void | sumReduction (double *x, const int n=1) |
| static float | sumReduction (const float x) |
| static void | sumReduction (float *x, const int n=1) |
| static dcomplex | sumReduction (const dcomplex x) |
| static void | sumReduction (dcomplex *x, const int n=1) |
| static int | sumReduction (const int x) |
| static void | sumReduction (int *x, const int n=1) |
| static double | minReduction (const double x, int *rank_of_min=NULL) |
| static void | minReduction (double *x, const int n=1, int *rank_of_min=NULL) |
| static float | minReduction (const float x, int *rank_of_min=NULL) |
| static void | minReduction (float *x, const int n=1, int *rank_of_min=NULL) |
| static int | minReduction (const int x, int *rank_of_min=NULL) |
| static void | minReduction (int *x, const int n=1, int *rank_of_min=NULL) |
| static double | maxReduction (const double x, int *rank_of_max=NULL) |
| static void | maxReduction (double *x, const int n=1, int *rank_of_max=NULL) |
| static float | maxReduction (const float x, int *rank_of_max=NULL) |
| static void | maxReduction (float *x, const int n=1, int *rank_of_max=NULL) |
| static int | maxReduction (const int x, int *rank_of_max=NULL) |
| static void | maxReduction (int *x, const int n=1, int *rank_of_max=NULL) |
| static void | allToOneSumReduction (int *x, const int n, const int root=0) |
| static int | bcast (const int x, const int root) |
| static void | bcast (int *x, int &length, const int root) |
| static void | bcast (char *x, int &length, const int root) |
| static void | send (const int *buf, const int length, const int receiving_proc_number, const bool send_length=true, int tag=-1) |
| This function sends an MPI message with an integer array to another processer. More... | |
| static void | sendBytes (const void *buf, const int number_bytes, const int receiving_proc_number) |
| This function sends an MPI message with an array of bytes (MPI_BYTES) to receiving_proc_number. More... | |
| static int | recvBytes (void *buf, int number_bytes) |
| This function receives an MPI message with an array of max size number_bytes (MPI_BYTES) from any processer. More... | |
| static void | recv (int *buf, int &length, const int sending_proc_number, const bool get_length=true, int tag=-1) |
| This function receives an MPI message with an integer array from another processer. More... | |
| static void | allGather (const int *x_in, int size_in, int *x_out, int size_out) |
| static void | allGather (const double *x_in, int size_in, double *x_out, int size_out) |
| static void | allGather (int x_in, int *x_out) |
| static void | allGather (double x_in, double *x_out) |
Static Public Attributes | |
| static comm | commWorld |
| static comm | commNull |
Static Private Member Functions | |
| static void | allGatherSetup (int size_in, int size_out, int *&rcounts, int *&disps) |
Static Private Attributes | |
| static SAMRAI_MPI::comm | s_communicator |
| static int | s_outgoing_messages |
| static int | s_outgoing_bytes |
| static int | s_incoming_messages |
| static int | s_incoming_bytes |
| static int | s_initialized |
Class SAMRAI_MPI groups common MPI routines into one globally-accessible location. It provides small, simple routines that are common in MPI code. In some cases, the calling syntax has been simplified for convenience. Moreover, there is no reason to include the preprocessor ifdef/endif guards around these calls, since the MPI libraries are not called in these routines if the MPI libraries are not being used (e.g., when writing serial code).
Note that this class is a utility class to group function calls in one name space (all calls are to static functions). Thus, you should never attempt to instantiate a class of type MPI; simply call the functions as static functions using the MPI::function(...) syntax.
| typedef MPI_Comm SAMRAI::tbox::SAMRAI_MPI::comm |
MPI Types
| typedef MPI_Group SAMRAI::tbox::SAMRAI_MPI::group |
| typedef MPI_Request SAMRAI::tbox::SAMRAI_MPI::request |
| typedef MPI_Status SAMRAI::tbox::SAMRAI_MPI::status |
|
static |
This function does nothing and exists for backwards compatibility.
|
static |
Call std::abort() in serial and MPI_Abort() in parallel.
|
static |
Call MPI_Init. Use of this function avoids guarding MPI init calls in application code.
|
static |
Call MPI_Finalize. Use of this function avoids guarding MPI finalize calls in application code.
|
static |
Initialize the MPI utility class. The MPI utility class must be initialized after the call to MPI_Init or SAMRAI_MPI::init.
|
static |
Set the communicator that is used for the MPI communication routines. The default communicator is MPI_COMM_WORLD.
|
static |
Get the current MPI communicator. The default communicator is MPI_COMM_WORLD.
|
static |
Return the processor rank (identifier) from 0 through the number of processors minus one.
|
static |
Return the number of processors (nodes).
|
static |
Update the statistics for outgoing messages. Statistics are automatically updated for the reduction calls in MPI.
|
static |
Update the statistics for incoming messages. Statistics are automatically updated for the reduction calls in MPI.
|
static |
Return the number of outgoing messages.
|
static |
Return the number of outgoing message bytes.
|
static |
Return the number of incoming messages.
|
static |
Return the number of incoming message bytes.
|
static |
Get the depth of the reduction trees given the current number of MPI processors.
|
static |
Perform a global barrier across all processors.
Perform a scalar sum reduction on a double across all nodes. Each processor contributes a value x of type double, and the sum is returned from the function.
Perform an array sum reduction on doubles across all nodes. Each processor contributes an array of values of type double, and the element-wise sum is returned in the same array.
|
static |
Perform a scalar sum reduction on a float across all nodes. Each processor contributes a value x of type float, and the sum is returned from the function.
|
static |
Perform an array sum reduction on floats across all nodes. Each processor contributes an array of values of type float, and the element-wise sum is returned in the same array.
Perform a scalar sum reduction on a dcomplex across all nodes. Each processor contributes a value x of type dcomplex, and the sum is returned from the function.
Perform an array sum reduction on dcomplexes across all nodes. Each processor contributes an array of values of type dcomplex, and the element-wise sum is returned in the same array.
Perform a scalar sum reduction on an integer across all nodes. Each processor contributes a value x of type int, and the sum is returned from the function.
Perform an array sum reduction on integers across all nodes. Each processor contributes an array of values of type int, and the element-wise sum is returned in the same array.
|
static |
Perform a scalar min reduction on a double across all nodes. Each processor contributes a value x of type double, and the minimum is returned from the function.
If a 'rank_of_min' argument is provided, it will set it to the rank of process holding the minimum value.
|
static |
Perform an array min reduction on doubles across all nodes. Each processor contributes an array of values of type double, and the element-wise minimum is returned in the same array.
If a 'rank_of_min' argument is provided, it will set the array to the rank of process holding the minimum value. Like the double argument, the size of the supplied 'rank_of_min' array should be n.
|
static |
Perform a scalar min reduction on a float across all nodes. Each processor contributes a value x of type float, and the minimum is returned from the function.
If a 'rank_of_min' argument is provided, it will set it to the rank of process holding the minimum value.
|
static |
Perform an array min reduction on floats across all nodes. Each processor contributes an array of values of type float, and the element-wise minimum is returned in the same array.
If a 'rank_of_min' argument is provided, it will set the array to the rank of process holding the minimum value. Like the double argument, the size of the supplied 'rank_of_min' array should be n.
Perform a scalar min reduction on an integer across all nodes. Each processor contributes a value x of type int, and the minimum is returned from the function.
If a 'rank_of_min' argument is provided, it will set it to the rank of process holding the minimum value.
|
static |
Perform an array min reduction on integers across all nodes. Each processor contributes an array of values of type int, and the element-wise minimum is returned in the same array.
If a 'rank_of_min' argument is provided, it will set the array to the rank of process holding the minimum value. Like the double argument, the size of the supplied 'rank_of_min' array should be n.
|
static |
Perform a scalar max reduction on a double across all nodes. Each processor contributes a value x of type double, and the maximum is returned from the function.
If a 'rank_of_max' argument is provided, it will set it to the rank of process holding the maximum value.
|
static |
Perform an array max reduction on doubles across all nodes. Each processor contributes an array of values of type double, and the element-wise maximum is returned in the same array.
If a 'rank_of_max' argument is provided, it will set the array to the rank of process holding the maximum value. Like the double argument, the size of the supplied 'rank_of_max' array should be n.
|
static |
Perform a scalar max reduction on a float across all nodes. Each processor contributes a value x of type float, and the maximum is returned from the function.
If a 'rank_of_max' argument is provided, it will set it to the rank of process holding the maximum value.
|
static |
Perform an array max reduction on floats across all nodes. Each processor contributes an array of values of type float, and the element-wise maximum is returned in the same array.
If a 'rank_of_max' argument is provided, it will set the array to the rank of process holding the maximum value. Like the double argument, the size of the supplied 'rank_of_max' array should be n.
Perform a scalar max reduction on an integer across all nodes. Each processor contributes a value x of type int, and the maximum is returned from the function.
If a 'rank_of_max' argument is provided, it will set it to the rank of process holding the maximum value.
|
static |
Perform an array max reduction on integers across all nodes. Each processor contributes an array of values of type int, and the element-wise maximum is returned in the same array.
If a 'rank_of_max' argument is provided, it will set the array to the rank of process holding the maximum value. Like the double argument, the size of the supplied 'rank_of_max' array should be n.
|
static |
Perform an all-to-one sum reduction on an integer array. The final result is only available on the root processor.
Broadcast integer from specified root process to all other processes. All processes other than root, receive a copy of the integer value.
Broadcast integer array from specified root processor to all other processors. For the root processor, "array" and "length" are treated as const.
Broadcast char array from specified root processor to all other processors. For the root processor, "array" and "length" are treated as const.
|
static |
If the receiving processor knows in advance the length of the array, use "send_length = false;" otherwise, this processor will first send the length of the array, then send the data. This call must be paired with a matching call to SAMRAI_MPI::recv.
| buf | Pointer to integer array buffer with length integers. |
| length | Number of integers in buf that we want to send. |
| receiving_proc_number | Receiving processor number. |
| send_length | Optional boolean argument specifiying if we first need to send a message with the array size. Default value is true. |
| tag | Optional integer argument specifying an integer tag to be sent with this message. Default tag is 0. |
|
static |
This call must be paired with a matching call to SAMRAI_MPI::recvBytes.
| buf | Void pointer to an array of number_bytes bytes to send. |
| number_bytes | Integer number of bytes to send. |
| receiving_proc_number | Receiving processor number. |
This call must be paired with a matching call to SAMRAI_MPI::sendBytes.
This function returns the processor number of the sender.
| buf | Void pointer to a buffer of size number_bytes bytes. |
| number_bytes | Integer number specifing size of buf in bytes. |
|
static |
If this processor knows in advance the length of the array, use "get_length = false;" otherwise, the sending processor will first send the length of the array, then send the data. This call must be paired with a matching call to SAMRAI_MPI::send.
| buf | Pointer to integer array buffer with capacity of length integers. |
| length | Maximum number of integers that can be stored in buf. |
| sending_proc_number | Processor number of sender. |
| get_length | Optional boolean argument specifiying if we first need to send a message to determine the array size. Default value is true. |
| tag | Optional integer argument specifying a tag which must be matched by the tag of the incoming message. Default tag is 0. |
|
static |
Each processor sends an array of integers or doubles to all other processors; each processor's array may differ in length. The x_out array must be pre-allocated to the correct length (this is a bit cumbersome, but is necessary to avoid th allGather function from allocating memory that is freed elsewhere). To properly preallocate memory, before calling this method, call
size_out = SAMRAI_MPI::sumReduction(size_in)
then allocate the x_out array.
|
static |
Each processor sends every other processor an integer or double. The x_out array should be preallocated to a length equal to the number of processors.
|
staticprivate |
Performs common functions needed by some of the allToAll methods.
|
static |
MPI constants
|
static |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
1.8.17