Skip to content

Commit 0b536c2

Browse files
authored
Merge pull request The-OpenROAD-Project#3431 from The-OpenROAD-Project-staging/at-mem-limit
at: add arg to set memory limit
2 parents 5f21dfe + d0e0f6d commit 0b536c2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,13 @@ def parse_arguments():
396396
default=16,
397397
help="Max number of threads openroad can use.",
398398
)
399+
parser.add_argument(
400+
"--memory_limit",
401+
type=float,
402+
metavar="<float>",
403+
default=None,
404+
help="Maximum memory in GB that each trial job can use, process will be killed and not retried if it exceeds.",
405+
)
399406
parser.add_argument(
400407
"--server",
401408
type=str,

tools/AutoTuner/src/autotuner/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ def openroad(
324324
export_command += " && "
325325

326326
make_command = export_command
327+
if args.memory_limit is not None:
328+
limit = int(args.memory_limit * 1_000_000)
329+
make_command += f"ulimit -v {limit}; "
327330
make_command += f"make -C {base_dir}/flow DESIGN_CONFIG=designs/"
328331
make_command += f"{args.platform}/{args.design}/config.mk"
329332
make_command += f" PLATFORM={args.platform}"

0 commit comments

Comments
 (0)