<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p><br>
</p>
<p>I try to write a GRASS addon, which does some preprocessing and
classifies with r.learn.ml on different region parallel. For this,
I want to use MultiModule and ParallelModuleQueue.</p>
<p>I tested the examples on
<a class="moz-txt-link-freetext" href="https://grass.osgeo.org/grass77/manuals/libpython/pygrass.modules.interface.html?highlight=parallelmodulequeue#pygrass.modules.interface.module.ParallelModuleQueue">https://grass.osgeo.org/grass77/manuals/libpython/pygrass.modules.interface.html?highlight=parallelmodulequeue#pygrass.modules.interface.module.ParallelModuleQueue</a>
with Python 3.</p>
<p>The example "Check MultiModule approach with three by two
processes running in a background process" leads to <br>
</p>
<blockquote>
<p><tt>...</tt><tt><br>
</tt></p>
<p><tt>Traceback (most recent call last):</tt><tt><br>
</tt><tt> File "/usr/lib/python3.6/multiprocessing/queues.py",
line 235, in _feed</tt><tt><br>
</tt><tt> obj = _ForkingPickler.dumps(obj)</tt><tt><br>
</tt><tt> File
"/usr/lib/python3.6/multiprocessing/reduction.py", line 52, in
dumps</tt><tt><br>
</tt><tt> cls(buf, protocol).dump(obj)</tt><tt><br>
</tt><tt>TypeError: can't pickle _thread.lock objects</tt></p>
<p><tt>...</tt><tt><br>
</tt></p>
</blockquote>
<p>The same error appears in the MultiModule example "Asynchronous
module run, setting finish = False and using temporary region".</p>
<p>Using python 2 all works fine.<br>
</p>
<p>Has someone a solution for the error or an idea how I can write a
Grass addon with parallelization on different regions?</p>
<p><br>
</p>
<p>Thanks and best regards,</p>
<p>Anika<br>
</p>
<p><br>
</p>
<p>P.S. I used this versions on Linux Mint 19 Tara:<br>
</p>
<p>python3 --version<br>
Python 3.6.7</p>
<p>python --version<br>
Python 2.7.15rc1<br>
</p>
<p>grass77 --config svn_revision version<br>
74074M<br>
7.7.svn</p>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
Anika Bettge
- Anwendungsentwicklerin -
mundialis GmbH & Co. KG
Kölnstraße 99
53111 Bonn
Tel: +49 (0)228 / 38 75 80 -80
Fax: +49 (0)228 / 96 28 99 -57
Email: <a class="moz-txt-link-abbreviated" href="mailto:bettge@mundialis.de">bettge@mundialis.de</a>
Web: <a class="moz-txt-link-freetext" href="https://www.mundialis.de">https://www.mundialis.de</a>
Amtsgericht Bonn, HRA 8528
Komplementärin: mundialis Verwaltungsgesellschaft mbH
vertreten durch: Dr. Markus Neteler, Hinrich Paulsen, Till Adams
Informationen über Ihre gespeicherten Daten finden Sie auf unserer Homepage unter folgendem Link:
<a class="moz-txt-link-freetext" href="https://www.mundialis.de/datenschutzerklaerung">https://www.mundialis.de/datenschutzerklaerung</a></pre>
</body>
</html>