hungpham2017 / pyWannier90

A Wannier90 python interface for VASP and PySCF
BSD 3-Clause "New" or "Revised" License
34 stars 11 forks source link

undefined symbol: mpi_reduce_ #3

Closed willwheelera closed 4 years ago

willwheelera commented 4 years ago

When I run

$ python -c "import libwannier90"

I get the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /projects/wagner/wawheel2/code/pyWannier90/src/libwannier90.cpython-37m-x86_64-linux-gnu.so: undefined symbol: mpi_reduce_

I'm not sure where the problem is coming from. I've compiled wannier90 using the pyWannier90 version of wannier_lib.F90. The edited lines in the pyWannier90 Makefile are

W90DIR =/projects/wagner/wawheel2/code/wannier90
LIBDIR =/usr/local/intel/parallel_studio_xe_2018/compilers_and_libraries_2018.1.163/linux    /bin/intel64
USE_INTEL = yes 
MPIF90=mpiifort

ifeq ($(USE_INTEL), yes)
  CPP = /usr/local/intel/parallel_studio_xe_2018/compilers_and_libraries_2018.1.163/linux/bin/intel64/icpc
  LIBS = -L$(LIBDIR)/mkl/lib/intel64 -lmkl_core -lmkl_intel_lp64 -lmkl_sequential \
  -Wl,-rpath,$(LIBDIR)/lib/intel64 -L$(LIBDIR)/lib/intel64 -limf -lintlc -liomp5 -lifcore \
  -Wl,-rpath,$(W90DIR) -L$(W90DIR) -lwannier
    all: libwannier90_intel
endif

Do you have any suggestions?

hungpham2017 commented 4 years ago

/projects/wagner/wawheel2/code/pyWannier90/src/libwannier90.cpython-37m-x86_64-linux-gnu.so: undefined symbol: mpireduce

It looks to me you compiled wannier90 and pyWannier90 using MPI. Note that the library mode of wannier90 is working only in serial so I don't think this is possible. that's why I didn't write libwannier90.cpp with the MPI in mind.
If you want to run wannier90 with MPI, then you can use the pyWannier90 to generate all the inputs file (.amn, . mmn, .eig, ...) then run it using wannier90.x

willwheelera commented 4 years ago

Thanks for noticing that! I didn't realize it only works in serial. I compiled wannier90 and pyWannier90 without MPI and was able to load libwannier90 in python successfully!

Also thanks for pointing out how to run it with MPI!