Manager

class esmpy.api.esmpymanager.Manager(debug=False, endFlag=<EndAction.NORMAL: 1>)

This singleton class is designed to ensure that ESMF is properly initialized and finalized. ESMF is initialized at Manager creation, and the __del__ method is registered with atexit to ensure ESMF is always finalized prior to exiting Python. If the object is copied, the copy will always be an alias to the original Manager object. The Manager will be created when the first ESMPy object is created if it is not created explicitly by the user.

Explicit creation of a Manager object allows for setting a flag which results in the output of debug information from the ESMF logging capability during the application runtime. The output log files are named PET<PET number>.ESMF_LogFile.

The PET rank (local_pet) and total number of PETs (pet_count) can also be retrieved from the Manager using the following calls:

esmpy.local_pet()
esmpy.pet_count()

local_pet and pet_count are also properties of the Manager.

Calls ESMP_Initialize and registers __del__ with atexit when called the first time. Subsequent calls only return whether or not ESMF is initialized. Registering __del__ with atexit ensures the ESMP_Finalize will always be called prior to exiting Python. Calling __init__ explicitly results in a no-op.

The Manager can be used to enable the MOAB mesh backend to the Mesh. This is done by calling set_moab() with moab_on=True.

The Manager has a test_exhaustive member variable that can be enabled to run combinatorial expansions of Grid and Field creation parameters.

Parameters:
  • debug (bool) – outputs logging information to ESMF logfiles. If None, defaults to False.

  • endFlag (bool) – determines the action to take on ESMF finalization. See EndAction docstring for details. Defaults to EndAction.NORMAL.

property local_pet
Return type:

int

Returns:

The id of the current Persistent Execution Thread (PET i.e. processing core).

property moab
Return type:

bool

Returns:

A boolean value to indicate if the MOAB mesh backend is in use.

property pet_count
Return type:

int

Returns:

The number of Persistent Execution Threads (PETs i.e. processing cores) available in this execution.

barrier()

Collective VM communication call that blocks calling PET until all PETs of the VM have issued the call.

set_moab(moab_on=True)

Set the Mesh backend to use MOAB or the Native ESMF mesh.