[mpich-discuss] install mpich2 on a single pc with 2 cpus

Gus Correa gus at ldeo.columbia.edu
Wed Jul 2 20:35:10 CDT 2008


Hello Seungho and list

I assume your RedHat Linux is using the SMP kernel (i.e. symmetric 
multi-processor).
Check this out with "uname -a", which should print a string containing 
"smp".

In a dual processor machine running the smp Linux kernel
I installed mpich2 with the "communication devices" shm (shared memory) 
and nemesis. 
Both work well in a single machine with multiple processors, including 
multi-core processors.

For instance, I use both shm and nemesis (with different programs) in a 
dual-core dual-processor machine,
and it looks as four actual processors.
Beware that speedup in multi-core machines is not really linear w.r.t. 
the number of cores!

You can use either one: shm or nemesis.
Even the ch3:ssm (shared memory + sockets) and ch3:sock (sockets) 
devices would work,
but they are probably not the best for a single machine with SMP.

You should read the MPICH Installer's Guide (at least section 4 for 
"devices"), available on the MPICH2 site,
and also the configure options (do a "./configure --help" on the main 
mpich2 directory).

Below is a short script I used to configure mpich2
with the ch3:shm device, gcc, and the Intel Fortran compiler in the 
Linux machine I mentioned above.

If you have the PGI Fortran compiler, replace "ifort" by "pgf90".
I never used the gfortran free compiler, but it may work.
If you only have the Gnu g77 Fortran compiler,
remove the "env" line, and it will configure only the
C, and Fortran77 interfaces, but not the Fortran90 one.
To change the "device" replace ch3:shm by
ch3.nemesis or other.

#! /bin/tcsh
env F77=ifort F90=ifort \
./configure \
-prefix=/your/installation/directory \
--with-device=ch3:shm \
| & tee configure.log

To avoid frustration when you try to run your first program,
first read the Installer's Guide section 5, to learn how to use the mpd 
daemon.
It is easy in a single machine.

If your machine has two CPUs but they aren't multi-core,
run the programs with "mpiexec -n 2".
If the CPUs are dual-core you can go up to "-n 4".
If they are quad-core you can go up to "-n 8".

I hope this helps.
Gus Correa

-- 
---------------------------------------------------------------------
Gustavo J. Ponce Correa, PhD - Email: gus at ldeo.columbia.edu
Lamont-Doherty Earth Observatory - Columbia University
P.O. Box 1000 [61 Route 9W] - Palisades, NY, 10964-8000 - USA
Oceanography Bldg., Rm. 103-D, ph. (845) 365-8911, fax (845) 365-8736
---------------------------------------------------------------------







Seungho Choe wrote:

> Dear All,
>
> I'm a very new in mpi.  I need your help.
> I'm trying to install mpich2 on a single computer (os: redhat linux)  
> which has 2 cpus.
> What kind of installation options do I need so that I can use 2 cpus ?
>
> Thanks.
>
>
>




More information about the mpich-discuss mailing list