Skip to content

Commit 66b6056

Browse files
committed
Use maxcores + rename function that computes the photon
1 parent fdc5ef9 commit 66b6056

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

n3fit/src/n3fit/scripts/vp_setupfit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def from_yaml(cls, o, *args, **kwargs):
203203
SETUPFIT_FIXED_CONFIG['actions_'].append('fiatlux check_luxset_exists')
204204
if fiatlux.get("additional_errors"):
205205
SETUPFIT_FIXED_CONFIG['actions_'].append('fiatlux check_additional_errors')
206-
SETUPFIT_FIXED_CONFIG['actions_'].append('fiatlux::theory compute_photon')
206+
SETUPFIT_FIXED_CONFIG['actions_'].append('fiatlux::theory compute_photon_to_disk')
207207

208208

209209
# Check positivity bound

validphys2/src/validphys/photon/compute.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,16 @@ def load_photon(self):
286286
self.integral = np.stack(integral, axis=-1)
287287
return
288288

289-
def compute_photon(theoryid, fiatlux):
289+
def compute_photon_to_disk(theoryid, fiatlux, maxcores):
290290
"""Function to compute the photon PDF set."""
291291
luxset = fiatlux['luxset'].load()
292292
force_compute = fiatlux.get('compute_in_setupfit', False)
293293
replicas = list(range(1, luxset.n_members))
294294

295295
# Return None and avoid pickling issues with the phoyon class.
296296
def wrapper_fn(replica, theoryid, fiatlux, force_compute):
297-
Photon(theoryid, fiatlux, replicas=[replica], save_to_disk=True, force_computation=force_compute)
297+
Photon(theoryid, fiatlux, replicas=[replica], save_to_disk=force_compute, force_computation=force_compute)
298298
return None
299299

300-
log.info(f"Starting computation of the photon using {effective_n_jobs(-1)} effective cores...")
301-
_ = Parallel(n_jobs=-1)(delayed(wrapper_fn)(replica=replica, theoryid=theoryid, fiatlux=fiatlux, force_compute=force_compute) for replica in replicas)
300+
log.info(f"Starting computation of the photon using {maxcores} effective cores...")
301+
_ = Parallel(n_jobs=maxcores)(delayed(wrapper_fn)(replica=replica, theoryid=theoryid, fiatlux=fiatlux, force_compute=force_compute) for replica in replicas)

0 commit comments

Comments
 (0)