7
7
from pathlib import Path
8
8
from pathlib import PurePath
9
9
import sys
10
+ import os
10
11
import argparse
11
12
import textwrap
12
13
import subprocess
@@ -367,6 +368,15 @@ def create_run_script(args, job, work_dir):
367
368
if memory_estimate < 0 :
368
369
memory_estimate = 0
369
370
371
+ separator = ' '
372
+ command_options_list = job .run_command ()
373
+ '''
374
+ index = command_options_list.index('-name')
375
+ del command_options_list[index]
376
+ del command_options_list[index]
377
+ '''
378
+ command_options = separator .join (command_options_list )
379
+
370
380
human_readable_runtime_est = format_human_readable_time (runtime_estimate )
371
381
human_readable_memory_est = format_human_readable_memory (memory_estimate )
372
382
Path (work_dir ).mkdir (parents = True )
@@ -382,12 +392,14 @@ def create_run_script(args, job, work_dir):
382
392
estimated_memory = memory_estimate ,
383
393
human_readable_time = human_readable_runtime_est ,
384
394
human_readable_memory = human_readable_memory_est ,
385
- script = args . script ,
386
- command = job . run_command () ,
395
+ script = str ( paths . run_vtr_flow_path ) ,
396
+ command = command_options ,
387
397
),
388
398
file = out_file ,
389
399
end = "" ,
390
400
)
401
+
402
+ os .system ('chmod +x ' + str (run_script_file ))
391
403
return str (run_script_file )
392
404
393
405
@@ -397,7 +409,12 @@ def ret_expected_runtime(job, work_dir):
397
409
golden_results = load_parse_results (
398
410
str (Path (work_dir ).parent .parent .parent .parent / "config/golden_results.txt" )
399
411
)
412
+
400
413
metrics = golden_results .metrics (job .arch (), job .circuit (), job .script_params ())
414
+ if metrics == None :
415
+ metrics = golden_results .metrics (job .arch (), job .circuit (), "common" )
416
+ #print(metrics)
417
+
401
418
if "vtr_flow_elapsed_time" in metrics :
402
419
seconds = float (metrics ["vtr_flow_elapsed_time" ])
403
420
return seconds
@@ -410,6 +427,9 @@ def ret_expected_memory(job, work_dir):
410
427
str (Path (work_dir ).parent .parent .parent .parent / "config/golden_results.txt" )
411
428
)
412
429
metrics = golden_results .metrics (job .arch (), job .circuit (), job .script_params ())
430
+ if metrics == None :
431
+ metrics = golden_results .metrics (job .arch (), job .circuit (), "common" )
432
+
413
433
for metric in ["max_odin_mem" , "max_abc_mem" , "max_ace_mem" , "max_vpr_mem" ]:
414
434
if metric in metrics and int (metrics [metric ]) > memory_kib :
415
435
memory_kib = int (metrics [metric ])
0 commit comments