Skip to content

Commit

Permalink
Fix concurrency issue in makedirs(tmpdir); don't use pdfjam at TGCC a…
Browse files Browse the repository at this point in the history
…nd IDRIS

os.makedirs(tmpdir) more robust
  • Loading branch information
senesis committed Aug 8, 2023
1 parent c13225d commit ea4c992
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions env/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ def my_which(soft):
if "TMPDIR" in os.environ and not os.path.isdir(os.environ["TMPDIR"]):
# raise OSError("TMPDIR points to a non existing directory! Change the value of the variable to go on.")
tmpdir = os.environ["TMPDIR"]
if os.path.exists(tmpdir):
if os.path.isfile(tmpdir):
os.remove(tmpdir)
os.makedirs(tmpdir)
# Account for the case where concurrent jobs execute this line almost simultaneously
os.makedirs(tmpdir, exist_OK=True)

# Check dependencies
try:
Expand Down Expand Up @@ -224,7 +225,7 @@ def my_which(soft):
stamping = None
clogger.info("---")

if atCNRM or atIPSL:
if atCNRM or onSpirit or atTGCC or atIDRIS:
pdf_page_builder = os.sep.join([os.path.dirname(
os.path.abspath(__file__)), "..", "scripts", "generate_pdf.py"])
else:
Expand Down

0 comments on commit ea4c992

Please sign in to comment.