Skip redundant pieces
ITTC Bioinformatics Cluster

Note: FAQ Database is still being populated.

FAQs/Howto / MPICH2

Search:
How do I compile a parallel program using mpi ?

How do I compile a parallel program using mpi ?
Association: MPICH2 - Posted on: 2009-04-29
Associated File: Parallel Hello world program
To compile a parallel program using mpi, you use the following commands, which are found in your path.

mpicc -> C compiler/linker
mpicxx -> C++ compiler/linker
mpif77 -> Fortran 77 compiler/linker
mpif90 -> Fortran 90 compiler/linker

Example:
mpicc program_name.c -> will compile program using pgcc, the binary will be called a.out
mpicc hello.c -> will give you an a.out, that when ran will give you "Process # 0: hostname: compute-1-0.local" for each machine it is ran on.
How do I run a job ? will explain how to submit/run a job.

The default MPI commands were compiled with the current 64-bit version of PGI and with GCC. Two MPI implementations are installed, MPICH and MVAPICH. The path for each compiler is set by using mpi-selector. The MPICH PGI compiler path is set by default. To view or set the correct MPI implementation, type:

mpi-selector-menu

sample output:
[user@firefox ~]$ mpi-selector-menu
Current system default:
Current user default: mpich_pgi

"u" and "s" modifiers can be added to numeric and "U"
commands to specify "user" or "system-wide".

1. mpich_gcc
2. mpich_pgi
3. mvapich_gcc
4. mvapich_pgi
U. Unset default
Q. Quit

Selection (1-4[us], U[us], Q): 4u
Defaults already exist; overwrite them? (y/N) y

WARNING: Changes made to mpi-selector defaults will not be visible until you start a new shell!

More information can be found in the software section of the webpage regaurding the versions available.