import neuron MPI_Allreduce

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

nizar
Posts: 22
Joined: Sat Oct 08, 2005 11:13 am
Location: localhost
Contact:

Re: import neuron MPI_Allreduce

Post by nizar » Wed Sep 15, 2010 11:20 am

hines wrote:When I looked for _ZN3MPI3Win4FreeEv in your /usr/lib/*mpi*.so and /usr/lib/openmpi/*.so
I could not find any mention of it. Also (the few) other people who have launched python and used mpi and neuron
have not mentioned this problem to me. I admit I have only worked around the problem by avoiding #include <mpi.h>
in a c++ file. I did not try very hard to allow that to work by means of linking against some other library by adding something
to setup.py and I would guess that would be an alternative fix.
Just applied the diff to the two source files, now when I try to python setup.py install under $NEURON/src/nrnpython , there is an error;

Code: Select all

running install
running build
running build_py
running build_ext
building 'neuron.hoc' extension
mpic++ -fPIC -I../.././src/oc -I../oc -I/usr/include/python2.6 -c inithoc.cpp -o build/temp.linux-x86_64-2.6/inithoc.o
In file included from /usr/include/python2.6/Python.h:8,
                 from inithoc.cpp:5:
/usr/include/python2.6/pyconfig.h:1067:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from inithoc.cpp:2:
/usr/include/features.h:158:1: warning: this is the location of the previous definition
In file included from /usr/include/python2.6/Python.h:8,
                 from inithoc.cpp:5:
/usr/include/python2.6/pyconfig.h:1079:1: warning: "_XOPEN_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from inithoc.cpp:2:
/usr/include/features.h:160:1: warning: this is the location of the previous definition
inithoc.cpp:27: warning: deprecated conversion from string constant to 'char*'
inithoc.cpp:27: warning: deprecated conversion from string constant to 'char*'
inithoc.cpp:27: warning: deprecated conversion from string constant to 'char*'
inithoc.cpp:33: warning: deprecated conversion from string constant to 'char*'
inithoc.cpp:33: warning: deprecated conversion from string constant to 'char*'
inithoc.cpp: In function 'void inithoc()':
inithoc.cpp:62: error: 'MPI_Initialized' was not declared in this scope
error: command 'mpic++' failed with exit status 1
The weird thing, is that I have the same packages on other x86_64 and everything works, so what is wrong here?!

N.

hines
Site Admin
Posts: 1580
Joined: Wed May 18, 2005 3:32 pm

Re: import neuron MPI_Allreduce

Post by hines » Wed Sep 15, 2010 11:34 am

The diff must not have been applied correctly. As one can see from
http://www.neuron.yale.edu/hg/neuron/nr ... 27af59454a

Code: Select all

    2.23 -	MPI_Initialized(&flag);
    2.24 +	// avoid having to include the c++ version of mpi.h
    2.25 +	nrn_wrap_mpi_init(&flag);
    2.26 +	//MPI_Initialized(&flag);
    2.27  
MPI_Initialized is manifestly commented out. Let's take this back to email as the
resolution of these problems will be straightforward but uninteresting.
I did successfully launch python and import mpi and neuron on your machine. You can
look at the corresponding file in the guest account you gave me and compare with yours.
(should differ only by some comments I added to the commit)
Or send me your inithoc.cpp file and i'll compare with my version.

Post Reply