grid

class anadama2.grid.grid.Grid(name, worker, queue, tmpdir, benchmark_on=None)[source]

Base Grid Workflow manager class

add_task(task, **kwargs)[source]

Accepts the following extra arguments:

Parameters:
  • time (int) – The maximum time in minutes allotted to run the command
  • mem (int) – The maximum memory in megabytes allocated to run the command
  • cores (int) – The number of CPU cores allocated to the job
  • partition (str) – The grid partition to send this job to
do(task, **kwargs)[source]

Accepts the following extra arguments:

Parameters:
  • time (int) – The maximum time in minutes allotted to run the command
  • mem (int) – The maximum memory in megabytes allocated to run the command
  • cores (int) – The number of CPU cores allocated to the job
  • partition (str) – The grid partition to send this job to
class anadama2.grid.grid.GridJobRequires(time, mem, cores, partition, depends=None)[source]

Defines the resources required for a task on the grid.

Parameters:
  • time (int) – Wall clock time in minutes.
  • mem (int) – RAM Usage in MB (8*1024*1024 bits).
  • cores (int) – CPU cores.
  • partition (string) – grid partition.
class anadama2.grid.grid.GridWorker(work_q, result_q, lock, reporter)[source]

Base Grid Worker class

static evaluate_resource_requests(time, mem)[source]

Evaluate the time/memory requests for the grid job, allowing for ints or formulas

static get_return_code(file)[source]

Read the return code from the file

static log_grid_output(taskid, file, file_type)[source]

Write the grid stdout/stderr files to the log

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.