[mpich-discuss] Parallel Jobs

Gus Correa gus at ldeo.columbia.edu
Fri Dec 17 10:42:17 CST 2010


Talla wrote:
> Hello
> Thank you very much for the detailed instructions. However, I am still 
> lost in this (I am just a beginner), do you have an example of .bashrc 
> file? and where exactely this file should be placed (I mean in the root 
> dir or on my home dir.?). because I think it is all about this file (I 
> feel something missing in it?) I am attaching a copy of that file so you 
> may have some idea what is going on.
> 
> Thank you very much,
> 
> On Fri, Dec 17, 2010 at 12:36 AM, Gus Correa <gus at ldeo.columbia.edu 
> <mailto:gus at ldeo.columbia.edu>> wrote:
> 
>     Talla wrote:
> 
>         Hello;
>         I build a cluster using Rocks/Open CentOS and I need to perform
>         a parallel jobn it, therefore I am looking for complete
>         instructions how to set up MPICH to get it run correctly as I am
>         struggling with it for  while.
> 
>         Your help is really appreciated, Cordially.
> 
>     Hi
> 
>     I may have answered you in the Rocks list already.
>     Anyway, there it goes again.
> 
>     0) READ the MPICH2 Installation Guide and User Guide first.
>     There are complete instructions there.
>     Did you read them?
> 
>     1) Install one (ONLY ONE) of the resource manager rolls: SGE or Torque.
>     (I use and prefer Torque, which is simpler, but other people love SGE.)
> 
>     2) Download the latest greatest MPICH2 tarball to
>     /share/apps/mydownloads, and untar it (tar -zxvf mpich2-... ).
>     Configure and install MPICH2 on /share/apps/mpich2.
>     You can use gcc, g++, and gfortran compilers for this,
>     something like this:
> 
>     configure --prefix=/share/apps/mpich2 CC=gcc CXX=g++ F77=gfortran
>     F90=gfortran
>     make
>     make install
> 
>     3) Set the environment varialbles in your .cshrc or .bashrc file
>     (as a regular user, NOT root), so that:
> 
>     /share/apps/mpich2/bin is first in your PATH,
>     /share/apps/mpich2/share/man is first in your MANPATH,
>     /share/apps/mpich2/lib is first in your LD_LIBRARY_PATH.
> 
>     4) Compile the cpi.c example in the "examples"
>     directory in the MPICH2 *distribution* directory
>     (i.e. /share/apps/mydownloads/mpich2-.../examples)
>     using mpicc
> 
>     mpicc -o cpi cpi.c
> 
>     5) Write a job submission script for it.
>     Here is one for Torque:
> 
>     #PBS -N cpi
>     #PBS -q default
>     #PBS -l nodes=2:ppn=4  #example asking for 2 nodes with 4 cores each
> 
>     mpiexec.hydra -f $PBS_NODEFILE -np 8 cpi
> 
>     6) Alternatively, if you don't want to use Torque or SGE, create a
>     "mynodefile" according to the MPICH2, and launch the job
>     directly on the command line:
> 
>     mpiexec.hydra -f mynodefile -np 8 cpi
> 
>     Also
> 
>     mpiexec.hydra --help
> 
>     will give you a lot of information about it.
> 
>     Good luck
>     Gus Correa
> 
> 
>     _______________________________________________
>     mpich-discuss mailing list
>     mpich-discuss at mcs.anl.gov <mailto:mpich-discuss at mcs.anl.gov>
>     https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> 
> 
> 
> 
> 

Hi Talla

Note that this is not really MPI, or MPICH, but Linux.
So this list is not the best place for these questions.
I will answer this one, but no more, to keep the list etiquette,
and focus on MPICH.

Actually, some of this stuff has been covered many times on
questions and answers posted in the Rocks mailing list.
If you are really interested, you can search their mailing list
archives and you will certainly find useful information.
The solution via .bashrc/.tcshrc is OK, but there are others.

I suggest that to google around the Internet to learn a bit
about setting up your Linux environment.
Have you tried to google for ".bashrc"?
There is a lot of information out there.

Another good resource for CentOS is the RedHat documentation,
also available in the CentOS site (CentOS is kind of a clone of RedHat):

http://www.centos.org/docs/5/

Take a look at the CentOS 5.2 Deployment Guide,
maybe also at the Installation Guide (although Rocks takes care of this)
They are OK even if you have a later version of CentOS.
There is *a lot* of information there.

I assume you are using bash, not tcsh, right?

Here is a bare bones .bashrc, although I included some
MPICH stuff.
You need to edit and
adapt to your specific situation.

Put the in your home directory, e.g., /home/talla
You can also put a copy in /etc/skel, so that whenever you
insert a new user, [s]he will get the same .bashrc

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

export PATH=${PATH}:/usr/X11R6/bin
export PATH=${PATH}:${HOME}/bin

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# MPICH2 environment

export PATH=/share/apps/mpich2/bin:${PATH}
if [ "x${MANPATH}" = "x" ]; then
     export MANPATH="/share/apps/mpich2/share/man:`man -w`"
else
     export MANPATH="/share/apps/mpich2/share/man:${MANPATH}"
fi
export LD_LIBRARY_PATH="/share/apps/mpich2/lib"


Actually, I just noticed that you send the .bashrc you already have.
In this case, you can append the parts that are not repeated to
the end of the file that you already have.

However, you need to cleanup and fix your current "export" commands.

Remove the references to /opt/mpich2/gnu/... *if* you are installed
MPICH2 in /share/apps.
This is probably mixing two different installations of MPICH2.

Note also that PATH is for "bin" directories, where the executables are.
LD_LIBRARY_PATH is for "lib" directories where there are shared libraries.
You are mixing them!

In addtion, the "include" directories are for header files that are used
during compilation, but are not executables or libraries.
Hence, they should not appear there.

Moreover, things prefixed with DYLD_ and CPATH
are typically not for Linux, you can remove them.

For the "Scienomics", whatever it is (I don't know) you probably
need only the line
export PATH=/share/apps/Scienomics/MAPS-3.2/bin:$PATH
However, make sure /share/apps/Scienomics/MAPS-3.2/bin really exists!

The mixup in your .bashrc may explain some of the problems you have,
but maybe not all problems.
You need to fix it.

Good luck,
Gus Correa


More information about the mpich-discuss mailing list