xyzpy.gen.growing¶
Start and monitor crop batch processes.
Attributes¶
Classes¶
One crop batch to run. |
|
The result of one batch process. |
|
Start and monitor batch processes with resource limits. |
Functions¶
|
Parse resource IDs as integers. |
|
Parse a memory size such as |
|
Format a number of bytes with a unit, such as |
|
Return a process and all its descendants, read from Linux /proc. |
|
Return the total resident memory of some processes, in bytes. |
|
Add the command that selects one CPU core. |
|
Select one GPU for the process. |
Module Contents¶
- xyzpy.gen.growing._THREAD_ENV_VARS = ('OMP_NUM_THREADS', 'MKL_NUM_THREADS', 'OPENBLAS_NUM_THREADS', 'VECLIB_MAXIMUM_THREADS',...¶
- xyzpy.gen.growing._MEMORY_RE¶
- xyzpy.gen.growing._parse_memory(raw)[source]¶
Parse a memory size such as
"100G"or"512mb"as bytes.Units are powers of 1024. A plain number is bytes.
- xyzpy.gen.growing._format_memory(nbytes)[source]¶
Format a number of bytes with a unit, such as
"1.5G".
- xyzpy.gen.growing._process_tree(pid)[source]¶
Return a process and all its descendants, read from Linux /proc.
- xyzpy.gen.growing._memory_usage(pids)[source]¶
Return the total resident memory of some processes, in bytes.
- xyzpy.gen.growing._acquire_affinity(resource_id, args, env)[source]¶
Add the command that selects one CPU core.
- class xyzpy.gen.growing._BatchTask[source]¶
One crop batch to run.
- parent_dir: pathlib.Path¶
- property key¶
- property crop_dir¶
- property batch_file¶
- property result_file¶
- property log_file¶
- class xyzpy.gen.growing._BatchCompletion[source]¶
The result of one batch process.
- task: _BatchTask¶
- log_path: pathlib.Path | None¶
- class xyzpy.gen.growing._ActiveBatch[source]¶
- task: _BatchTask¶
- process: subprocess.Popen¶
- log_path: pathlib.Path | None¶
- class xyzpy.gen.growing._SubprocessRunner(*, num_workers=1, num_threads=1, gpus=None, affinities=None, max_memory=None, log=False, verbosity_grow=0, append_logs=False, raise_errors=True)[source]¶
Start and monitor batch processes with resource limits.
- active¶
- append_logs = False¶
- raise_errors = True¶