From 6236008ae9a2aff4bdd191ef864b7641ada0f3db Mon Sep 17 00:00:00 2001 From: Robert Izzard <r.izzard@surrey.ac.uk> Date: Mon, 21 Feb 2022 10:04:00 +0000 Subject: [PATCH] add check to make the arg logging directory --- binarycpython/utils/grid.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py index 5bd145e4c..f685d4b85 100644 --- a/binarycpython/utils/grid.py +++ b/binarycpython/utils/grid.py @@ -820,7 +820,6 @@ class Population( # Make sure the subdirs of the tmp dir exist subdirs = [ "failed_systems", - "current_system", "process_summary", "runtime_systems", "snapshots", @@ -836,6 +835,20 @@ class Population( ) self.exit(code=1) + # make sure the arg logging directory exists if we need it + if self.grid_options["log_args"]: + path = os.path.join( + self.grid_options["log_args_dir"] + ) + os.makedirs(path, exist_ok=True) + if self.dir_ok(path) is False: + print( + "Failed to make directory at {log_args_dir} for output of system arguments. Please check that this directory is correct and you have write access.".format( + subdir=subdir, path=path + ) + ) + self.exit(code=1) + # restore from existing HPC files self.HPC_restore() @@ -1620,7 +1633,6 @@ class Population( if self.grid_options["log_args"]: argfile = os.path.join( self.grid_options["log_args_dir"], - "current_system", "process_{}.txt".format(self.jobID()), ) with self.open( -- GitLab