12.0-MPI_Examples

12.0-MPI_Examples - MPI_Comm_size (MPI_COMM_WORLD,...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
MPI Examples Submitting Jobs and compiling
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Accessing Hogwarts You access the Hogwarts cluster through the head node Dumbledore. ssh [email protected]
Background image of page 2
Create a Bash Profile In your home directory create a bash profile file called “.bash_profile” Use the following code in the file export PATH=/opt/openmpi-1.3.3/bin:$PATH export LD_LIBRARY_PATH=/opt/openmpi- 1.3.3/lib:$LD_LIBRARY_PATH export OMPI_MCA-mpi_yield_when_idle=0 Once you have created this file, log out and log back in. This file creates the path connections for the compiling and running of mpi code. The next steps won’t work without it.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Simple Example Code #include <stdio.h> #include <mpi.h> int main(int argc, char* argv[]) { int rank, size; MPI_Init (&argc, &argv); MPI_Comm_rank (MPI_COMM_WORLD, &rank);
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: MPI_Comm_size (MPI_COMM_WORLD, &size); Printf(“Hello world from process %d of %d \ n”, rank, size); MPI_Finalize(); return 0; } Compiling mpicc example.c – o example.exe Job Submission Create a Wrapper Script to run “example.exe” • I will call it “exampleWrapper.sh” #PBS -q class #PBS -l nodes=1 #PBS -l walltime=00:05:00 #PBS -N MyJobName /opt/openmpi-1.3.3/bin/mpirun --hostfile $PBS_NODEFILE – np 48 example.exe Call using • qsub ./exampleWrapper.sh Running an Interactive Job qsub -I -q class -l nodes=1 /opt/openmpi-1.3.3/bin/mpirun --hostfile $PBS_NODEFILE – np 48 example.exe For More Instructions <http://support.cc.gatech.edu/faciliti es/instructional-labs/how-to-access-the-hogwarts-cluster>...
View Full Document

This note was uploaded on 11/04/2010 for the course CSE 6530 taught by Professor Jeffreyvetter during the Fall '10 term at Georgia Tech.

Page1 / 8

12.0-MPI_Examples - MPI_Comm_size (MPI_COMM_WORLD,...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online