Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2818d84d authored by GUILLEMOT Alexandre's avatar GUILLEMOT Alexandre
Browse files

add core option to runtest

parent c9e2b757
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,8 @@ parser.add_argument("-m", "--mem", nargs="?", const="8G", ...@@ -20,6 +20,8 @@ parser.add_argument("-m", "--mem", nargs="?", const="8G",
help="Maximum amount of memory used. Should be written as <number><unit> where <unit> may be nothing, K, M or G, e.g. 100M") help="Maximum amount of memory used. Should be written as <number><unit> where <unit> may be nothing, K, M or G, e.g. 100M")
parser.add_argument("-n", "--norun", action='store_true', parser.add_argument("-n", "--norun", action='store_true',
default=False, help="To only generate script and command") default=False, help="To only generate script and command")
parser.add_argument("-c", "--core", nargs="?", const="1",
help="Core on which the job should be ran")
args = parser.parse_args() args = parser.parse_args()
pkg_path = Path(args.pkg) pkg_path = Path(args.pkg)
...@@ -131,7 +133,7 @@ if not args.norun: ...@@ -131,7 +133,7 @@ if not args.norun:
print("Running script...") print("Running script...")
cmd = ["systemd-run", "--scope", "--user", "-p", f"MemoryMax={memory_b}", "-p", "MemorySwapMax=0"]*( cmd = ["systemd-run", "--scope", "--user", "-p", f"MemoryMax={memory_b}", "-p", "MemorySwapMax=0"]*(
memory_b != None) + ["perf", "stat", "-o", "perflog.txt"]*args.perf + ["taskset", "1", "./command.sh"] memory_b != None) + ["perf", "stat", "-o", "perflog.txt"]*args.perf + ["taskset", args.core, "./command.sh"]
p = subprocess.Popen(cmd, start_new_session=True, p = subprocess.Popen(cmd, start_new_session=True,
stdout=out_file, stderr=log_file) stdout=out_file, stderr=log_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment