Execution of a callable

class pylada.process.call.CallProcess(functional, outdir, stdout=None, stderr=None, maxtrials=1, dompi=False, **kwargs)[source]

Bases: pylada.process.process.Process

Calls functional in child python process.

This process pickles a callable and its arguments and executes it in a child python process.

__init__(functional, outdir, stdout=None, stderr=None, maxtrials=1, dompi=False, **kwargs)[source]

Initializes a process.

Parameters:
  • functional – A python callable. It should also be pickle-able.
  • outdir (str) – Path where the python child process should be executed.
  • stdout (str) – Optional path to an output file where the callable’s output shall be streamed.
  • stderr (str) – Optional path to an error file where the callable’s errors shall be streamed.
  • dompi (bool) – Whether the python child process shouold be launched as an MPI process.
  • maxtrials (int) – Maximum number of times to try re-launching each process upon failure.
  • kwargs – Keyword arguments to the callables should be given here, as keyword arguments to CallProcess.
_cleanup()[source]

Removes temporary script.

dompi = None

Whether to run with mpi or not.

functional = None

Functional to execute.

outdir = None

Directory where to run job.

params = None

Extra parameters to pass on to iterator.

poll()[source]

Polls current job.

start(comm)[source]

Starts current job.

stderr = None

Name of standard error file, if any.

stdout = None

Name of standard output file, if any.

wait()[source]

Waits for process to end, then cleanup.

Previous topic

Sequential execution of a generator of processes

Next topic

Parallel execution of a job-folder

This Page