Commit c7b61a25 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Properly close and join multiprocessing.Pool to avoid coverage issues.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 3546686f
Pipeline #35283 failed with stages
in 6 minutes and 8 seconds
......@@ -239,7 +239,10 @@ class SensorMapGeometryTransformer3D(object):
# arrays because this would allocate the memory for the input arrays of all bands at once.
# NOTE: Use a multiprocessing imap iterator here when the OpenMP is finally fixed in the pyresample side:
# with multiprocessing.Pool(self.opts['nprocs']) as pool:
# return [res for res in pool.imap_unordered(self._to_map_geometry_2D, args)]
# res = [res for res in pool.imap_unordered(self._to_map_geometry_2D, args)]
# pool.close()
# pool.join()
# return res
try:
# this may cause a deadlock with the GNU OpenMP build, thus each WORKER has a timeout of 10 seconds
with ProcessPool() as pool:
......@@ -328,6 +331,8 @@ class SensorMapGeometryTransformer3D(object):
# NOTE: See the comments in the to_map_geometry() method.
with multiprocessing.Pool(self.opts['nprocs']) as pool:
result = [res for res in pool.imap_unordered(self._to_sensor_geometry_2D, args)]
pool.close()
pool.join()
else:
result = [self._to_sensor_geometry_2D(argsdict) for argsdict in args]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment