Hi all,
I'm writing just to let you know I finally got an execution with MPI. I'm
attaching a patch with the changes I've made to the code to make PyFR work
on a 32 bits platform (in this case, also ARM).
I found that the problem with the key error was caused by some other "bug"
in numpy. Here how you can reproduce it:
>>> import numpy as np
>>> np.dtype('P').type
<class 'numpy.uint32'>
>>> np.uint32
<class 'numpy.uint32'>
>>> np.dtype('P').type == np.uint32
False
This also happens with 'i' dtype (int32), so when trying to access to a map
that has numpy types as keys, the comparison fails and the key error
exception happens.
Thanks for all the help provided.
Best regards,
-Dani
El miércoles, 1 de julio de 2015, 11:06:03 (UTC+2), Dani Ruiz escribió:
>
> Hi Freddie,
>
> Your change leaded again to the error with pickle... So I added the
> "np.intp = np.int32" line to every file importing numpy module and that
> solved the issue.
>
> Anyhow, now I'm facing another problem with MPI (most probably related
> with mpi4py Python module) which I'm trying to solve right now.
>
> Thanks a lot for all the help :-)
>
> Best regards,
> -Dani
>
> El martes, 30 de junio de 2015, 16:47:11 (UTC+2), Freddie Witherden
> escribió:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> On 30/06/2015 14:41, Dani Ruiz wrote:
>> > Hi,
>> >
>> > Regarding the issue Miquel had, chaning the intp instances by
>> > int32 solves the problem with pickle on ARM 32 bits and, therefore,
>> > the application runs correctly with OpenMP backend.
>> >
>> > However, when running MPI+OpenMP it crashes again due to some key
>> > error with int32. Below the specific error:
>> >
>> > After this message, OpenMPI invokes on rank 1 an MPI_ABORT,
>> > finishing the execution. Could this be related with the
>> > modifications made before? I also noticed that he MPI_ABORT is
>> > never invoked on the MPI process with rank 0, not pretty sure if
>> > this could help.
>>
>> It seems to be related to the same numpy issue that breaks regular
>> PyFR on 32-bit systems. As a workaround can you try, against a stock
>> copy of PyFR, opening up pyfr/__main__.py and before
>>
>> import pyfr.scripts.main
>>
>> insert
>>
>> import numpy as np
>> np.intp = np.int32
>>
>> and see if that works. The good news is that if it solves the problem
>> it should solve it everywhere and with only minor code modifications.
>>
>> Regards, Freddie.
>>
>> -----BEGIN PGP SIGNATURE-----
>> Comment: GPGTools - http://gpgtools.org
>>
>> iQIcBAEBCAAGBQJVkqvlAAoJEJ5wYUFIoPofozQP/ibUa3EmSvix/xA3z7b+5kOb
>> xojF321X95Ox+85loKH/FMjR7Shnq02SJtUtkDVnIp2sDpdvD+4bozwZ01REtHZ9
>> Wc6zJYe+F6EG7xdIkwF3tTNYeT21WvV5RgUC/SHLXJiq6NR5AfWHg+KiUcnE9o2z
>> aFkO/H7OLM5Gw9oISuekWRtAimrd+wP27UsqOfajev1RlnUI5JnUlbDo0TQtCEMf
>> 1Bxo1YM/mEc2CLeGsPvthgYNhlN4Mc3L+DXXpnRevOk7b0l6vKY+tHaCfWC7550s
>> SE1rqobQbobTTZcYR5jBAfF245bx6hnPirWjqqcG95G9K2gN25vtP/YKsMgHMZsM
>> o0Y/vtMYQwX8k2fQU98jYfQh7ncdwALD59LRXx44nUTJGc5DVPFNty68QGhyfGpJ
>> Wrpy5NuFF7EZzAdYDObnrlhYVZZB77NpSrvpFe5/cNJVCmnws8lBogdA1SwcnuQd
>> VUUcSY0f4VyLYdunBhADgyFJfgTSFWLWeb8M6Pkk05Tvnz+jou5T/Kx6Sf5Q4KrJ
>> PnZET0KWqG0qFtdKcE0npdTEE7SvHUNxSG8AT/mbcU8awAqBYABrWadaHqC/MXma
>> M7nJsEgUIEZ2QRgkEkqjyjjGAJ4hJp3G9JBSVNY3YmHwWZoZQbQKpY+HQYB2rJ1r
>> Ob6TfnvfHnhh/e6ETr+g
>> =DF5J
>> -----END PGP SIGNATURE-----
>>
>
--
You received this message because you are subscribed to the Google Groups "PyFR
Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at http://groups.google.com/group/pyfrmailinglist.
For more options, visit https://groups.google.com/d/optout.
diff --git a/tmp/PyFR-1.0.0/pyfr/nputil.py b/home/druiz/python/pyfr/PyFR-1.0.0/pyfr/nputil.py
index d1bd5e8..a8b6fd2 100644
--- a/tmp/PyFR-1.0.0/pyfr/nputil.py
+++ b/home/druiz/python/pyfr/PyFR-1.0.0/pyfr/nputil.py
@@ -119,5 +119,9 @@ def npdtype_to_ctypestype(dtype):
# Special-case None which otherwise expands to np.float
if dtype is None:
return None
+ elif dtype is 'P':
+ return ct.c_uint32
+ elif dtype is 'i':
+ return ct.c_int32
return _ctypestype_map[np.dtype(dtype).type]
diff --git a/tmp/PyFR-1.0.0/pyfr/util.py b/home/druiz/python/pyfr/PyFR-1.0.0/pyfr/util.py
index af71f5c..2aeeaaf 100644
--- a/tmp/PyFR-1.0.0/pyfr/util.py
+++ b/home/druiz/python/pyfr/PyFR-1.0.0/pyfr/util.py
@@ -7,6 +7,7 @@ import itertools as it
import os
import pickle
import shutil
+import numpy as np
from pyfr.ctypesutil import find_libc
@@ -26,6 +27,7 @@ class memoize(object):
except AttributeError:
cache = instance._memoize_cache = {}
+ np.intp = np.int32
key = (self.func, pickle.dumps(args[1:], 1), pickle.dumps(kwargs, 1))
try: