From bbdd73f970c0c6a573edd001d96aa42005ca9b70 Mon Sep 17 00:00:00 2001 From: Daniel Pozsar Date: Tue, 12 Nov 2024 16:15:06 +0100 Subject: [PATCH] added slurm job id print --- src/grogupy/io.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/grogupy/io.py b/src/grogupy/io.py index 11ff50c..8448396 100644 --- a/src/grogupy/io.py +++ b/src/grogupy/io.py @@ -21,6 +21,7 @@ """Docstring in io. """ +from os import environ from pickle import dump, load from typing import Final @@ -251,6 +252,10 @@ def print_job_description(simulation_parameters: dict) -> None: print( "================================================================================================================================================================" ) + try: + print(f"SLURM job ID: {environ["SLURM_JOB_ID"]}") + except: + print("SLURM job ID not found.") print("Input file: ") print(simulation_parameters["infile"]) print("Output file: ") @@ -308,6 +313,10 @@ def print_parameters(simulation_parameters: dict) -> None: print( "================================================================================================================================================================" ) + try: + print(f"SLURM job ID: {environ["SLURM_JOB_ID"]}") + except: + print("SLURM job ID not found.") print("Input file: ") print(simulation_parameters["infile"]) print("Output file: ")