ESMF_DELayoutCreateHintWeights Function

private recursive function ESMF_DELayoutCreateHintWeights(keywordEnforcer, deCount, compWeights, commWeights, deGrouping, pinflag, petList, vm, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(in), optional :: deCount
integer, intent(in) :: compWeights(:)
integer, intent(in) :: commWeights(:,:)
integer, intent(in), optional, target :: deGrouping(:)
type(ESMF_Pin_Flag), intent(in), optional :: pinflag
integer, intent(in), optional, target :: petList(:)
type(ESMF_VM), intent(in), optional :: vm
integer, intent(out), optional :: rc

Return Value type(ESMF_DELayout)


Calls

proc~~esmf_delayoutcreatehintweights~~CallsGraph proc~esmf_delayoutcreatehintweights ESMF_DELayoutCreateHintWeights c_esmc_delayoutcreatedefault c_esmc_delayoutcreatedefault proc~esmf_delayoutcreatehintweights->c_esmc_delayoutcreatedefault interface~esmf_interarraycreate ESMF_InterArrayCreate proc~esmf_delayoutcreatehintweights->interface~esmf_interarraycreate proc~esmf_imerr ESMF_IMErr proc~esmf_delayoutcreatehintweights->proc~esmf_imerr proc~esmf_interarraydestroy ESMF_InterArrayDestroy proc~esmf_delayoutcreatehintweights->proc~esmf_interarraydestroy proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_delayoutcreatehintweights->proc~esmf_logfounderror proc~esmf_vmgetinit ESMF_VMGetInit proc~esmf_delayoutcreatehintweights->proc~esmf_vmgetinit proc~esmf_interarraycreateptr ESMF_InterArrayCreatePtr interface~esmf_interarraycreate->proc~esmf_interarraycreateptr proc~esmf_interarraycreatetrg ESMF_InterArrayCreateTrg interface~esmf_interarraycreate->proc~esmf_interarraycreatetrg proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep proc~esmf_logfounddeallocerror ESMF_LogFoundDeallocError proc~esmf_interarraydestroy->proc~esmf_logfounddeallocerror esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite proc~esmf_interarraycreateptr->proc~esmf_logfounderror c_esmc_interarraycreate1d c_esmc_interarraycreate1d proc~esmf_interarraycreateptr->c_esmc_interarraycreate1d c_esmc_interarraycreate1di8 c_esmc_interarraycreate1di8 proc~esmf_interarraycreateptr->c_esmc_interarraycreate1di8 c_esmc_interarraycreate1dr8 c_esmc_interarraycreate1dr8 proc~esmf_interarraycreateptr->c_esmc_interarraycreate1dr8 c_esmc_interarraycreate2d c_esmc_interarraycreate2d proc~esmf_interarraycreateptr->c_esmc_interarraycreate2d c_esmc_interarraycreate2di8 c_esmc_interarraycreate2di8 proc~esmf_interarraycreateptr->c_esmc_interarraycreate2di8 c_esmc_interarraycreate2dr8 c_esmc_interarraycreate2dr8 proc~esmf_interarraycreateptr->c_esmc_interarraycreate2dr8 c_esmc_interarraycreate3d c_esmc_interarraycreate3d proc~esmf_interarraycreateptr->c_esmc_interarraycreate3d c_esmc_interarraycreate3di8 c_esmc_interarraycreate3di8 proc~esmf_interarraycreateptr->c_esmc_interarraycreate3di8 c_esmc_interarraycreate3dr8 c_esmc_interarraycreate3dr8 proc~esmf_interarraycreateptr->c_esmc_interarraycreate3dr8 c_esmc_interarraysetinvalid c_esmc_interarraysetinvalid proc~esmf_interarraycreateptr->c_esmc_interarraysetinvalid proc~esmf_logseterror ESMF_LogSetError proc~esmf_interarraycreateptr->proc~esmf_logseterror proc~esmf_interarraycreatetrg->interface~esmf_interarraycreate proc~esmf_interarraycreatetrg->proc~esmf_logfounderror proc~esmf_interarraycreatetrg->c_esmc_interarraysetinvalid proc~esmf_logfounddeallocerror->esmf_breakpoint proc~esmf_logfounddeallocerror->proc~esmf_logrc2msg proc~esmf_logfounddeallocerror->proc~esmf_logwrite c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array

Called by

proc~~esmf_delayoutcreatehintweights~~CalledByGraph proc~esmf_delayoutcreatehintweights ESMF_DELayoutCreateHintWeights interface~esmf_delayoutcreate ESMF_DELayoutCreate interface~esmf_delayoutcreate->proc~esmf_delayoutcreatehintweights proc~createfields createFields proc~createfields->interface~esmf_delayoutcreate proc~esmf_distgridcreatedbai1d ESMF_DistGridCreateDBAI1D proc~esmf_distgridcreatedbai1d->interface~esmf_delayoutcreate proc~esmf_gridcreatecopyfromreg ESMF_GridCreateCopyFromReg proc~esmf_gridcreatecopyfromreg->interface~esmf_delayoutcreate proc~esmf_gridcreatecubedsphereireg ESMF_GridCreateCubedSphereIReg proc~esmf_gridcreatecubedsphereireg->interface~esmf_delayoutcreate proc~esmf_gridcreatecubedspherereg ESMF_GridCreateCubedSphereReg proc~esmf_gridcreatecubedspherereg->interface~esmf_delayoutcreate proc~esmf_gridcreatedistgridirreg ESMF_GridCreateDistgridIrreg proc~esmf_gridcreatedistgridirreg->interface~esmf_delayoutcreate proc~esmf_gridcreatedistgridreg ESMF_GridCreateDistgridReg proc~esmf_gridcreatedistgridreg->interface~esmf_delayoutcreate proc~esmf_gridcreatemosaicireg ESMF_GridCreateMosaicIReg proc~esmf_gridcreatemosaicireg->interface~esmf_delayoutcreate proc~esmf_gridcreatemosaicreg ESMF_GridCreateMosaicReg proc~esmf_gridcreatemosaicreg->interface~esmf_delayoutcreate proc~esmf_gridcreateshapetileirreg ESMF_GridCreateShapeTileIrreg proc~esmf_gridcreateshapetileirreg->interface~esmf_delayoutcreate proc~esmf_gridcreateshapetilereg ESMF_GridCreateShapeTileReg proc~esmf_gridcreateshapetilereg->interface~esmf_delayoutcreate proc~esmf_gridsetcmmitshapetileirreg ESMF_GridSetCmmitShapeTileIrreg proc~esmf_gridsetcmmitshapetileirreg->interface~esmf_delayoutcreate proc~esmf_gridsetcmmitshapetilereg ESMF_GridSetCmmitShapeTileReg proc~esmf_gridsetcmmitshapetilereg->interface~esmf_delayoutcreate proc~mygcomp_run~3 mygcomp_run proc~mygcomp_run~3->interface~esmf_delayoutcreate proc~test_smm test_smm proc~test_smm->interface~esmf_delayoutcreate proc~user2_run~2 user2_run proc~user2_run~2->interface~esmf_delayoutcreate proc~user_init~29 user_init proc~user_init~29->interface~esmf_delayoutcreate proc~user_init~43 user_init proc~user_init~43->interface~esmf_delayoutcreate proc~user_init~56 user_init proc~user_init~56->interface~esmf_delayoutcreate program~esmf_arraycreategetutest ESMF_ArrayCreateGetUTest program~esmf_arraycreategetutest->interface~esmf_delayoutcreate program~esmf_arrayex ESMF_ArrayEx program~esmf_arrayex->interface~esmf_delayoutcreate program~esmf_arrayhaloutest ESMF_ArrayHaloUTest program~esmf_arrayhaloutest->interface~esmf_delayoutcreate program~esmf_delayoutex ESMF_DELayoutEx program~esmf_delayoutex->interface~esmf_delayoutcreate program~esmf_delayoututest ESMF_DELayoutUTest program~esmf_delayoututest->interface~esmf_delayoutcreate program~esmf_distgridcreategetutest ESMF_DistGridCreateGetUTest program~esmf_distgridcreategetutest->interface~esmf_delayoutcreate program~esmf_distgridex ESMF_DistGridEx program~esmf_distgridex->interface~esmf_delayoutcreate program~esmf_regridex ESMF_RegridEx program~esmf_regridex->interface~esmf_delayoutcreate program~esmf_rhandlevmepochex ESMF_RHandleVMEpochEx program~esmf_rhandlevmepochex->interface~esmf_delayoutcreate

Source Code

  recursive function ESMF_DELayoutCreateHintWeights(keywordEnforcer, deCount, &
    compWeights, commWeights, deGrouping, pinflag, petList, vm, rc)
!         
! !RETURN VALUE:
    type(ESMF_DELayout) :: ESMF_DELayoutCreateHintWeights
!
! !ARGUMENTS:
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    integer,                      intent(in),  optional :: deCount
    integer,                      intent(in)            :: compWeights(:)
    integer,                      intent(in)            :: commWeights(:,:)
    integer, target,              intent(in),  optional :: deGrouping(:)
    type(ESMF_Pin_Flag),          intent(in),  optional :: pinflag
    integer, target,              intent(in),  optional :: petList(:)
    type(ESMF_VM),                intent(in),  optional :: vm
    integer,                      intent(out), optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
!     Create an {\tt ESMF\_DELayout} on the basis of computational and 
!     communication weights. In addition this call provides control over the 
!     number of DEs, DE domains, DE pinning and the PETs to 
!     map against.
!
!     The arguments are:
!     \begin{description}
!     \item[{[deCount]}]
!          Number of DEs to be provided by the created DELayout. By default
!          the number of DEs equals the number of PETs in the associated VM
!          context. Specifying a {\tt deCount} smaller than the number
!          of PETs will result in unassociated PETs.
!          This may be used to share VM resources between DELayouts within the
!          same ESMF component. Specifying a {\tt deCount} greater than the 
!          number of PETs will result in multiple DE to PET mapping.
!     \item[compWeights]
!          This argument provides the computational weight hint. The 
!          {\tt compWeights} list must contain at least {\tt deCount} elements
!          and specifies a relative measure of the computational weight for each
!          DE in form of an integer number. The weights are a relative measure
!          and only meaningful when compared to weights of the same DELayout.
!          (UNIMPLEMENTED!)
!     \item[commWeights]
!          This argument provides the communication weight hint.
!          {\tt commWeights} is a 2D array and must contain at least 
!          {\tt deCount} elements in each dimension. The element indices 
!          correspond to the DEs of the DELayout and each element specifies a
!          relative communication weight for a DE pair. The {\tt commWeight} 
!          matrix must be symmetric and diagonal elements are ignored. The 
!          weights are a relative measure and only meaningful when compared to 
!          weights of the same DELayout.
!          (UNIMPLEMENTED!)
!     \item[{[pinflag]}]
!          This flag specifies which type of resource DEs are pinned to. 
!          The default is to pin DEs to PETs. Alternatively it is
!          also possible to pin DEs to VASs. See section 
!          \ref{const:pin_flag} for a list of valid pinning options.
!     \item[{[petList]}]
!          List specifying PETs to be used by this DELayout. This can be used
!          to control the PET overlap between DELayouts within the same
!          ESMF component. It is erroneous to specify PETs that are not within 
!          the provided VM context. The default is to include all the PETs of
!          the VM.
!     \item[{[vm]}]
!          Optional {\tt ESMF\_VM} object of the current context. Providing the
!          VM of the current context will lower the method's overhead.
!     \item[{[rc]}]
!          Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOPI
!------------------------------------------------------------------------------
    integer               :: localrc      ! local return code
    type(ESMF_DELayout)   :: delayout     ! opaque pointer to new C++ DELayout  
    type(ESMF_InterArray) :: deGroupingArg
    type(ESMF_InterArray) :: petListArg

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

    ! Mark this DELayout as invalid
    delayout%this = ESMF_NULL_POINTER
    ESMF_DELayoutCreateHintWeights = delayout 
    
    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP(ESMF_VMGetInit, vm, rc)
    
    ! Deal with optional array arguments
    deGroupingArg = ESMF_InterArrayCreate(deGrouping, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
    petListArg = ESMF_InterArrayCreate(petList, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
    
    !DUMMY TEST TO QUIET DOWN COMPILER WARNINGS
    !TODO: Remove the following dummy test when dummy argument actually used
    if (size(compWeights) == size(compWeights)) continue

    !DUMMY TEST TO QUIET DOWN COMPILER WARNINGS
    !TODO: Remove the following dummy test when dummy argument actually used
    if (size(commWeights) == size(commWeights)) continue

  !TODO: use the correct C++ implementation once it is available

    ! Call into the C++ interface, which will sort out optional arguments
    call c_ESMC_DELayoutCreateDefault(delayout, deCount, deGroupingArg, &
      pinflag, petListArg, vm, localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
    
    ! Set return value
    ESMF_DELayoutCreateHintWeights = delayout 
 
    ! Garbage collection
    call ESMF_InterArrayDestroy(deGroupingArg, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
    call ESMF_InterArrayDestroy(petListArg, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
 
    ! Set init code
    ESMF_INIT_SET_CREATED(ESMF_DELayoutCreateHintWeights)
 
    ! return successfully
    if (present(rc)) rc = ESMF_SUCCESS
 
  end function ESMF_DELayoutCreateHintWeights