Skip to content

Commit a1f5abd

Browse files
Re-use n-cores flag and make sure negative value of n_jobs are not permitted
1 parent abc1b11 commit a1f5abd

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

n3fit/src/evolven3fit/evolve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _wrap_evolve(pdf, replica):
134134
dump_evolved_replica(evolved_blocks, usr_path, int(replica.removeprefix("replica_")))
135135

136136
# Choose the number of cores to be the Minimal value
137-
nb_cores = min(NUM_CORES, ncores)
137+
nb_cores = min(NUM_CORES, abs(ncores))
138138
Parallel(n_jobs=nb_cores)(
139139
delayed(_wrap_evolve)(pdf, r) for r, pdf in initial_PDFs_dict.items()
140140
)

n3fit/src/n3fit/scripts/evolven3fit.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ def construct_evolven3fit_parser(subparsers):
8282
parser.add_argument(
8383
"-d", "--dump", type=pathlib.Path, default=None, help="Path where the EKO is dumped"
8484
)
85-
parser.add_argument(
86-
"-n",
87-
"--ncores",
88-
type=int,
89-
default=1,
90-
help="Specify the number of cores to parallelize evolution",
91-
)
9285
parser.add_argument(
9386
"-f",
9487
"--force",
@@ -176,7 +169,7 @@ def main():
176169
args.force,
177170
eko_path,
178171
None,
179-
args.ncores,
172+
args.n_cores,
180173
)
181174
else:
182175
# If we are in the business of producing an eko, do some checks before starting:

0 commit comments

Comments
 (0)