OpenMP Microbenchmarks
[OpenMP Microbenchmarks] [Research at EPCC] [EPCC Sun Web pages]

About the benchmarks

These microbenchmarks are intended to measure the overheads of synchronisation, loop scheduling and array operations in the OpenMP runtime library.

The first part of the synchronisation benchmark measures the overhead incurred by the following directives, all of which contain barrier synchronisation: PARALLEL(with and without a REDUCTION clause), DO/for, PARALLEL DO/parallel for, BARRIER, SINGLE, WORKSHARE and PARALLEL WORKSHARE. Note that both WORKSHARE and PARALLEL WORKSHARE are Fortran specific OpenMP 2.0 directives.

The overhead is defined as follows: if Ts is the sequential time for a section of code, and Tp the time for the parallel version of this on p processors, then the overhead is given by Op = Tp - Ts/p.

To measure the overhead of the PARALLEL directive, for example, we subtract the time taken for

do i=1,reps
   call dummy()
end do
from the time taken for
do i=1,reps
!$OMP PARALLEL
   call dummy()
!$OMP END PARALLEL
end do 
where dummy is a routine which contains a dummy loop. We choose the lengths of the dummy and repeat loops to give sensible times which can be subtracted without loss of too much precision or accuracy. Multiple measurements are taken within a run and multiple runs are executed and the times averaged over all these.

The second part of the synchronisation benchmark compares the costs of the mutual exclusion mechanisms in OpenMP: CRITICAL directive, ATOMIC directive, ORDERED directive and omp_set_lock()/omp_unset_lock().

The loop scheduling benchmark compares the overheads of the DO/for directive using different scheduling options and chunk sizes. To give a "fair" comparison the length of the dummy loop is tuned so that it requires (approximately) the same number of clock cycles on each machine. The parallel loop here has (no. of threads) * 128 iterations.

The array benchmark compares the overheads associated with various clauses when applied to arrays. The clauses considered are: PRIVATE, FIRSTPRIVATE, COPYPRIVATE, COPYIN and REDUCTION. A number of executables are generated for the array benchmark so that the variation of overheads with array size can be examined. Separate executables are used as dynamically allocated arrays are not permitted in some of the clauses. Note, that the use of arrays in the REDUCTION clause is a Fortran OpenMP 2.0 feature and so is not available in the C version of the code.

E.g. to measure the overhead of the COPYIN array directive, we subtract the time taken for

do i=1,reps
   call dummy(a)
end do
from the time taken for
do i=1,reps
!$OMP PARALLEL COPYIN(a)
   call dummy(a)
!$OMP END PARALLEL
end do 
where dummy is a routine which contains a dummy loop performing a simple operations on the array a. For the COPYIN and COPYPRIVATE clauses, the array passed to dummy must be declared as THREADPRIVATE.

For more details please see the publications page.
Webpage maintained by www@epcc.ed.ac.uk

acquires locka and \