Skip to content

Commit

Permalink
add random delay to run_optim
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew McRae committed Nov 1, 2019
1 parent d6dc5e9 commit 904e4ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions verification/tutorial_global_oce_optim/run_optim.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import os
import shutil
import random
import time

mypid = os.getpid()
childdir = "/dev/shm/mitgcm-" + str(mypid) + "/"
print("OAD checkpoints being saved in", childdir)
os.mkdir(childdir)

randdelay = random.randrange(10, 120)
print("Sleeping for", randdelay, "seconds...")
time.sleep(randdelay)

for ii in range(15):
lines = open("data.optim").read().splitlines()
lines[5] = " optimcycle=" + str(ii) + ","
Expand Down

0 comments on commit 904e4ae

Please sign in to comment.