Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
EnMAP
sensormapgeo
Commits
c7b61a25
Commit
c7b61a25
authored
Nov 26, 2021
by
Daniel Scheffler
Browse files
Properly close and join multiprocessing.Pool to avoid coverage issues.
Signed-off-by:
Daniel Scheffler
<
danschef@gfz-potsdam.de
>
parent
3546686f
Pipeline
#35283
failed with stages
in 6 minutes and 8 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
sensormapgeo/transformer_3d.py
View file @
c7b61a25
...
...
@@ -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
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment