Simple UserGuide for MPICH2

From SpeechWiki

(Difference between revisions)
Jump to: navigation, search
(Using MPI with qsub on ifp-32)
 
(10 intermediate revisions not shown)
Line 1: Line 1:
-
=MPICH on ifp-32=
+
=MPICH2 on ifp-32=
 +
Version and configure information:
-
=Example=
+
[pineking@ifp-32 mpich2]$ mpich2version
 +
MPICH2 Version:        1.2.1
 +
MPICH2 Release date:    Unknown, built on Sun Jan 10 18:06:02 CST 2010
 +
MPICH2 Device:          ch3:nemesis
 +
MPICH2 configure:      --prefix=/cworkspace/ifp-32-2/hasegawa/pineking/programs/mpich2/ --enable-cxx --enable-threads=multiple
 +
MPICH2 CC:      gcc  -O2
 +
MPICH2 CXX:    g++  -O2
 +
MPICH2 F77:    gfortran  -O2
 +
MPICH2 F90:    f95  -O2
 +
 
 +
Parallel environment on SGE:
 +
 
 +
[pineking@ifp-32 test]$ qconf -sp mpich
 +
pe_name            mpich
 +
slots              9999
 +
user_lists        NONE
 +
xuser_lists        NONE
 +
start_proc_args    /opt/gridengine/mpi/startmpi.sh -catch_rsh $pe_hostfile
 +
stop_proc_args    /opt/gridengine/mpi/stopmpi.sh
 +
allocation_rule    $fill_up
 +
control_slaves    TRUE
 +
job_is_first_task  FALSE
 +
urgency_slots      min
 +
accounting_summary TRUE
 +
 
 +
=Users=
 +
 
 +
 
 +
* '''add MPICH2 binary path to your PATH'''
 +
export PATH=/cworkspace/ifp-32-2/hasegawa/pineking/programs/mpich2/bin:$PATH
 +
Check we can find them:
 +
which mpd
 +
which mpiexec
 +
which mpirun
 +
 
 +
 
 +
* '''.mpd.conf'''
 +
MPI expects the configuration file in your home directory named ~/.mpd.conf (/etc/mpd.conf if root). It should contain one line:
 +
secretword=<secretword>
 +
 
 +
where <secretword> is a password, that should not be your user password. Make it readable/writable only by you:
 +
chmod 600 .mpd.conf
 +
 
 +
* '''check mpd daemon'''
 +
[pineking@ifp-32 test]$ mpdtrace
 +
ifp-32
 +
compute-1-14
 +
compute-1-13
 +
compute-1-11
 +
compute-1-8
 +
compute-1-12
 +
compute-1-2
 +
compute-1-16
 +
compute-1-15
 +
compute-1-7
 +
compute-1-6
 +
compute-1-1
 +
compute-1-10
 +
compute-1-9
 +
compute-1-3
 +
compute-1-5
 +
compute-1-4
 +
 
 +
The information above show that mpd daemon is already run on each node.
 +
 
 +
* '''run a MPI program to check the parallel environment'''
 +
 
 +
[pineking@ifp-32 test]$ mpiexec -l -n 4 ./cpi
 +
0: Process 0 on ifp-32.ifp.uiuc.edu
 +
1: Process 1 on compute-1-14.local
 +
2: Process 2 on compute-1-13.local
 +
3: Process 3 on compute-1-11.local
 +
0: pi is approximately 3.1416009869231249, Error is 0.0000083333333318
 +
0: wall clock time = 0.005698
=Using MPI with qsub on ifp-32=
=Using MPI with qsub on ifp-32=
 +
* '''Create a bash file''', such as:
 +
#!/bin/bash
 +
#$ -cwd
 +
#$ -pe mpich 4
 +
 +
/cworkspace/ifp-32-2/hasegawa/pineking/programs/mpich2/bin/mpiexec -n 3 ./cpi
 +
 +
and submit:
 +
 +
[pineking@ifp-32 test]$ qsub test.sh
 +
Your job 283054 ("test.sh") has been submitted
 +
[pineking@ifp-32 test]$ qstat -u pineking
 +
job-ID  prior  name      user        state submit/start at    queue                          slots ja-task-ID
 +
-----------------------------------------------------------------------------------------------------------------
 +
  283054 0.60167 test.sh    pineking    r    05/02/2010 19:23:10 all.q@compute-1-7.local            4
 +
 +
some log files are generated:
 +
 +
[pineking@ifp-32 test]$ ll test.sh.*
 +
-rw-r--r-- 1 pineking hasegawa  93 May  2 19:23 test.sh.e283054
 +
-rw-r--r-- 1 pineking hasegawa 179 May  2 19:23 test.sh.o283054
 +
-rw-r--r-- 1 pineking hasegawa  0 May  2 19:23 test.sh.pe283054
 +
-rw-r--r-- 1 pineking hasegawa 134 May  2 19:23 test.sh.po283054
 +
 +
=Administrators=
 +
 +
* '''MPI host file: mpd.hosts'''
 +
Create a host file named "mpd.hosts" in your home directory  ~/mpd.hosts , it contains the hosts list, such as:
 +
compute-1-1
 +
compute-1-2
 +
compute-1-3
 +
compute-1-4
 +
compute-1-5
 +
compute-1-6
 +
compute-1-7
 +
compute-1-8
 +
compute-1-9
 +
compute-1-10
 +
compute-1-11
 +
compute-1-12
 +
compute-1-13
 +
compute-1-14
 +
compute-1-15
 +
compute-1-16
 +
 +
 +
 +
 +
-
=More Details=
+
=Reference=
 +
# [http://www.mcs.anl.gov/research/projects/mpich2/ MPICH2 website]
 +
# [http://www.mcs.anl.gov/research/projects/mpich2/documentation/files/mpich2-1.2.1-installguide.pdf MPICH2 Installer's Guide]
 +
# [http://www.mcs.anl.gov/research/projects/mpich2/documentation/files/mpich2-1.2.1-userguide.pdf MPICH2 User's Guide]
 +
# [http://gridengine.sunsource.net/howto/mpich2-integration/mpich2-integration.html http://gridengine.sunsource.net/howto/mpich2-integration/mpich2-integration.html]

Latest revision as of 00:31, 3 May 2010

Contents

MPICH2 on ifp-32

Version and configure information:

[pineking@ifp-32 mpich2]$ mpich2version
MPICH2 Version:         1.2.1
MPICH2 Release date:    Unknown, built on Sun Jan 10 18:06:02 CST 2010
MPICH2 Device:          ch3:nemesis
MPICH2 configure:       --prefix=/cworkspace/ifp-32-2/hasegawa/pineking/programs/mpich2/ --enable-cxx --enable-threads=multiple
MPICH2 CC:      gcc  -O2
MPICH2 CXX:     g++  -O2
MPICH2 F77:     gfortran  -O2
MPICH2 F90:     f95  -O2

Parallel environment on SGE:

[pineking@ifp-32 test]$ qconf -sp mpich
pe_name            mpich
slots              9999 
user_lists         NONE
xuser_lists        NONE
start_proc_args    /opt/gridengine/mpi/startmpi.sh -catch_rsh $pe_hostfile
stop_proc_args     /opt/gridengine/mpi/stopmpi.sh
allocation_rule    $fill_up
control_slaves     TRUE
job_is_first_task  FALSE 
urgency_slots      min
accounting_summary TRUE

Users

  • add MPICH2 binary path to your PATH
export PATH=/cworkspace/ifp-32-2/hasegawa/pineking/programs/mpich2/bin:$PATH

Check we can find them:

which mpd
which mpiexec
which mpirun


  • .mpd.conf

MPI expects the configuration file in your home directory named ~/.mpd.conf (/etc/mpd.conf if root). It should contain one line:

secretword=<secretword>

where <secretword> is a password, that should not be your user password. Make it readable/writable only by you:

chmod 600 .mpd.conf
  • check mpd daemon

[pineking@ifp-32 test]$ mpdtrace

ifp-32
compute-1-14
compute-1-13
compute-1-11
compute-1-8
compute-1-12
compute-1-2
compute-1-16
compute-1-15
compute-1-7
compute-1-6
compute-1-1
compute-1-10
compute-1-9
compute-1-3
compute-1-5
compute-1-4

The information above show that mpd daemon is already run on each node.

  • run a MPI program to check the parallel environment
[pineking@ifp-32 test]$ mpiexec -l -n 4 ./cpi
0: Process 0 on ifp-32.ifp.uiuc.edu
1: Process 1 on compute-1-14.local
2: Process 2 on compute-1-13.local
3: Process 3 on compute-1-11.local
0: pi is approximately 3.1416009869231249, Error is 0.0000083333333318
0: wall clock time = 0.005698

Using MPI with qsub on ifp-32

  • Create a bash file, such as:
#!/bin/bash
#$ -cwd
#$ -pe mpich 4

/cworkspace/ifp-32-2/hasegawa/pineking/programs/mpich2/bin/mpiexec -n 3 ./cpi

and submit:

[pineking@ifp-32 test]$ qsub test.sh
Your job 283054 ("test.sh") has been submitted
[pineking@ifp-32 test]$ qstat -u pineking
job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
 283054 0.60167 test.sh    pineking     r     05/02/2010 19:23:10 all.q@compute-1-7.local            4

some log files are generated:

[pineking@ifp-32 test]$ ll test.sh.*
-rw-r--r-- 1 pineking hasegawa  93 May  2 19:23 test.sh.e283054
-rw-r--r-- 1 pineking hasegawa 179 May  2 19:23 test.sh.o283054
-rw-r--r-- 1 pineking hasegawa   0 May  2 19:23 test.sh.pe283054
-rw-r--r-- 1 pineking hasegawa 134 May  2 19:23 test.sh.po283054

Administrators

  • MPI host file: mpd.hosts

Create a host file named "mpd.hosts" in your home directory ~/mpd.hosts , it contains the hosts list, such as:

compute-1-1
compute-1-2
compute-1-3
compute-1-4
compute-1-5
compute-1-6
compute-1-7
compute-1-8
compute-1-9
compute-1-10
compute-1-11
compute-1-12
compute-1-13
compute-1-14
compute-1-15
compute-1-16




Reference

  1. MPICH2 website
  2. MPICH2 Installer's Guide
  3. MPICH2 User's Guide
  4. http://gridengine.sunsource.net/howto/mpich2-integration/mpich2-integration.html
Personal tools