OPEN_MP_SGI
C Programs Using OpenMP on Virginia Tech's SGI Systems


OPEN_MP_SGI is a directory of examples that show the results of running various C programs on the Virginia Tech SGI systems, with the OpenMP system for parallel programming on shared memory machines.

In general, the programs were compiled with a command like:

icc -openmp compute_pi.c
and then the number of threads were declared by
export OMP_NUM_THREADS=4
for the Bourne, Korn or Bash shells, or
setenv OMP_NUM_THREADS 4
for the C or T shells, and then the program was run with a command like
compute_pi > compute_pi_output.txt

Related Data and Programs:

MPI is a library of routines which enables parallel programming in a distributed memory environment, using message passing.

OPEN_MP is a directory of C examples which illustrate the use of the OpenMP application program interface for carrying out parallel computations in a shared memory environment.

OPEN_MP_STUBS is a C library which implements a "stub" version of OpenMP, so that an OpenMP program can be compiled, linked and executed on a system that does not have OpenMP installed.

OPEN_MP_SGI examples are also available in a C++ version and a FORTRAN77 version and a FORTRAN90 version.

PETSC is a scientific library which can be used parallel computations.

USING_OPEN_MP_SGI is an HTML document which describes how to start with an Open MP program on your home machine, transfer it to one of the Virginia Tech SGI systems, compile it, run it, and retrieve the output.

Reference:

  1. Rohit Chandra, Leonardo Dagum, Dave Kohr, Dror Maydan, Jeff McDonald, Ramesh Menon,
    Parallel Programming in OpenMP,
    Morgan Kaufmann, 2001,
    ISBN: 1-55860-671-8,
    LC: QA76.642.P32.
  2. Barbara Chapman, Gabriele Jost, Ruud vanderPas, David Kuck,
    Using OpenMP: Portable Shared Memory Parallel Processing,
    MIT Press, 2007,
    ISBN13: 978-0262533027.
  3. Tim Mattson, Rudolf Eigenmann,
    OpenMP: An API for Writing Portable SMP Application Software,
    a slide presentation,
    open_mp_slides.pdf.
  4. libgomp.pdf,
    The GNU OpenMP Implementation.
  5. The OpenMP web site
  6. OpenMP Application Program Interface,
    Version 2.5,
    May 2005,
    open_mp_2.5.pdf

Examples and Tests:

COMPUTE_PI shows how information can be shared. Several processors need to compute pieces of a sum that will approximate pi.

CONDITIONAL shows how parts of a program can be marked with OpenMP "sentinels", for conditional compilation, so that the same code may be compiled sequentially or with OpenMP.

HELLO is a very simple program which calls an OpenMP subroutine to set the number of threads, and then has each thread say hello;

HELMHOLTZ is a more extensive program that solves the Helmholtz equation on a regular grid, using a Jacobi iterative linear equation solver with overrelaxation;

MD is a time dependent molecular dynamics code;

ROLLCALL simply has each parallel thread print out its identifier. The text of the program shows how a parallel section can be marked, how to get the ID of a thread, and how to comment out a bit of code that should only run if the code has been compiled with OpenMP;

You can go up one level to the C source codes.


Last revised on 13 December 2007.