From f69066f89d22e7b76a3c20c3f1338f7c0d1d556f Mon Sep 17 00:00:00 2001 From: MasloMaslane Date: Sat, 28 Oct 2023 13:41:22 +0200 Subject: [PATCH] Change default number of cpus --- src/sinol_make/commands/gen/__init__.py | 3 ++- src/sinol_make/commands/inwer/__init__.py | 2 +- src/sinol_make/commands/run/__init__.py | 2 +- tests/conftest.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sinol_make/commands/gen/__init__.py b/src/sinol_make/commands/gen/__init__.py index 9a690116..115c6345 100644 --- a/src/sinol_make/commands/gen/__init__.py +++ b/src/sinol_make/commands/gen/__init__.py @@ -35,7 +35,8 @@ def configure_subparser(self, subparser): parser.add_argument('ingen_path', type=str, nargs='?', help='path to ingen source file, for example prog/abcingen.cpp') parser.add_argument('-c', '--cpus', type=int, - help=f'number of cpus to use to generate output files (default: {mp.cpu_count()} - all available)', + help=f'number of cpus to use to generate output files ' + f'(default: {mp.cpu_count() - 1})', default=mp.cpu_count()) parsers.add_compilation_arguments(parser) diff --git a/src/sinol_make/commands/inwer/__init__.py b/src/sinol_make/commands/inwer/__init__.py index 59ca28ba..4fcd2ef1 100644 --- a/src/sinol_make/commands/inwer/__init__.py +++ b/src/sinol_make/commands/inwer/__init__.py @@ -37,7 +37,7 @@ def configure_subparser(self, subparser: argparse.ArgumentParser): parser.add_argument('-t', '--tests', type=str, nargs='+', help='test to verify, for example in/abc{0,1}*') parser.add_argument('-c', '--cpus', type=int, - help=f'number of cpus to use (default: {mp.cpu_count()} -all available)') + help=f'number of cpus to use (default: {mp.cpu_count() - 1})') add_compilation_arguments(parser) def compile_inwer(self, args: argparse.Namespace): diff --git a/src/sinol_make/commands/run/__init__.py b/src/sinol_make/commands/run/__init__.py index 773e7922..fc2f15a9 100644 --- a/src/sinol_make/commands/run/__init__.py +++ b/src/sinol_make/commands/run/__init__.py @@ -252,7 +252,7 @@ def configure_subparser(self, subparser): parser.add_argument('-t', '--tests', type=str, nargs='+', help='tests to be run, for example in/abc{0,1}*') parser.add_argument('-c', '--cpus', type=int, - help='number of cpus to use, you have %d avaliable' % mp.cpu_count()) + help=f'number of cpus to use (default: {mp.cpu_count() - 1}') parser.add_argument('--tl', type=float, help='time limit for all tests (in s)') parser.add_argument('--ml', type=float, help='memory limit for all tests (in MB)') parser.add_argument('--hide-memory', dest='hide_memory', action='store_true', diff --git a/tests/conftest.py b/tests/conftest.py index 9f97f993..c02d56ec 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -34,7 +34,7 @@ def pytest_addoption(parser): ) parser.addoption("--no-precompile", action="store_true", help="if set, will not precompile all solutions") parser.addoption("--cpus", type=int, help="number of cpus to use, by default all available", - default=mp.cpu_count()) + default=mp.cpu_count() - 1) def pytest_configure(config):