PB3D
[2.45]
Ideal linear high-n MHD stability in 3-D
|
lock type More...
Public Member Functions | |
procedure | init => init_lock |
initialize More... | |
procedure | dealloc => dealloc_lock |
deallocate More... | |
Public Attributes | |
integer, dimension(:), allocatable | wl |
waiting list More... | |
integer | wl_win |
window to waiting list More... | |
integer | wu_tag |
wakeup tag More... | |
logical | blocking |
is a normal blocking process More... | |
lock type
There is a blocking (BL) and a nonblocking (NB) version where the former requires an exclusive lock and the latter a shared one. This is saved in the variable blocking
.
NB processes that get the lock directly on request (meaning that there were no other processes in the queue) notify directly all the next NB processes after gaining access. It also sets their status to active. When a NB process gains the lock when notified after waiting, it does not have to check for other NB processes, as this has been done by the notifying process.
A BL process retains exclusive access upon receipt of the lock. Similarly to NB processes, if the receipt was direct on request, the status is set to active, but only of this NB process.
When returning the lock, all BL processes and NB that find themselves to be the last active NB process, scan the waiting list and pass the lock preferably to another BL process to notify. If not available, it searches for all the NB processes to notify together.
The advantage of prefering BL processes after finishing a process is that this way NB processes are accumulated, and then quickly finished afterwards.
Scheme:
request access | gain acces | return access | |
---|---|---|---|
BL |
| if direct:
|
|
NB |
| if direct:
| always:
|
with preference BL > NB(s).
RossAtomicIO
. Definition at line 63 of file MPI_vars.f90.
procedure mpi_vars::lock_type::dealloc |
procedure mpi_vars::lock_type::init |
logical mpi_vars::lock_type::blocking |
is a normal blocking process
Definition at line 67 of file MPI_vars.f90.
integer, dimension(:), allocatable mpi_vars::lock_type::wl |
waiting list
Definition at line 64 of file MPI_vars.f90.
integer mpi_vars::lock_type::wl_win |
window to waiting list
Definition at line 65 of file MPI_vars.f90.
integer mpi_vars::lock_type::wu_tag |
wakeup tag
Definition at line 66 of file MPI_vars.f90.