Skip to content
Snippets Groups Projects
Commit cb9ba471 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Include Slurm job ID in temporary YAML filenames

parent a43920b9
1 merge request!781Support for saving metadata fragments & merging into calibration_metadata.yml
......@@ -871,8 +871,9 @@ class CalibrationMetadata(dict):
Avoids a risk of corrupting the main file by writing in parallel.
"""
prefix = f"metadata_frag_j{os.environ.get('SLURM_JOB_ID', '')}_"
with NamedTemporaryFile("w", dir=self._yaml_fn.parent,
prefix='metadata_frag_', suffix='.yml', delete=False) as fd:
prefix=prefix, suffix='.yml', delete=False) as fd:
yaml.safe_dump(data, fd)
def gather_fragments(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment