YOMOML Module

use omp_lib

*SS/18-Feb-2005 --Dr.Hook references removed, because these locks may also be called from within drhook.c itself !! --Also, there could be considerable & unjustified overhead when using Dr.Hook in such a low level

SS/15-Dec-2005 --The size of lock-variables are now OMP_LOCK_KIND as of in OMP_LIB, and OMP_LOCK_KIND is aliased to OML_LOCK_KIND OMP_LOCK_KIND is usually 4 in 32-bit addressing mode 8 in 64-bit addressing mode --M_OML_LOCK changed to M_EVENT and kept as 32-bit int --OML_FUNCT changed to OML_TEST_EVENT --M_LOCK initialized to -1 --M_EVENT initialized to 0 --Added intent(s) --Support for omp_lib (but not always available) --Locks can now also be set/unset OUTSIDE the parallel regions --Added routine OML_TEST_LOCK (attempts to set lock, but if un*successful, does NOT block) --Buffer-zone for M_LOCK; now a vector of 2 elements in case problems/inconsistencies with OMP_LOCK_KIND 4/8

*SS/22-Feb-2006 --Locking routines are doing nothing unless OMP_GET_MAX_THREADS() > 1 This is to avoid unacceptable deadlocks/timeouts with signal handlers when the only thread receives signal while inside locked region --Affected routines: OML_TEST_LOCK() --> always receives .TRUE. OML_SET_LOCK() --> sets nothing OML_UNSET_LOCK() --> unsets nothing OML_INIT_LOCK() --> inits nothing

*SS/11-Sep-2006 --Added OML_DEBUG feature

INTEGER(KIND=JPIM), PARAMETER :: OML_LOCK_KIND = OMP_LOCK_KIND


Uses

  • module~~yomoml~~UsesGraph module~yomoml YOMOML module~parkind1~2 PARKIND1 module~yomoml->module~parkind1~2

Used by

  • module~~yomoml~~UsedByGraph module~yomoml YOMOML proc~gstats GSTATS proc~gstats->module~yomoml proc~gstats~2 GSTATS proc~gstats~2->module~yomoml module~sdl_module~2 SDL_MODULE module~sdl_module~2->module~yomoml module~sdl_module SDL_MODULE module~sdl_module->module~yomoml proc~abort_trans ABORT_TRANS proc~abort_trans->module~sdl_module~2 proc~abort_trans~2 ABORT_TRANS proc~abort_trans~2->module~sdl_module~2

Contents


Variables

Type Visibility Attributes Name Initial
logical, public :: OML_DEBUG = .FALSE.
integer(kind=JPIM), public, parameter :: OML_LOCK_KIND = JPIB

Functions

public function OML_OMP()

Arguments

None

Return Value logical

public function OML_IN_PARALLEL()

Arguments

None

Return Value logical

public function OML_TEST_LOCK(MYLOCK)

Arguments

Type IntentOptional Attributes Name
integer(kind=OML_LOCK_KIND), intent(inout), optional :: MYLOCK

Return Value logical

public function OML_TEST_EVENT(K, MYEVENT)

Arguments

Type IntentOptional Attributes Name
integer(kind=JPIM), intent(in) :: K
integer(kind=JPIM), intent(in) :: MYEVENT

Return Value logical

public function OML_MY_THREAD()

Arguments

None

Return Value integer(kind=JPIM)

public function OML_MAX_THREADS()

Arguments

None

Return Value integer(kind=JPIM)


Subroutines

public subroutine OML_UNSET_LOCK(MYLOCK)

Arguments

Type IntentOptional Attributes Name
integer(kind=OML_LOCK_KIND), intent(inout), optional :: MYLOCK

public subroutine OML_SET_LOCK(MYLOCK)

Arguments

Type IntentOptional Attributes Name
integer(kind=OML_LOCK_KIND), intent(inout), optional :: MYLOCK

public subroutine OML_INIT_LOCK(MYLOCK)

Arguments

Type IntentOptional Attributes Name
integer(kind=OML_LOCK_KIND), intent(inout), optional :: MYLOCK

public subroutine OML_DESTROY_LOCK(MYLOCK)

Arguments

Type IntentOptional Attributes Name
integer(kind=OML_LOCK_KIND), intent(inout), optional :: MYLOCK

public subroutine OML_WAIT_EVENT(K, MYEVENT)

Arguments

Type IntentOptional Attributes Name
integer(kind=JPIM), intent(in) :: K
integer(kind=JPIM), intent(in), optional :: MYEVENT

public subroutine OML_SET_EVENT(K, MYEVENT)

Arguments

Type IntentOptional Attributes Name
integer(kind=JPIM), intent(in) :: K
integer(kind=JPIM), intent(out), optional :: MYEVENT

public subroutine OML_INCR_EVENT(K, MYEVENT)

Arguments

Type IntentOptional Attributes Name
integer(kind=JPIM) :: K
integer(kind=JPIM), intent(inout), optional :: MYEVENT