@@ -29,6 +29,8 @@ def __init__(self, args, append_log_file=False):
2929 if not output_dir_parent .exists ():
3030 output_dir_parent .mkdir ()
3131
32+ self .args = args
33+
3234 mode = 'o3'
3335 if args .in_order :
3436 mode = 'inorder'
@@ -99,7 +101,6 @@ def __init__(self, args, append_log_file=False):
99101 output_dir = output_dir_parent / '{}_{}_{}' .format (
100102 args .bench , mode , str (chkpt .name ))
101103 arg_list = [
102- './Experiment.py' ,
103104 '--bench' , args .bench ,
104105 '--suite' , args .suite ,
105106 '--warmup-insts' , str (args .warmup_insts ),
@@ -148,17 +149,16 @@ def __del__(self):
148149 json .dump (self .summary , f , indent = 4 )
149150
150151 @staticmethod
151- def _run_process (experiment_args , log_file ):
152+ def _run_process (experiment_args , log_file , config ):
152153 '''
153154 Essentially, we want to just run the experiment stuff again.
154155 So, we pretend like we're running this from scratch.
155156
156157 This is already a separate process.
157158 '''
158159 parser = ArgumentParser ()
159- LapidaryConfig .add_config_arguments (parser )
160160 Experiment .add_experiment_args (parser )
161- args = parser .parse_args (args = experiment_args [ 1 :] )
161+ args = parser .parse_args (args = experiment_args )
162162
163163 prefix = 'lapidary_parallel_simulate'
164164 with TemporaryFile (mode = 'w+' , prefix = prefix ) as out , \
@@ -167,7 +167,7 @@ def _run_process(experiment_args, log_file):
167167
168168 sys .stdout = out
169169 sys .stderr = err
170- Experiment .do_experiment (args )
170+ Experiment .do_experiment (args , config = config )
171171 out .seek (0 )
172172 err .seek (0 )
173173
@@ -227,7 +227,7 @@ def do_visual_update(self):
227227 remaining_checkpoints = len (self .all_proc_args )
228228
229229 for chkpt , experiment_args in proc_args .items ():
230- fn_args = (experiment_args , self .log_file )
230+ fn_args = (experiment_args , self .log_file , self . args . config )
231231 task = pool .apply_async (ParallelSim ._run_process , fn_args )
232232
233233 tasks [task ] = time ()
@@ -320,8 +320,11 @@ def add_args(parser):
320320 help = 'Locations of all the checkpoints' )
321321 parser .add_argument ('--pool-size' , '-p' , default = cpu_count (),
322322 help = 'Number of threads to use' )
323- parser .add_argument ('--log-file' , '-l' , default = 'log.txt' ,
324- help = 'Where to log stdout/stderr from experiment runs.' )
323+ parser .add_argument ('--log-file' , '-l' ,
324+ default = 'parallel_simulation_log_{}.txt' .format (
325+ datetime .now ().isoformat (sep = '_' , timespec = 'seconds' )),
326+ help = ('Where to log stdout/stderr from experiment runs. '
327+ 'Defaults to parallel_simulation_log_<time>.txt' ))
325328 parser .add_argument ('--num-checkpoints' , '-n' , default = None , type = int ,
326329 help = 'Number of checkpoints to simulate. If None, then all.' )
327330 parser .add_argument ('--all-configs' , action = 'store_true' ,
0 commit comments