Skip to content

Commit

Permalink
Merge branch 'jgfouca/cime/fix_shared_exe_on_anvil' into master (PR #…
Browse files Browse the repository at this point in the history
…3075)

Make create_dirs more robust when multiple threads are running

[BFB]

* jgfouca/cime/fix_shared_exe_on_anvil:
  Make create_dirs more robust when multiple threads are running
  Update CIME to ESMCI cime5.8.6 (#3073)
  • Loading branch information
jgfouca committed Jul 17, 2019
2 parents df282a5 + 48f37bc commit e7b4b4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cime/scripts/lib/CIME/case/preview_namelists.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def create_dirs(self):
logger.debug("Making dir '{}'".format(dir_to_make))
os.makedirs(dir_to_make)
except OSError as e:
expect(False, "Could not make directory '{}', error: {}".format(dir_to_make, e))
# In a multithreaded situation, we may have lost a race to create this dir.
# We do not want to crash if that's the case.
if not os.path.isdir(dir_to_make):
expect(False, "Could not make directory '{}', error: {}".format(dir_to_make, e))

# As a convenience write the location of the case directory in the bld and run directories
for dir_ in (exeroot, rundir):
Expand Down

0 comments on commit e7b4b4a

Please sign in to comment.