Skip to content

Commit 36c3c7b

Browse files
authored
Merge pull request #2799 from luarss/topic/at-global-args
[Autotuner] Global variable for args
2 parents bd7f280 + d7ff8c6 commit 36c3c7b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

flow/test/test_autotuner.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,3 @@ for expt in $all_experiments; do
3737
--design ${DESIGN_NAME} \
3838
--experiment $expt
3939
done
40-
41-
exit $ret

flow/test/test_helper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if [ "${RUN_AUTOTUNER}" == "true" ]; then
8989
"gcd")
9090
# Keep RUN_AUTOTUNER enabled only for these designs
9191
;;
92-
"*")
92+
*)
9393
echo "Disable AT test for design ${DESIGN_NAME}."
9494
RUN_AUTOTUNER="false"
9595
;;

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
)
7272
# URL to ORFS GitHub repository
7373
ORFS_URL = "https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts"
74+
# Global variable for args
75+
args = None
7476

7577

7678
class AutoTunerBase(tune.Trainable):
@@ -433,36 +435,36 @@ def parse_arguments():
433435
" training stderr\n\t2: also print training stdout.",
434436
)
435437

436-
arguments = parser.parse_args()
437-
if arguments.mode == "tune":
438-
arguments.algorithm = arguments.algorithm.lower()
438+
args = parser.parse_args()
439+
if args.mode == "tune":
440+
args.algorithm = args.algorithm.lower()
439441
# Validation of arguments
440-
if arguments.eval == "ppa-improv" and arguments.reference is None:
442+
if args.eval == "ppa-improv" and args.reference is None:
441443
print(
442444
'[ERROR TUN-0006] The argument "--eval ppa-improv"'
443445
' requires that "--reference <FILE>" is also given.'
444446
)
445447
sys.exit(7)
446448

447449
# Check for experiment name and resume flag.
448-
if arguments.resume and arguments.experiment == "test":
450+
if args.resume and args.experiment == "test":
449451
print(
450452
'[ERROR TUN-0031] The flag "--resume"'
451453
' requires that "--experiment NAME" is also given.'
452454
)
453455
sys.exit(1)
454456

455457
# If the experiment name is the default, add a UUID to the end.
456-
if arguments.experiment == "test":
458+
if args.experiment == "test":
457459
id = str(uuid())[:8]
458-
arguments.experiment = f"{arguments.mode}-{id}"
460+
args.experiment = f"{args.mode}-{id}"
459461
else:
460-
arguments.experiment += f"-{arguments.mode}"
462+
args.experiment += f"-{args.mode}"
461463

462-
if arguments.timeout is not None:
463-
arguments.timeout = round(arguments.timeout * 3600)
464+
if args.timeout is not None:
465+
args.timeout = round(args.timeout * 3600)
464466

465-
return arguments
467+
return args
466468

467469

468470
def set_algorithm(experiment_name, config):

0 commit comments

Comments
 (0)