Skip to content

Commit e567e6f

Browse files
Made timestamp based file creation
1 parent 30575a0 commit e567e6f

5 files changed

+25
-5
lines changed

run_multiprocess_infer.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import os
33
import time
44
import multiprocess_functions as mpf
5+
from datetime import datetime
6+
d = datetime.now()
7+
timestamp = "inference_%04d%02d%02d%02d%02d" % (d.year, d.month, d.day, d.hour, d.minute)
58

69
from absl import app
710
from absl import flags
@@ -27,7 +30,8 @@ def bash_subprocess(file_path, mem, core_list):
2730
"""Starts a new bash subprocess and puts it on the specified cores."""
2831
out_dir = FLAGS.output_dir
2932
root_params = FLAGS.root_home + "/weights/extracted/"
30-
log_dir = FLAGS.root_home + "/logs/"
33+
log_dir = FLAGS.root_home + "/logs/" + str(timestamp) + "/"
34+
os.makedirs(log_dir, exist_ok=True)
3135
model_names=FLAGS.model_names
3236

3337
command = base_fold_cmd.format(script, file_path, out_dir, model_names, root_params)

run_multiprocess_infer_multimer.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import os
33
import time
44
import multiprocessing_functions as mpf
5+
from datetime import datetime
6+
d = datetime.now()
7+
timestamp = "inference_multimer_%04d%02d%02d%02d%02d" % (d.year, d.month, d.day, d.hour, d.minute)
58

69
from absl import app
710
from absl import flags
@@ -39,7 +42,8 @@ def bash_subprocess(file_path, mem, core_list):
3942
"""Starts a new bash subprocess and puts it on the specified cores."""
4043
out_dir = FLAGS.output_dir
4144
root_params = FLAGS.root_home + "/weights/extracted/"
42-
log_dir = FLAGS.root_home + "/logs/"
45+
log_dir = FLAGS.root_home + "/logs/" + str(timestamp) + "/"
46+
os.makedirs(log_dir, exist_ok=True)
4347
model_names=FLAGS.model_names
4448
random_seed = FLAGS.random_seed
4549
num_multimer_predictions_per_model = FLAGS.num_multimer_predictions_per_model

run_multiprocess_pre.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import os
33
import time
44
import multiprocess_functions as mpf
5+
from datetime import datetime
6+
d = datetime.now()
7+
timestamp = "pre_%04d%02d%02d%02d%02d" % (d.year, d.month, d.day, d.hour, d.minute)
58

69
from absl import app
710
from absl import flags
@@ -42,7 +45,8 @@ def bash_subprocess(file_path, mem, core_list):
4245

4346
data_dir = FLAGS.data_dir
4447
out_dir = FLAGS.output_dir
45-
log_dir = FLAGS.root_home + "/logs/"
48+
log_dir = FLAGS.root_home + "/logs/" + str(timestamp) + "/"
49+
os.makedirs(log_dir, exist_ok=True)
4650
model_name=FLAGS.model_name
4751

4852
n_cpu = str(len(core_list))

run_multiprocess_pre_multimer.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import os
33
import time
44
import multiprocessing_functions as mpf
5+
from datetime import datetime
6+
d = datetime.now()
7+
timestamp = "pre_multimer_%04d%02d%02d%02d%02d" % (d.year, d.month, d.day, d.hour, d.minute)
58

69
from absl import app
710
from absl import flags
@@ -44,7 +47,8 @@ def bash_subprocess(file_path, mem, core_list):
4447

4548
data_dir = FLAGS.data_dir
4649
out_dir = FLAGS.output_dir
47-
log_dir = FLAGS.root_home + "/logs/"
50+
log_dir = FLAGS.root_home + "/logs/" + str(timestamp) + "/"
51+
os.makedirs(log_dir, exist_ok=True)
4852

4953
n_cpu = str(len(core_list))
5054
command = base_fold_cmd.format(script, n_cpu, file_path, out_dir, data_dir, data_dir, data_dir, data_dir, data_dir, data_dir, data_dir, data_dir, data_dir)

run_multiprocess_relax.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import os
33
import time
44
import multiprocess_functions as mpf
5+
from datetime import datetime
6+
d = datetime.now()
7+
timestamp = "relax_%04d%02d%02d%02d%02d" % (d.year, d.month, d.day, d.hour, d.minute)
58

69
from absl import app
710
from absl import flags
@@ -42,7 +45,8 @@ def bash_subprocess(file_path, mem, core_list):
4245
"""Starts a new bash subprocess and puts it on the specified cores."""
4346
out_dir = FLAGS.output_dir
4447
root_params = FLAGS.root_home + "/weights/extracted/"
45-
log_dir = FLAGS.root_home + "/logs/"
48+
log_dir = FLAGS.root_home + "/logs/" + str(timestamp) + "/"
49+
os.makedirs(log_dir, exist_ok=True)
4650
model_names=FLAGS.model_names
4751
random_seed = FLAGS.random_seed
4852
number_multimer_predictions_per_model = FLAGS.num_multimer_predictions_per_model

0 commit comments

Comments
 (0)