Skip to content
Snippets Groups Projects
Commit 7b36e681 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

allow making the joiningfile allow the file to exist if force join is true

parent 6a375925
No related branches found
No related tags found
No related merge requests found
...@@ -94,16 +94,18 @@ class HPC(condor,slurm): ...@@ -94,16 +94,18 @@ class HPC(condor,slurm):
# check for joiningfile again # check for joiningfile again
if self.grid_options['HPC_force_join'] == 1: if self.grid_options['HPC_force_join'] == 1:
print("Forcing join because HPC_force_join is set") print("Forcing join because HPC_force_join is set")
x = True
elif os.path.exists(joiningfile): elif os.path.exists(joiningfile):
if vb: if vb:
print("cannot join: joiningfile exists at {}".format(joiningfile)) print("cannot join: joiningfile exists at {}".format(joiningfile))
return False x = False
elif vb: elif vb:
print("joiningfile does not exist : can join") print("joiningfile does not exist : can join")
x = True
if vb: if vb:
print("returning True from HPC_can_join()") print("returning {} from HPC_can_join()".format(x))
return True return x
def HPCjob(self): def HPCjob(self):
""" """
...@@ -340,7 +342,10 @@ class HPC(condor,slurm): ...@@ -340,7 +342,10 @@ class HPC(condor,slurm):
print("We can join") print("We can join")
try: try:
# touch joiningfile # touch joiningfile
pathlib.Path(joiningfile).touch(exist_ok=False) if grid_options['HPC_force_join'] == 1:
pathlib.Path(joiningfile).touch(exist_ok=True)
else:
pathlib.Path(joiningfile).touch(exist_ok=False)
try: try:
self.HPC_join_from_files(self,joinfiles) self.HPC_join_from_files(self,joinfiles)
except Exception as e: except Exception as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment