spacr.sweep_child

Run one regression trial in a fresh worker process.

python -m spacr.sweep_child <settings.json> <result.json>

The parent may place this process in a kernel-enforced resource scope. Thread limits are set before NumPy imports so BLAS libraries initialize with one thread per trial. Results and failures are returned through a JSON file, including when no in-memory return value is available.

Functions

main(→ int)

Run one sweep trial in this process and write its result as JSON.

Module Contents

spacr.sweep_child.main(argv=None) → int[source]

Run one sweep trial in this process and write its result as JSON.

Parameters:

argv (sequence of str, optional) – Settings and output JSON paths. Defaults to sys.argv[1:].

Returns:

int – 0 once a result document was written, including when that document reports a failed trial, or 2 when the argument count is invalid.

Raises:
  • OSError – If the settings document cannot be read or the result document cannot be written.

  • json.JSONDecodeError – If the settings document is not valid JSON.