From 0ac1deff340d1538a25bba67cdebbbd39d549c36 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 12 Jan 2023 13:39:06 +0100 Subject: [PATCH] ZH: Enable multiprocessing in reconstruction --- simulations/airshower_beacon_simulation/da_reconstruction.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simulations/airshower_beacon_simulation/da_reconstruction.py b/simulations/airshower_beacon_simulation/da_reconstruction.py index 55cbf46..46216e5 100755 --- a/simulations/airshower_beacon_simulation/da_reconstruction.py +++ b/simulations/airshower_beacon_simulation/da_reconstruction.py @@ -11,6 +11,7 @@ from mpl_toolkits.mplot3d import Axes3D # required for projection='3d' on old ma import numpy as np from os import path import pickle +import joblib from earsim import REvent from atmocal import AtmoCal @@ -69,7 +70,8 @@ if __name__ == "__main__": ev.antennas[i].t += total_clock_time N_X, Xlow, Xhigh = 23, 100, 1200 - res = rit.reconstruction(ev, outfile=fig_subdir+'/fig.pdf', slice_outdir=fig_subdir+'/', Xlow=Xlow, N_X=N_X, Xhigh=Xhigh) + with joblib.parallel_backend("loky"): + res = rit.reconstruction(ev, outfile=fig_subdir+'/fig.pdf', slice_outdir=fig_subdir+'/', Xlow=Xlow, N_X=N_X, Xhigh=Xhigh) ## Save a pickle with open(pickle_fname, 'wb') as fp: