diff --git a/core/modes/__init__.py b/core/modes/__init__.py index c5d5589b71304bd6f0125006fb2dc5a32dba92b4..75aa8f2679f569dc3ae790a2653b839b8367c65a 100644 --- a/core/modes/__init__.py +++ b/core/modes/__init__.py @@ -171,7 +171,12 @@ class Slurm(ModeBase): with open(f"{self.job.driver_path}/SlurmIDMapping.json", "r") as file: mapping = json.loads(file.read()) self.slurm_simple_job_id = mapping[get_cenv("CI_JOB_ID")] - return + if self.job.down_scoping: + if not subprocess.run([f'{self.job.driver_path}/core/scripts/runHelper.sh', + f'sudo -u {self.job.account} srun --jobid={self.slurm_simple_job_id} /usr/bin/zsh -l -c echo']).returncode: + return + else: + man.remove_id_mapping(f"{self.job.driver_path}/SlurmIDMapping.json", get_cenv("CI_JOB_ID")) except (IOError, KeyError): self.slurm_simple_job_id = None logging.warning(f'Could not read internal Slurm jobid from mapping file')