eon.communicator#

Module Contents#

Classes#

Functions#

tryint

alphanum_key

Turn a string into a list of string and number chunks. “z23a” -> [“z”, 23, “a”]

sort_nicely

Sort the given list in the way that humans expect.

get_communicator

Data#

API#

eon.communicator.logger#

‘getLogger(…)’

eon.communicator.tryint(s)[source]#
eon.communicator.alphanum_key(s)[source]#

Turn a string into a list of string and number chunks. “z23a” -> [“z”, 23, “a”]

eon.communicator.sort_nicely(l)[source]#

Sort the given list in the way that humans expect.

eon.communicator.get_communicator()[source]#
exception eon.communicator.NotImplementedError[source]#

Bases: Exception

exception eon.communicator.CommunicatorError[source]#

Bases: Exception

exception eon.communicator.EONClientError[source]#

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)[source]#

Initialization

abstract submit_jobs(data, invariants)[source]#

Throws CommunicatorError if fails.

abstract get_results(results)[source]#

Returns a list of dictionaries containing the results.

abstract get_queue_size()[source]#

Returns the number of items waiting to run in the queue.

abstract cancel_state(statenumber)[source]#

Returns the number of workunits that were canceled.

get_bundle_size(job_path)[source]#
unbundle(resultpath, keep_result)[source]#

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)[source]#

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)[source]#

Bases: eon.communicator.Communicator

Initialization

submit_jobs(data, invariants)[source]#
run_resume_jobs()[source]#
get_ready_ranks()[source]#
get_queue_size()[source]#
get_results(resultspath, keep_result)[source]#
get_number_in_progress()[source]#
cancel_state(state)[source]#
class eon.communicator.Local(scratchpath, client, ncpus, bundle_size)[source]#

Bases: eon.communicator.Communicator

Initialization

cleanup()[source]#

Kills the running eonclients.

get_results(resultspath, keep_result)[source]#

Moves work from scratchpath to results path.

check_job(job)[source]#
submit_jobs(data, invariants)[source]#

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)[source]#
get_queue_size()[source]#
get_number_in_progress()[source]#
class eon.communicator.Script(scratch_path, bundle_size, name_prefix, scripts_path, queued_jobs_cmd, cancel_job_cmd, submit_job_cmd)[source]#

Bases: eon.communicator.Communicator

Initialization

save_jobids()[source]#
get_results(resultspath, keep_result)[source]#

Moves work from scratchpath to results path.

check_command(status, output, cmdname)[source]#
submit_jobs(data, invariants)[source]#
cancel_state(state)[source]#
get_queued_jobs()[source]#
get_number_in_progress()[source]#
get_queue_size()[source]#