ESMF_VMSet Subroutine

public subroutine ESMF_VMSet(globalResourceControl, rc)

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: globalResourceControl
integer, intent(out), optional :: rc

Source Code

  subroutine ESMF_VMSet(globalResourceControl, rc)
!
! !ARGUMENTS:
    logical, intent(in),  optional :: globalResourceControl
    integer, intent(out), optional :: rc
!
! !DESCRIPTION:
!   Set properties of the Global VM.
!
!   The arguments are:
!   \begin{description}
!     \item [{[globalResourceControl]}]
!        For {\tt .true.}, each global PET is pinned to the corresponding
!        PE (i.e. CPU core) in order. If OpenMP support is enabled,
!        {\tt OMP\_NUM\_THREADS} is set to {\tt 1} on every PET, regardless
!        of the setting in the launching environment. The {\tt .true.}
!        setting is recommended for applications that utilize the ESMF-aware
!        threading and resource control features.
!        For {\tt .false.}, global PETs are {\em not} pinned by ESMF, and
!        {\tt OMP\_NUM\_THREADS} is {\em not} modified.
!        The default setting is {\tt .false.}.
!   \item[{[rc]}] 
!        Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOPI
!------------------------------------------------------------------------------
    integer                 :: localrc      ! local return code
    type(ESMF_Logical)      :: globalResourceControl_opt  ! helper variable

    ! deal with logical argument
    globalResourceControl_opt = ESMF_FALSE ! default
    if (present(globalResourceControl)) &
      globalResourceControl_opt = globalResourceControl

    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    ! Call into the C++ interface.
    call c_ESMC_VMSet(globalResourceControl_opt, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! return successfully
    if (present(rc)) rc = ESMF_SUCCESS

  end subroutine ESMF_VMSet