Opened 3 years ago

Last modified 2 years ago

#955 qa defect

mpi4py fails importing MPI

Reported by: amweeden.earlham@… Owned by: skylar
Priority: major Milestone: 3.4.0
Component: Both Version: 3.4.0
Keywords: Cc:
Blocked By: Blocking:
Estimated Hours: 1 Total Hours: 0

Description

On 08/31/2015 10:16 AM, Aaron Weeden wrote:

I can import mpi4py just fine, but not the MPI object within it:

bccd@node000:~$ *bccd-version* Revision: 3.4.0-skylar.5290 Build date: 2015-8-20 bccd@node000:~$ *module load mpi4py* bccd@node000:~$ *python* Python 2.7.10 (default, Jun 1 2015, 16:21:46) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

*import mpi4py* *from mpi4py import MPI*

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

ImportError?: cannot import name MPI

Sigh, it looks like this might be a holdover from when we were trying to support OpenACC and a newer compiler. I'll see what needs to happen to get this to work again; unfortunately it seems that mpi4py only builds with gcc 4.9 (back down that rabbit hole again).

Change History (8)

comment:1 Changed 3 years ago by skylar

  • Status changed from new to assigned
  1. sudo update-alternatives --remove-all gcc
  2. sudo apt-get install zlib1g-dev gcc-4.9
  3. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 --slave /usr/bin/cpp cpp /usr/bin/cpp-4.9

comment:2 Changed 3 years ago by skylar

rebuilding fails w/ gcc 4.8 error about -fstack-protector-strong not being a valid flag, which is true since it wasn't added until gcc 4.9

this is because Debian project apparently built python 2.7 w/ that option:

python-config --cflags python2.7 -c "import sysconfig; print sysconfig.get_config_vars()"

comment:3 Changed 3 years ago by skylar

trying adding pythonrun.h include to src/python.c

comment:4 Changed 3 years ago by skylar

linking against libpython2.7.so manually works:

/bccd/software/openmpi/1.8.5/Linux/BCCD/x86_64/bin/mpicc -I/bccd/software/openmpi/1.8.5/Linux/BCCD/x86_64/include/ -I/bccd/software/cuda/5.5.22/Linux/BCCD/x86_64/include/ -L/bccd/software/openmpi/1.8.5/Linux/BCCD/x86_64/lib/ -L/bccd/software/cuda/5.5.22/Linux/BCCD/x86_64/sdk/lib/ -L/bccd/software/cuda/5.5.22/Linux/BCCD/x86_64/lib64/ -L/bccd/software/cuda/5.5.22/Linux/BCCD/x86_64/lib/ -Wl,-export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/python.o -L/usr/lib/python2.7/config-x86_64-linux-gnu -Lbuild/temp.linux-x86_64-2.7 -o build/lib.linux-x86_64-2.7/mpi4py/bin/python-mpi -Wl,-z,relro -lpthread -ldl -lutil -L/usr/lib -lz -lm /usr/lib/x86_64-linux-gnu/libpython2.7.so

comment:5 Changed 3 years ago by skylar

  1. sudo update-alternatives --remove-all gcc
  2. sudo apt-get install zlib1g-dev gcc-4.9
  3. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 --slave /usr/bin/cpp cpp /usr/bin/cpp-4.9
  4. python setup.py build_exe -l python2.7
  5. python setup.py build
  6. python setup.py install --prefix=${BCCD_SW}/mpi4py/1.3.1/${ARCHPATH}
Last edited 3 years ago by skylar (previous) (diff)

comment:6 Changed 3 years ago by skylar

In 5299//cluster/svnroot:

adding mpi4py 1.3.1, updating test suite to include loading MPI from mpi4py re #955

comment:7 Changed 3 years ago by skylar

In 5300//cluster/svnroot:

merge addresses #955

comment:8 Changed 2 years ago by skylar

  • Status changed from assigned to qa
Note: See TracTickets for help on using tickets.