@@ -255,12 +255,14 @@ def set_end_of_cluster_function(self, function):
255255 ''' Adding function to module.
256256 This is maybe the only way to make the clusterizer to work with multiprocessing.
257257 '''
258+ self .cluster_functions ._end_of_cluster_function = self ._jitted (function )
258259 self ._end_of_cluster_function = function
259260
260261 def set_end_of_event_function (self , function ):
261262 ''' Adding function to module.
262263 This is maybe the only way to make the clusterizer to work with multiprocessing.
263264 '''
265+ self .cluster_functions ._end_of_event_function = self ._jitted (function )
264266 self ._end_of_event_function = function
265267
266268 def set_min_hit_charge (self , value ):
@@ -304,10 +306,8 @@ def cluster_hits(self, hits, noisy_pixels=None, disabled_pixels=None):
304306 The noisy_pixels parameter allows for removing clusters that consist of a single noisy pixels. Clusters with 2 or more noisy pixels are not removed.
305307 The disabled_pixels parameter allows for ignoring pixels.
306308 '''
307- # For multiprocessing make sure that the function are jitted after pickling.
308- # In some cases, where the pixel_clusterizer module is installed into the
309- # the site-packages folder, overriding the of cluster funtions immediately invokes
310- # the JIT compiler and converts the function objects to a Numba ojects.
309+ # Jitting a second time to workaround different bahavior of the installation methods on different platforms (pip install vs. python setup.py).
310+ # In some circumstances, the Numba compiler can't compile functions that were pickled previously.
311311 self .cluster_functions ._end_of_cluster_function = self ._jitted (self ._end_of_cluster_function )
312312 self .cluster_functions ._end_of_event_function = self ._jitted (self ._end_of_event_function )
313313
0 commit comments