4.6.8. pde.tools.mpi module

Auxillary functions and variables for dealing with MPI multiprocessing

mpi_send

send data to another MPI node

mpi_recv

receive data from another MPI node

mpi_allreduce

combines data from all MPI nodes

initialized: bool = False

Flag determining whether mpi was initialized (and is available)

Type

bool

is_main: bool = True

Flag indicating whether the current process is the main process (with ID 0)

Type

bool

mpi_allreduce(data, operator=None)[source]

combines data from all MPI nodes

Note that complex datatypes and user-defined functions are not properly supported.

Parameters
  • data – Data being send from this node to all others

  • operator (Optional[Union[int, Operator]]) – The operator used to combine all data. Possible options are summarized in the IntEnum numba_mpi.Operator.

Returns

The accumulated data

mpi_recv(data, source, tag)[source]

receive data from another MPI node

Parameters
  • data – A buffer into which the received data is written

  • dest (int) – The ID of the sending node

  • tag (int) – A numeric tag identifying the message

Return type

None

mpi_send(data, dest, tag)[source]

send data to another MPI node

Parameters
  • data – The data being send

  • dest (int) – The ID of the receiving node

  • tag (int) – A numeric tag identifying the message

Return type

None

ol_mpi_allreduce(data, operator=None)[source]

overload the mpi_allreduce function

Parameters

operator (Optional[Union[int, Operator]]) –

parallel_run: bool = False

Flag indicating whether the current run is using multiprocessing

Type

bool

rank: int = 0

ID of the current process

Type

int

size: int = 1

Total process count

Type

int