adam.batch_run_manager module

batch_run_manager.py

class adam.batch_run_manager.BatchRunManager(batches_module, batch_runs, do_timing=True, multi_threaded=True)

Bases: object

Class for managing the state and propagation of a set of batch propagations. Responsible for submitting them, tracking and exposing their status during propagation, and retrieving their results.

WARNING: this module is not thread-safe. The only supported simultaneous operation is calling get_latest_statuses() while a call to run() is ongoing.

__init__(batches_module, batch_runs, do_timing=True, multi_threaded=True)

Sets up object that can manage the running and lifetime of the given batches.

Parameters
  • batches_module (Batches) – Object to use to communicate with server.

  • batch_runs (list<Batch2>) – Batches to be run/managed.

  • do_timing (boolean) – If true, timing information will be printed for various parts of batch lifetime (submission, running, results retrieval).

  • multi_threaded (boolean) – If true, operations that would benefit from multithreading such as submission or results retrieval will be multithreaded. Should generally be left true, but can be set to false if a guaranteed particular ordering is necessary (e.g. for tests).

get_batch_runs()

Retrieves the batch runs managed by this object. Not safe to call while any other call is ongoing.

get_latest_statuses()

Retrieves the latest state of all batches managed by this object. Safe to call while a call to update_state(), wait_for_completion() or run() is ongoing.

run()
class adam.batch_run_manager.State(value)

Bases: enum.Enum

An enumeration.

COMPLETED = 3
INITIALIZED = 1
SUBMITTED = 2