ogstools.core.execution module#
- class ogstools.core.execution.Execution[source]#
Bases:
StorageBaseConfiguration for OGS simulation execution parameters.
This class encapsulates all settings related to how an OGS simulation is executed, including parallelization, containerization, and logging options.
Initialize an Execution configuration.
- Parameters:
interactive (
bool) – If True, use interactive mode for stepwise control.args (
Any|None) – Additional command-line arguments for OGS.container_path (
Path|str|None) – Path to a container (e.g., Docker, Apptainer).wrapper (
Any|None) – Custom wrapper command for execution.mpi_ranks (
int|None) – Number of MPI ranks for parallel execution.ogs_bin_path (
Path|str) – Path to the OGS binary. Defaults to “ogs”.omp_num_threads (
int|None) – Number of OpenMP threads per MPI rank.ogs_asm_threads (
int|None) – Number of assembly threads for OGS.write_logs (
bool) – If True, write log output to file.log_level (
str) – Logging level (e.g., “info”, “debug”, “warn”).id (
str|None) – Optional unique identifier for this execution config.
- __init__(interactive=False, args=None, container_path=None, wrapper=None, mpi_ranks=None, ogs_bin_path=Path('ogs'), omp_num_threads=None, ogs_asm_threads=None, write_logs=True, log_level='info', id=None)[source]#
Initialize an Execution configuration.
- Parameters:
interactive (
bool) – If True, use interactive mode for stepwise control.args (
Any|None) – Additional command-line arguments for OGS.container_path (
Path|str|None) – Path to a container (e.g., Docker, Apptainer).wrapper (
Any|None) – Custom wrapper command for execution.mpi_ranks (
int|None) – Number of MPI ranks for parallel execution.ogs_bin_path (
Path|str) – Path to the OGS binary. Defaults to “ogs”.omp_num_threads (
int|None) – Number of OpenMP threads per MPI rank.ogs_asm_threads (
int|None) – Number of assembly threads for OGS.write_logs (
bool) – If True, write log output to file.log_level (
str) – Logging level (e.g., “info”, “debug”, “warn”).id (
str|None) – Optional unique identifier for this execution config.
- classmethod from_file(filepath)[source]#
Restore an Execution object from an execution.yaml file.
- Parameters:
- Return type:
Self- Returns:
Restored Execution instance.
- Raises:
FileNotFoundError – If the specified file does not exist.