caput.util.mpitools#
Utilities for making MPI usage transparent.
This module exposes much of the functionality of mpi4py but will still
run in serial if MPI is not present on the system. It is, thus, useful for
writing code that can be run in either parallel or serial. Also it exposes all
attributes of the mpi4py.MPI module by the _SelfWrapper class for
convenience. You can just use:
mpitools.attr
instead of:
from mpi4py import MPI
MPI.attr
Attributes#
MPI rank of the current process. |
|
True if this rank is rank 0. |
|
Total number of MPI ranks. |
|
Global MPI communicator, if MPI is enabled. |
|
Global shared-memory MPI communicator, if MPI is enabled. |
Classes#
Filter log entries by MPI rank. |
Functions#
|
Make processes listed in aprocs active, while others wait. |
|
Return a communicator consisting of processes listed in aprocs. |
|
Create a hdf5 dataset and return its offset and size. |
|
Call comm.allreduce if MPI is enabled. |
|
Shared memory in bytes available to a process. |
|
Call comm.Barrier() if MPI is enabled. |
|
Call comm.bcast if MPI is enabled. |
|
Check if nbytes of memory is available to allocate. |
|
Send a message to the waiting processes to close their waiting. |
|
Get the number of CPUs available to each process. |
Install an MPI-aware exception handler. |
|
|
Gather data array in each process to the global array in root process. |
|
Write buffer contents to disk at a given locked offset. |
|
MPI aware version of range, each process gets its own sub section. |
|
Apply a parallel map using MPI. |
|
Write out array (distributed across processes row wise) into a HDF5 in parallel. |
|
Return the partition of a list specific to the current MPI process. |
|
Split a range of integers |
|
Split a range of integers |
|
Swap 2D matrix split from row-wise to columnwise. |
|
Map a numpy dtype into an MPI_Datatype. |