0209review: firm risk component + 2way interation on n_max_trial and cap_limit_level
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import datetime
|
||||
import time
|
||||
|
||||
from model import Model
|
||||
|
||||
@@ -21,6 +22,9 @@ class Computation:
|
||||
|
||||
# lock this row by update is_done_flag to 0
|
||||
self.c_db.lock_the_sample(sample_random)
|
||||
|
||||
# Record start time
|
||||
start_time = time.time()
|
||||
print(
|
||||
f"Pid {self.pid} ({str_code}) is running "
|
||||
f"sample {sample_random.id} at {datetime.datetime.now()}")
|
||||
@@ -34,6 +38,14 @@ class Computation:
|
||||
**dct_exp}
|
||||
model = Model(dct_sample_para)
|
||||
results = model.run(display=False)
|
||||
|
||||
# Calculate elapsed time
|
||||
elapsed_time = time.time() - start_time
|
||||
print(
|
||||
f"Pid {self.pid} ({str_code}) completed "
|
||||
f"sample {sample_random.id} in {elapsed_time:.2f} seconds "
|
||||
f"(stopped at t={sample_random.stop_t})")
|
||||
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user