diff --git a/src/cal_tools/tools.py b/src/cal_tools/tools.py
index e0eb543da3838af1a09ff985084a93236f726c40..b69502a037a9af5bc254f0a6440f6f463e4b99e6 100644
--- a/src/cal_tools/tools.py
+++ b/src/cal_tools/tools.py
@@ -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):