OpenMP

Submit New Article

March 9, 2009 1:00 AM PDT



OpenMP samples

 

These samples can be downloaded from Open MP Source code repository in SourceForge. 

Also refer to  OpenMP specifications in openmp.org.

 

List of samples in the above site from SourceForge:

 

  1. Solve a finite difference discretization of Helmholtz equation using Jacobi iterative method.
  2. Molecular dynamics simulation
  3. Fast Fourier Transform - The algorithm uses a divide and conquer strategy and the transform is computed as a combination of the transforms of the even and odd terms of the original signal.  Uses nested Parallelism.
  4. Bailey's 6-step 1D Fast Fourier Transform
  5. Loop with dependencies

 

Parallelizing an inner loop with dependences - Forward dependency (pipeline)

for (iter=0; iter<numiter; iter++) {
for (i=0; i<size-1; i++) {
V[i] = f( V[i], V[i-1] );
}
}

 

Method: Program a threads pipeline

  1. LU reduction of a 2D dense matrix
  2. Mandelbrot area - computes an estimation to the Mandelbrot Set area using MonteCarlo sampling.
  3. Parallel implementation of PI generator using OpenMP - The area under the curve y=4/(1+x*x) between 0 and 1 provides a way to compute Pi.  The value of this integral can be approximated using a sum.
  4. Parallel implementation of Quicksort using OpenMP - Sorts an integer array.  The code requires nested Parallelism.
  5. Eight different solutions of the Jacobi heat equation.   The solutions differ on how the series one parallel sections are handled and synchronized.