eon.communicator
#
Module Contents#
Classes#
Functions#
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. |
|
Data#
API#
- eon.communicator.logger#
‘getLogger(…)’
- eon.communicator.tryint(s)#
- eon.communicator.alphanum_key(s)#
Turn a string into a list of string and number chunks. “z23a” -> [“z”, 23, “a”]
- eon.communicator.sort_nicely(l)#
Sort the given list in the way that humans expect.
- eon.communicator.get_communicator(config: eon.config.ConfigClass = EON_CONFIG)#
- exception eon.communicator.EONClientError#
Bases:
Exception
An EON client finished without outputting results, it probably crashed.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- class eon.communicator.Communicator(scratchpath, bundle_size=1, config: eon.config.ConfigClass = EON_CONFIG)#
Initialization
- abstractmethod submit_jobs(data, invariants)#
Throws CommunicatorError if fails.
- abstractmethod get_results(results)#
Returns a list of dictionaries containing the results.
- abstractmethod get_queue_size()#
Returns the number of items waiting to run in the queue.
- abstractmethod cancel_state(statenumber)#
Returns the number of workunits that were canceled.
- get_bundle_size(job_path)#
- unbundle(resultpath, keep_result)#
This method unbundles multiple jobs into multiple single jobs so the akmc script can process them.
If the job did not return results (probably because it crashed or was canceled), this method will raise EONClientError.
- make_bundles(data, invariants)#
This method is a generator that bundles together multiple jobs into a single job. Example usage: for jobpath in self.make_bundles(data, invariants): do_stuff()
- class eon.communicator.MPI(scratchpath, bundle_size, config: eon.config.ConfigClass = EON_CONFIG)#
Bases:
eon.communicator.Communicator
Initialization
- submit_jobs(data, invariants)#
- run_resume_jobs()#
- get_ready_ranks()#
- get_queue_size()#
- get_results(resultspath, keep_result)#
- get_number_in_progress()#
- cancel_state(state)#
- class eon.communicator.Local(scratchpath, client, ncpus, bundle_size, config: eon.config.ConfigClass = EON_CONFIG)#
Bases:
eon.communicator.Communicator
Initialization
- cleanup()#
Kills the running eonclients.
- get_results(resultspath, keep_result)#
Moves work from scratchpath to results path.
- check_job(job)#
- submit_jobs(data, invariants)#
Run up to ncpu number of clients to process the work in jobpaths. The job directories are moved to the scratch path before the calculation is run. This method doesn’t return anything.
- cancel_state(state)#
- get_queue_size()#
- get_number_in_progress()#
- 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 = EON_CONFIG)#
Bases:
eon.communicator.Communicator
Initialization
- save_jobids()#
- get_results(resultspath, keep_result)#
Moves work from scratchpath to results path.
- check_command(status, output, cmdname)#
- submit_jobs(data, invariants)#
- cancel_state(state)#
- get_queued_jobs()#
- get_number_in_progress()#
- get_queue_size()#