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

* Replaced multiprocessing.parent_process in warp_ndarray() by an equivalent...


* Replaced multiprocessing.parent_process in warp_ndarray() by an equivalent which is compatible to Python versions <3.8. Bumped version.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 3df5a029
Pipeline #25333 passed with stages
in 2 minutes and 40 seconds
......@@ -2,6 +2,13 @@
History
=======
0.17.5 (2021-07-06)
-------------------
* Replaced multiprocessing.parent_process in warp_ndarray()
by an equivalent which is compatible to Python versions <3.8.
0.17.4 (2021-07-03)
-------------------
......
......@@ -429,9 +429,9 @@ def warp_ndarray(ndarray, in_gt, in_prj=None, out_prj=None, out_dtype=None,
# in_ds.SetMetadata(rpc, "RPC")
# transformerOptions = ['RPC_DEM=data/warp_52_dem.tif']
# use GDALs multiprocessing as long as the current process is not a child process of a multiprocess main thread
# use GDALs multiprocessing as long as the current process is not a child process of a multiprocessing main process
# - otherwise, gdal.Warp() hangs with GDAL versions from 3.2.1 and above (does not allow sub-multiprocessing)
if (CPUs is None or CPUs > 1) and multiprocessing.parent_process() is None:
if (CPUs is None or CPUs > 1) and multiprocessing.current_process().name == 'MainProcess':
gdal.SetConfigOption('GDAL_NUM_THREADS', str(CPUs if CPUs else multiprocessing.cpu_count()))
# gdal.SetConfigOption('GDAL_CACHEMAX', str(800))
......
......@@ -19,5 +19,5 @@
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.17.4'
__versionalias__ = '20210703_01'
__version__ = '0.17.5'
__versionalias__ = '20210706_01'
Markdown is supported
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