diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py index 524d637437473197e25c2287e50f69007b44c472..3bb91d280fc4f94c4b8aa3c2f2507d59366aab5e 100644 --- a/binarycpython/utils/grid.py +++ b/binarycpython/utils/grid.py @@ -5011,8 +5011,12 @@ eccentricity3=0 # make the directories: we do not allow these to already exist # as the slurm directory should be a fresh location for each set of jobs for dir in dirs: - pathlib.Path(self.slurmpath(dir)).mkdir(exist_ok=False, - parents=True) + try: + pathlib.Path(self.slurmpath(dir)).mkdir(exist_ok=False, + parents=True) + except: + print("Tried to make the directory {dir} but it already exists. When you launch a set of binary_c jobs on Slurm, you need to set your slurm_dir to be a fresh directory with no contents.") + sys.exit() # check that they have been made and exist: we need this # because on network mounts (NFS) there's often a delay between the mkdir