mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-07 15:43:08 +00:00
save config and code state for reproducibility
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
20487a2c53
commit
fc9338df3f
12
study.py
12
study.py
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import time, sys, random, copy
|
import time, sys, random, copy
|
||||||
import importlib
|
import importlib
|
||||||
|
import subprocess
|
||||||
from joblib import Parallel, delayed
|
from joblib import Parallel, delayed
|
||||||
from DAS import *
|
from DAS import *
|
||||||
|
|
||||||
@ -63,6 +64,17 @@ def study():
|
|||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
execID = now.strftime("%Y-%m-%d_%H-%M-%S_")+str(random.randint(100,999))
|
execID = now.strftime("%Y-%m-%d_%H-%M-%S_")+str(random.randint(100,999))
|
||||||
|
|
||||||
|
# save config and code state for reproducibility
|
||||||
|
if not os.path.exists("results"):
|
||||||
|
os.makedirs("results")
|
||||||
|
if not os.path.exists("results/"+execID):
|
||||||
|
os.makedirs("results/"+execID)
|
||||||
|
with open("results/"+execID+"/git.diff", 'w') as f:
|
||||||
|
subprocess.run(["git", "diff"], stdout=f)
|
||||||
|
with open("results/"+execID+"/git.describe", 'w') as f:
|
||||||
|
subprocess.run(["git", "describe", "--always"], stdout=f)
|
||||||
|
subprocess.run(["cp", sys.argv[1], "results/"+execID+"/"])
|
||||||
|
|
||||||
logger.info("Starting simulations:", extra=format)
|
logger.info("Starting simulations:", extra=format)
|
||||||
start = time.time()
|
start = time.time()
|
||||||
results = Parallel(config.numJobs)(delayed(runOnce)(config, shape ,execID) for shape in config.nextShape())
|
results = Parallel(config.numJobs)(delayed(runOnce)(config, shape ,execID) for shape in config.nextShape())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user