PB3D
[2.45]
Ideal linear high-n MHD stability in 3-D
|
Numerical utilities related to MPI. More...
Interfaces and Types | |
interface | broadcast_var |
Wrapper function to broadcast a single variable using MPI. More... | |
interface | get_ghost_arr |
Fill the ghost regions in an array. More... | |
interface | get_ser_var |
Gather parallel variable in serial version on group master. More... | |
Functions/Subroutines | |
integer function, public | redistribute_var (var, dis_var, lims, lims_dis) |
Redistribute variables according to new limits. More... | |
integer function, public | wait_mpi () |
Wait for all processes, wrapper to MPI barrier. More... | |
integer function, public | lock_req_acc (lock, blocking) |
Request access to lock of a BL (blocking) or optionally a NB (non-blocking) type. More... | |
integer function, public | lock_return_acc (lock) |
Returns access to a lock. More... | |
logical function | wl_empty (wl, proc_type, next_procs) |
Decides whether a waiting list is empty. More... | |
integer function | lock_notify (lock_loc, rec_rank) |
Notifies a rank that they can get the lock. More... | |
integer function | lock_get_notified (lock_loc) |
Get notified that the rank can get the lock. More... | |
integer function, public | lock_wl_change (wl_action, blocking, lock_loc, wl, ranks) |
Adds, removes or sets to active a rank from the waiting list for a lock and returns the lock waiting list: More... | |
character(len=max_str_ln) function, public | lock_header (lock_loc) |
Returns the header for lock debug messages. More... | |
Variables | |
logical, public | debug_lock = .false. |
print debug information about lock operations More... | |
integer, public | n_waits = 0 |
number of waits More... | |
Numerical utilities related to MPI.
This includes a lock system, which can be both BL (blocking) or NB (non-blocking). It is based on the implementation of an MPI-IO atomic mode without file support, described in [13].
The reason for this was the fact that using a simple lock file can lead to crashes.
integer function mpi_utilities::lock_get_notified | ( | type(lock_type), intent(in) | lock_loc | ) |
Get notified that the rank can get the lock.
[in] | lock_loc | lock |
Definition at line 1063 of file MPI_utilities.f90.
character(len=max_str_ln) function, public mpi_utilities::lock_header | ( | type(lock_type), intent(in) | lock_loc | ) |
Returns the header for lock debug messages.
[in] | lock_loc | lock |
Definition at line 1217 of file MPI_utilities.f90.
integer function mpi_utilities::lock_notify | ( | type(lock_type), intent(in) | lock_loc, |
integer, intent(in) | rec_rank | ||
) |
Notifies a rank that they can get the lock.
The signal sent is the rank + 1.
[in] | lock_loc | lock |
[in] | rec_rank | receiving rank |
Definition at line 1031 of file MPI_utilities.f90.
integer function, public mpi_utilities::lock_req_acc | ( | type(lock_type), intent(inout) | lock, |
logical, intent(in), optional | blocking | ||
) |
Request access to lock of a BL (blocking) or optionally a NB (non-blocking) type.
Definition at line 765 of file MPI_utilities.f90.
integer function, public mpi_utilities::lock_return_acc | ( | type(lock_type), intent(inout) | lock | ) |
Returns access to a lock.
The blocking property has been set when requesting the lock.
Definition at line 872 of file MPI_utilities.f90.
integer function, public mpi_utilities::lock_wl_change | ( | integer, intent(in) | wl_action, |
logical, intent(in) | blocking, | ||
type(lock_type), intent(inout) | lock_loc, | ||
integer, dimension(:), intent(inout), allocatable | wl, | ||
integer, dimension(:), intent(in), optional | ranks | ||
) |
Adds, removes or sets to active a rank from the waiting list for a lock and returns the lock waiting list:
Actions:
wl_action
= 0: removewl_action
= 1: addwl_action
= 2: activeOr negative equivalents for non-blocking (NB) procs.
Optionally, the rank(s) of the process for which to perform this action can be passed. This is useful for doing the same action on multiple processes.
[in] | wl_action | action to perform |
[in] | blocking | the ranks to be changed are blocking |
[in,out] | lock_loc | lock |
[in,out] | wl | waiting list |
[in] | ranks | rank(s) for which to perform option |
Definition at line 1111 of file MPI_utilities.f90.
integer function, public mpi_utilities::redistribute_var | ( | real(dp), dimension(:), intent(in) | var, |
real(dp), dimension(:), intent(inout) | dis_var, | ||
integer, dimension(2), intent(in) | lims, | ||
integer, dimension(2), intent(in) | lims_dis | ||
) |
Redistribute variables according to new limits.
[in] | var | parallel vector |
[in,out] | dis_var | redistributed vector |
[in] | lims | indices of parallel vector |
[in] | lims_dis | indices of redistributed parallel vector |
Definition at line 330 of file MPI_utilities.f90.
integer function, public mpi_utilities::wait_mpi |
Wait for all processes, wrapper to MPI barrier.
Definition at line 744 of file MPI_utilities.f90.
logical function mpi_utilities::wl_empty | ( | integer, dimension(:), intent(in) | wl, |
integer, dimension(:), intent(in) | proc_type, | ||
integer, dimension(:), intent(inout), optional, allocatable | next_procs | ||
) |
Decides whether a waiting list is empty.
The type of process to find is indicated by an array of possible values.
Additionally, for NB processes, the negative inverse of these values are used.
If the waiting list is not empty, the next process(es) can optionally be returned.
[in] | wl | waiting list |
[in] | proc_type | types of processes accepted |
[in,out] | next_procs | next process(es) if not empty |
Definition at line 985 of file MPI_utilities.f90.
logical, public mpi_utilities::debug_lock = .false. |
print debug information about lock operations
Definition at line 40 of file MPI_utilities.f90.
integer, public mpi_utilities::n_waits = 0 |