ACMEdaemon
- class acme.ACMEdaemon(pmap: ParallelMap, n_workers: Union[int, str] = 'auto', write_worker_results: bool = True, output_dir: Optional[str] = None, result_shape: Optional[tuple[Optional[int], ...]] = None, result_dtype: str = 'float', single_file: bool = False, write_pickle: bool = False, dryrun: bool = False, partition: str = 'auto', mem_per_worker: str = 'auto', setup_timeout: int = 60, setup_interactive: bool = True, stop_client: Union[bool, str] = 'auto', verbose: Optional[bool] = None, logfile: Optional[Union[bool, str]] = None)[source]
Bases:
object
Attributes Summary
Attributes Documentation
- acme_func
- argv
- client
- collect_results
- func
- has_slurm
- kwargv
- n_calls
- n_workers
- out_dir
- result_dtype
- result_shape
- results_container
- stacking_dim
- stop_client
- task_ids
- __init__(pmap: ParallelMap, n_workers: Union[int, str] = 'auto', write_worker_results: bool = True, output_dir: Optional[str] = None, result_shape: Optional[tuple[Optional[int], ...]] = None, result_dtype: str = 'float', single_file: bool = False, write_pickle: bool = False, dryrun: bool = False, partition: str = 'auto', mem_per_worker: str = 'auto', setup_timeout: int = 60, setup_interactive: bool = True, stop_client: Union[bool, str] = 'auto', verbose: Optional[bool] = None, logfile: Optional[Union[bool, str]] = None) None [source]
Manager class for performing concurrent user function calls
- Parameters:
pmap (
ParallelMap
context manager) – By default, :class:~`acme.ACMEDaemon assumes that that the providedParallelMap
instance has already been properly set up to process func (all input arguments parsed and properly formatted). All other input arguments of :class:~`acme.ACMEDaemon are extracted from the providedParallelMap
instance.n_workers (int or "auto") – Number of SLURM workers (=jobs) to spawn. See
ParallelMap
for details.write_worker_results (bool) – If True, the return value(s) of func is/are saved on disk. See
ParallelMap
for details.output_dir (str or None) – If provided, auto-generated results are stored in the given path. See
ParallelMap
for details.result_shape (tuple or None) – If provided, results are slotted into a dataset/array with layout result_shape. See
ParallelMap
for details.result_dtype (str) – Determines numerical datatype of dataset laid out by result_shape. See
ParallelMap
for details.single_file (bool) – If True, parallel workers write to the same results container. See
ParallelMap
for details.write_pickle (bool) – If True, the return value(s) of func is/are pickled to disk. See
ParallelMap
for details.dryrun (bool) – If True, a dry-run of calling func is performed using a single args, kwargs tuple. See
ParallelMap
for details.partition (str) – Name of SLURM partition to use. See
ParallelMap
for details.mem_per_worker (str) – Memory booking for each SLURM worker. See
ParallelMap
for details.setup_timeout (int) – Timeout period (in seconds) for SLURM workers to come online. See
ParallelMap
for details.setup_interactive (bool) – If True, user input is queried in case not enough SLURM workers could be started within setup_timeout seconds. See
ParallelMap
for details.stop_client (bool or "auto") – If “auto”, automatically started distributed computing clients are shut down at the end of computation, while user-provided clients are left untouched. See
ParallelMap
for details.verbose (None or bool) – If None (default), general run-time information as well as warnings and errors are shown. See
ParallelMap
for details.logfile (None or bool or str) – If None (default) or True, and write_worker_results is True, all run-time information as well as errors and warnings are tracked in a log-file. See
ParallelMap
for details.
- Returns:
results – If write_worker_results is True, results is a list of HDF5 file-names containing computed results. If write_worker_results is False, results is a list comprising the actual return values of func. If :class:~`acme.ACMEDaemon was instantiated by
ParallelMap
, results are propagated back toParallelMap
.- Return type:
See also
ParallelMap
Context manager and main user interface