how config mpich2 on a standalone PC?

General issues of interest both for network and
individual cell parallelization.

Moderator: hines

Post Reply
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

how config mpich2 on a standalone PC?

Post by Keivan »

I want to test parallel neuron on a standalone multiprocessor computer. previously I could compile neuron using pvm3, however I realized that mpich2 is a better package.
according to the article "Translating network models to parallel hardware in NEURON" I have compiled mpich2. but I do not want to setup a cluster. how should I configure mpich2 for this purpose? Do I benefit from mpich2? Is mpich2 necessary using neuron 7 on a standalone multicore PC? please help me. I have googled a lot and did not find my answers.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: how config mpich2 on a standalone PC?

Post by hines »

Can you run mpdboot?
For a single multicore machine, all that is needed is a $HOME/.mpd.conf file with permission 600 and the contents
secretword=whatever
If mpdtrace shows a machine name instead of a long message you are ready to launch an mpiexec command line.
For a single multicore machine, configuring with the '--with-device=ch3:nemesis' makes for much faster communication than tcp/ip on
a shared memory machine. I also configure with '--enable-sharedlibs=gcc'

MPI is not necessary on a standalone multicore machine since an alternative is to use threads. But MPI (with the nemesis device) is always a bit faster than threads.
I would install the 7.1 alpha version however as there have been a few parallel related bug fixes.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: how config mpich2 on a standalone PC?

Post by Keivan »

Thank you hines. I am really tired of struggling with my computer. this is my stat now:

I have compiled mich2 with the following series of commands:

Code: Select all

./configure --prefix=$HOME/mpich2 --with-device=ch3:nemesis --enable-sharedlibs=gcc --with-pm=gforker --enable-fast=O3 MPICH2LIB_CFLAGS=-march=native MPICH2LIB_FFLAGS=-march=native MPICH2LIB_CXXFLAGS=-march=native MPICH2LIB_F90FLAGS=-march=native 
	make	#do not use -j3 --> not recommended
	make install
	export PATH=$HOME/mpich2/bin:$PATH
	cd $HOME
	touch .mpd.conf
	chmod 600 .mpd.conf
	gedit .mpd.conf --> MPD_SECRETWORD=*******
	gedit /home/keivan/neuron/nrnenv --> export PATH=$HOME/mpich2/bin:$PATH
this is the content of /etc/hosts

Code: Select all

127.0.0.1	localhost
127.0.1.1	localhost.localdomain ubuntu
$ipaddr $uqdn    #this the suggestion of the mpdcheck -l command I do not know if it is correct

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
this is output of my mpdboot and mpdtrace commands:

Code: Select all

keivan@ubuntu:~$ mpdboot
keivan@ubuntu:~$ mpdtrace
ubuntu
this the output of the mpdcheck command:

Code: Select all

*** the fq hostname seems to be localhost
*** first ipaddr for this host (via ubuntu) is: 127.0.1.1
this is the result of cpi test program

Code: Select all

	cd ~/mpich2/share/examples_graphics
	make
	mpdallexit
	mpd &
	mpiexec -np 1 ./cpi_anim
Process 0 on ubuntu
pi is approximately 3.1416009869231254, Error is 0.0000083333333323
wall clock time = 0.000060

	mpiexec -np 2 ./cpi_anim
Process 0 on ubuntu
Process 1 on ubuntu
pi is approximately 3.1416009869231241, Error is 0.0000083333333309
wall clock time = 0.066925
I think cpi_anim is written to be run faster on parallel machines. but why it become slow using -np 2?

I have a dual core processor and according to the mich2 faq:
Q: Can MPI be used to program multicore systems?

A: There are two common ways to use MPI with multicore processors or multiprocessor nodes:

1. Use one MPI process per core (here, a core is defined as a program counter and some set of arithmetic, logic, and load/store units).
2. Use one MPI process per node (here, a node is defined as a collection of cores that share a single address space). Use threads or compiler-provided parallelism to exploit the multiple cores. OpenMP may be used with MPI; the loop-level parallelism of OpenMP may be used with any implementation of MPI (you do not need an MPI that supports MPI_THREAD_MULTIPLE when threads are used only for computational tasks). This is sometimes called the hybrid programming model.
it seems that I should use two MPI processes. but how?
is this the reason of slow performance of cpi_anim?

I have also compiled neuron with following commands:

Code: Select all

cd ~/neuron/nrn
	./configure --prefix=`pwd` --with-device=ch3:nemesis --with-iv=/home/keivan/neuron/iv/ --with-paranrn CXXFLAGS="-march=native" CFLAGS="-march=native" FFLAGS="-march=native"
	make -j3
	make -j3 install
a question that is not related to the topic: Do I need -o3 flag beside -march=native flag as I have done in configuration part of the mpich2? and how can I send more than one flag to the compilers?

this is the content of nrnenv

Code: Select all

export IV=$HOME/neuron/iv
export N=$HOME/neuron/nrn
export CPU=x86_64
export PATH="$IV/$CPU/bin:$N/$CPU/bin:$PATH"

export PVM_ROOT=$/usr/lib/pvm3
#source ${PVM_ROOT}/lib/bashrc.stub
export PVM_RSH=/usr/bin/ssh
export PATH=$HOME/mpich2/bin:$PATH
this is the output the test program

Code: Select all

cd ~/neuron/nrn/src/parallel
mpiexec -np 2 nrngui -mpi test0.hoc 
numprocs=2
NEURON -- Release 7.0 (281:80827e3cd201) 2009-01-16
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

I am 0 of 2
I am 1 of 2
1) Is everything OK?
2) I thought GUI should be accessible in neuron 7 parallel mode. am I right?
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: how config mpich2 on a standalone PC?

Post by hines »

it seems that I should use two MPI processes. but how?
is this the reason of slow performance of cpi_anim?
You are doing it correctly.
I wouldn't worry about the performance of cpi. You don't get much speedup
with parallel unless your problem is greater than about 5000 states.
Do I need -o3 flag beside -march=native flag as I have done in configuration part of the mpich2? and how can I send more than one flag to the compilers?
I don't see how it can do any harm unless you get a compiler error. See configure --help but generally people specify CFLAGS and CXXFLAGS.
1) Is everything OK?
Yes. The output of test0.hoc for -np 2 is correct.
2) I thought GUI should be accessible in neuron 7 parallel mode. am I right?
The gui is not accessible when using MPI. It is accessible when using threads.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: how config mpich2 on a standalone PC? {solved}

Post by Keivan »

thank you hines.
R_Jarvis

Re: how config mpich2 on a standalone PC?

Post by R_Jarvis »

After running:

$./configure --prefix='$HOME/neuron/' --with-iv=$HOME/neuron/iv --with-paranrn

I get:
(lots of yes, echo etc then...)
checking for mpicc... mpicc
checking for MPI_Init... no
checking for MPI_Init in -lmpi... no
checking for MPI_Init in -lmpich... no
configure: error: Cannot compile MPI program

I installed mpich2 through a .deb package.

mpiexec -np 4 runs, except it opens four different versions of the same .hoc file (I know I should not expect it to work without parallel nrn compilation and working mpd however).

I can only run $./mpd or $./mpdtrace
from the /usr/lib/mpich-mpd/bin/
directory as the .deb package did not set a path variable for these mpd programs by default.
I am not sure what the correct way to set the path variable is, but I tried adding it to the .bashrc file as that seems to work in other cases.

I wonder if the MPI_Init fail could be related to mpd not executing from $HOME?
Also there is no mpdboot file in bin, but I think ./mpd does the same thing.

Thanks for any suggestions.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: how config mpich2 on a standalone PC?

Post by hines »

What is required during configure is to be able to find mpicc and mpic++
(or mpicxx). It looks like configure found mpicc but when mpicc was
used to compile a test program it did not know where the proper include
files or libarary files are. You can verify this by looking in the
config.log file to see the error messages resulting from that test
compile and link. I have not experienced this when I build mpich2 from
sources on a linux machine. mpicc is a shell script that runs gcc with
added -I, -L, and -l options. Is there any libmpi.* file in some
subdirectory of /usr Where is mpi.h? Where is mpicc? It seems strange to
me that binary intended to be executed by the user ends up in
/usr/lib/mpich-mpd/bin. When I install mpich2 from sources everything
is in <prefix>/bin, <prefix>/lib, and <prefix>/include
R_Jarvis

Re: how config mpich2 on a standalone PC?

Post by R_Jarvis »

Okay well I took your hint and compiled from mpich2 source (overcoming some problems I was having with achieving this previously).

I followed the instructions here:
http://www.underworldproject.org/docume ... ICH_source
to compile mpich2 from source.

It includes instructions on how to set the path variables, and it seems to satisfy the appropriate stages of -paran compilation.
R_Jarvis

Re: how config mpich2 on a standalone PC?

Post by R_Jarvis »

mpd could be working, since typing
$mpd
then new terminal tab and
$mpdtrace
yields:
mpdtrace: zara2_53991: lhs=zara2_53991 rhs=zara2_53991 rhs2=zara2_53991 gen=1.

However going back a few steps. I am having trouble compiling interviews.

The output of:

./configure --prefix=/home/zara2/neuron/iv/

is all yes echo etc. until a bunch of warnings.

configure: creating ./config.status
config.status: creating Makefile
config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir setting
config.status: creating src/Makefile
config.status: WARNING: 'src/Makefile.in' seems to ignore the --datarootdir setting
config.status: creating src/bin/Makefile
config.status: WARNING: 'src/bin/Makefile.in' seems to ignore the --datarootdir setting
config.status: creating src/bin/idemo/Makefile
config.status: WARNING: 'src/bin/idemo/Makefile.in' seems to ignore the --datarootdir setting
config.status: creating src/bin/idraw/Makefile
config.status: WARNING: 'src/bin/idraw/Makefile.in' seems to ignore the --datarootdir setting
config.status: creating src/bin/iclass/Makefile
config.status: WARNING: 'src/bin/iclass/Makefile.in' seems to ignore the --datarootdir setting
config.status: creating src/include/Makefile
config.status: WARNING: 'src/include/Makefile.in' seems to ignore the --datarootdir setting
config.status: creating src/lib/Makefile
config.status: WARNING: 'src/lib/Makefile.in' seems to ignore the --datarootdir setting
config.status: creating config.h
config.status: config.h is unchanged
config.status: creating src/include/ivstream.h
config.status: src/include/ivstream.h is unchanged
config.status: executing libtool commands

Then I can't compile because of cpp errors regarding idraw, and iclass.


zara2@zara2:~/neuron/iv$ make
Making all in src
make[1]: Entering directory `/home/zara2/neuron/iv/src'
Making all in lib
make[2]: Entering directory `/home/zara2/neuron/iv/src/lib'
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c IV-X11/xwindow.cpp -fPIC -DPIC -o IV-X11/.libs/xwindow.o
In file included from IV-X11/xwindow.cpp:50:0:
../include/IV-X11/Xext.h:44:33: fatal error: X11/extensions/Xext.h: No such file or directory
compilation terminated.
make[2]: *** [IV-X11/xwindow.lo] Error 1
make[2]: Leaving directory `/home/zara2/neuron/iv/src/lib'
Making all in include
make[2]: Entering directory `/home/zara2/neuron/iv/src/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/zara2/neuron/iv/src/include'
Making all in bin
make[2]: Entering directory `/home/zara2/neuron/iv/src/bin'
Making all in iclass
make[3]: Entering directory `/home/zara2/neuron/iv/src/bin/iclass'
/bin/bash ../../../libtool --mode=link g++ -g -O2 -o iclass classbuffer.o classeditor.o classinfo.o dialogs.o direct.o globals.o iclass.o main.o ../../lib/libIVhines.la ../../lib/libUnidrawhines.la -lX11 -lXext -lm
libtool: link: cannot find the library `../../lib/libIVhines.la' or unhandled argument `../../lib/libIVhines.la'
make[3]: *** [iclass] Error 1
make[3]: Leaving directory `/home/zara2/neuron/iv/src/bin/iclass'
Making all in idemo
make[3]: Entering directory `/home/zara2/neuron/iv/src/bin/idemo'
/bin/bash ../../../libtool --mode=link g++ -g -O2 -o idemo main.o ../../lib/libUnidrawhines.la ../../lib/libIVhines.la -lX11 -lXext -lm
libtool: link: cannot find the library `../../lib/libUnidrawhines.la' or unhandled argument `../../lib/libUnidrawhines.la'
make[3]: *** [idemo] Error 1
make[3]: Leaving directory `/home/zara2/neuron/iv/src/bin/idemo'
Making all in idraw
make[3]: Entering directory `/home/zara2/neuron/iv/src/bin/idraw'
/bin/bash ../../../libtool --mode=link g++ -g -O2 -o idraw idarrow.o idarrowhead.o idarrows.o idcatalog.o idcmds.o idcomp.o idcreator.o iddialogs.o ided.o idkybd.o idvars.o main.o ../../lib/libUnidrawhines.la ../../lib/libIVhines.la -lX11 -lXext -lm
libtool: link: cannot find the library `../../lib/libUnidrawhines.la' or unhandled argument `../../lib/libUnidrawhines.la'
make[3]: *** [idraw] Error 1
make[3]: Leaving directory `/home/zara2/neuron/iv/src/bin/idraw'
make[2]: Leaving directory `/home/zara2/neuron/iv/src/bin'
make[1]: Leaving directory `/home/zara2/neuron/iv/src'


In the directory:
/home/zara2/neuron/iv/include/IV-X11
I can see the file:
Xext.h
but not the directory: X11/extensions/

Perhaps under normal compilation the code makes this directory?

Do you think I have the wrong cpp compiler packages installed?
Thanks for any help.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: how config mpich2 on a standalone PC?

Post by hines »

Don't worry about those autotools warnings. If I get rid of them with one version, other warnings appear in other versions of autotools.

The problem is missing x11 extensions library. On ubuntu, I install them with
sudo apt-get libxext-dev. In fact I install the following for my development environment. Don't know if some are redundant.

sudo apt-get install mercurial bison flex automake libtool g++ rpm
sudo apt-get install libxext-dev libncurses-dev python-dev
sudo apt-get install cython alien
sudo apt-get install xfonts-100dpi
Post Reply