Skip to content

Commit

Permalink
Change default number of cpus
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Oct 28, 2023
1 parent 0a3da12 commit f69066f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/sinol_make/commands/gen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/sinol_make/commands/inwer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/sinol_make/commands/run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f69066f

Please sign in to comment.