eon.communicator¶
Module Contents¶
Classes¶
Functions¶
Job id for slot slot inside a bundle named after the first job. |
|
Turn a string into a list of string and number chunks. “z23a” -> [“z”, 23, “a”] |
|
Sort the given list in the way that humans expect. |
|
Clear non-MPI communicator cache (tests / multi-config isolation). |
|
Return a communicator for config. |
|
Return the filenames listed in return_files.dat, or None if absent. |
|
Harvest one non-bundled job directory into {filename: StringIO}. |
|
Environment for an eonclient the server starts outside an MPI launcher. |
Data¶
API¶
- eon.communicator.logger¶
‘getLogger(…)’
- eon.communicator.bundled_job_name(bundle_dirname, slot)[source]¶
Job id for slot slot inside a bundle named after the first job.
Bundles live in a directory named
{state}_{first_wuid}. Jobs in the chunk are consecutive wuids, so slot n isfirst_wuid + n.
- eon.communicator.alphanum_key(s)[source]¶
Turn a string into a list of string and number chunks. “z23a” -> [“z”, 23, “a”]
- eon.communicator.reset_communicators()[source]¶
Clear non-MPI communicator cache (tests / multi-config isolation).
- eon.communicator.get_communicator(config: eon.config.ConfigClass)[source]¶
Return a communicator for config.
config is required (no process-wide default). Non-MPI communicators are memoized by
id(config). MPI uses a single process-wide instance.
- exception eon.communicator.EONClientError[source]¶
Bases:
ExceptionAn eOn client finished without outputting results, it probably crashed.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- eon.communicator.RETURN_FILES_MANIFEST¶
‘return_files.dat’
- eon.communicator.read_return_files_manifest(jobpath)[source]¶
Return the filenames listed in return_files.dat, or None if absent.
- eon.communicator.harvest_job_files(jobpath)[source]¶
Harvest one non-bundled job directory into {filename: StringIO}.
When return_files.dat is present, only those names (plus results.dat) are kept, any extension. A listed file that was never written is logged and omitted. Without a manifest, keep .con/.dat/.json/.log.
- class eon.communicator.Communicator(scratchpath, bundle_size=1, config: eon.config.ConfigClass = None)[source]¶
Initialization
- queued_search_count()[source]¶
Searches waiting, using the bundle size this communicator was built with.
get_queue_sizecounts bundles. Multiplying by the live configcomm_job_bundle_sizeis wrong if that value changed after construction.
- abstractmethod cancel_state(statenumber)[source]¶
Returns the number of workunits that were canceled.
- class eon.communicator.MPI(scratchpath, bundle_size, config: eon.config.ConfigClass = None)[source]¶
Bases:
eon.communicator.CommunicatorInitialization
- eon.communicator.client_environment(base=None)[source]¶
Environment for an eonclient the server starts outside an MPI launcher.
An eonclient built with MPI (rgpot calculator groups) loads libmpi, and with it UCX, in every run. UCX patches the memory functions as the library loads, which on conda’s OpenMPI costs about 0.4 s per process against 0.02 s for the job itself. A client the Local communicator starts is one process with no MPI peers, so the memory events are of no use to it. An explicit UCX_MEM_EVENTS from the user wins.
- class eon.communicator.Local(scratchpath, client, ncpus, bundle_size, config: eon.config.ConfigClass = None)[source]¶
Bases:
eon.communicator.CommunicatorInitialization
- class eon.communicator.Script(scratch_path, bundle_size, name_prefix, scripts_path, queued_jobs_cmd, cancel_job_cmd, submit_job_cmd, config: eon.config.ConfigClass = None)[source]¶
Bases:
eon.communicator.CommunicatorInitialization
- cancel_state(state)[source]¶
Cancel the jobs still in the queue and drop their directories.
Jobs that already left the queue keep their ids and directories, so the next get_results() harvests them; the explorer’s keep_result filter then decides whether they still count. A cancel that fails (the job finished in between) is logged, not fatal. Returns the number of jobs cancelled.