libmuscle.manager.run_dir module

class libmuscle.manager.run_dir.RunDir(run_dir: Path)[source]

Bases: object

Manages a run directory containing files for a simulation run.

The directory is laid out as follows:

<run_dir>/
    input/
    1_<name>.ymmsl
    2_<name>.ymmsl
    muscle_manager.log
    muscle_stats.sqlite
    instances/
        <instance_name[i]>/
            run_script.sh
            <instance_name[i]>.out
            <instance_name[i]>.err
            work_dir/
            snapshots/
    snapshots/
add_instance_dir(name: Reference) Path[source]

Add a directory for this instance to the run dir.

Parameters:

name – Name of the instance

Returns:

The path to the new, empty directory

instance_dir(name: Reference) Path[source]

Return the instance dir of the given instance.

The directory may or may not exist, call add_instance_dir() to make it.

snapshot_dir(name: Reference | None = None) Path[source]

Return the snapshot directory for the workflow or for an instance.

Parameters:

name – Name of the instance. May be None to get the workflow snapshot directory.

Returns:

The path to the snapshot directory