If you're not sure what an MPI program is, then skip down to the next section.
Before compiling an MPI program, you need to set two environment variables:
MPIENV,
which indicates
the family of compilers that you're using
(ENV is short for "environment");
MPIDEV,
which indicates
the kind of communication that you're using
(DEV is short for "device").
MPIENV
MPIENV
to are:
intel
or
intel9
ifort (formerly known as ifc)
for Fortran 77/90/95,
or
icc for C/C++.
intel
and
intel9
refer to ifort and icc version 9.0.
gnu
or
gcc
g77,
gcc,
g++,
version 3.2.3.
g95 and gfortran have been partially released,
but are not yet installed on schooner.
MPIDEV
MPIDEV
to are:
ib
p4
shmem
How to set these environment variables depends on which shell program you are using. If you're not sure which shell program you're using (or if you're not sure what a "shell" program is), then type this at the Unix prompt and then press the "Enter" key:
ps
The response will look something like this:
PID TTY TIME CMD 28826 pts/19 00:00:00 tcsh 30567 pts/19 00:00:00 ps
If your shell is tcsh then to set the environment variables,
type this at the Unix prompt:
setenv MPIENV intel setenv MPIDEV ib
If your shell is bash or ksh or zsh,
then to set the environment variables,
type this at the Unix prompt:
export MPIENV=intel export MPIDEV=ib
If your shell is "sh" then to set the environment variables, type this at the Unix prompt:
MPIENV=intel MPIDEV=ib export MPIENV export MPIDEV
To Compile an MPI Program:
Now, to compile your MPI program, you need only use only of the following compiler names, as follows:mpif90.
mpif77.
mpicc.
mpiCC.
MPIENV.
Each family of compilers has its own unique compiler options; you can find complete lists both in their man pages and in their full manuals.
So, the following are merely the recommended options for reasonably vanilla source codes.
-O -tpp2 -ftz
-O
Except for very small, very brief non-MPI runs on 1 or 2 CPUs within a single node, all runs should be performed using the LSF batch queue system.
To start, you'll want to get a copy of one of the following files:
~hneeman/example_1node.bsub
~hneeman/example_mpi.bsub
~hneeman/example_mpi_ppn1.bsub
~hneeman/example_mpi_gige.bsub
~hneeman/example_mpi_ppn1_gige.bsub
Once you've identified which file to use, do this:
cp ~hneeman/example_1node.bsub whatever.bsub
where
whatever.bsub
is the name of the batch script file that you want to create
--
typically,
you'll replace
whatever
with the name of your executable or the experiment or something.
You should be able to modify this file to suit your needs. It contains detailed information about how to set up and run a job.
IMPORTANT NOTE!!!
You MUST
use the absolute FULL PATH
for your executable!
DON'T
use a relative path nor leave out the path!
To run a non-MPI program,
do as above with example_1node.bsub.