Manager

class ESMF.Manager(logkind=3, debug=False)

This singleton class and its pair of methods __init__ and __del__ are designed to called ESMP_Initialize and ESMP_Finalize once, and only once, in a Python session.

ESMF is initialized at ESMPyManager object creation, __del__ 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.

__del__()

Calls ESMP_Finalize if ESMF has been initialized. This function is registered with atexit by __init__ when it calls ESMP_Initialize to ensure ESMP_Finalize is always called before exiting Python. However, this function can be called directly (presumably to delete the log file) before exiting without causing problems.

Required Arguments:

None

Optional Arguments:

None

Returns:

None
__init__(logkind=3, debug=False)

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.

Required Arguments:

None

Optional Arguments:

logkind: allows user to specify if there should be a single log file, multiple log files, or none at all. The default is to not have a log file. Argument values are:

LogKind.MULTI

(default) LogKind.NONE

debug: allows user to log after every call, instead of the default of every 10 calls.

type: boolean (defaults to False)

Returns:

Manager
static __new__(logkind=3, debug=False)

Returns the singleton instance of this class, creating it if it does not already exist.

This Page