Skip to content

Commit 34d8dd9

Browse files
committed
at: add arg to set memory limit
For reference, nangate45/gcd uses about ~3GB Signed-off-by: Vitor Bandeira <[email protected]>
1 parent 82a5c44 commit 34d8dd9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,13 @@ def parse_arguments():
380380
default=42,
381381
help="Random seed. (0 means no seed.)",
382382
)
383+
tune_parser.add_argument(
384+
"--memory_limit",
385+
type=float,
386+
metavar="<float>",
387+
default=1,
388+
help="Maximum memory in GB that each trial job can use, process will be killed and not retried if it exceeds.",
389+
)
383390

384391
# Workload
385392
parser.add_argument(

tools/AutoTuner/src/autotuner/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def openroad(
324324
export_command += " && "
325325

326326
make_command = export_command
327-
make_command += f"make -C {base_dir}/flow DESIGN_CONFIG=designs/"
327+
make_command += f"ulimit -v {args.memory_limit * 1_000_000}; make -C {base_dir}/flow DESIGN_CONFIG=designs/"
328328
make_command += f"{args.platform}/{args.design}/config.mk"
329329
make_command += f" PLATFORM={args.platform}"
330330
make_command += f" FLOW_VARIANT={flow_variant} {parameters}"

0 commit comments

Comments
 (0)