multitask_openmp


multitask_openmp, a Fortran90 code which demonstrates how to "multitask", that is, to execute several unrelated and distinct tasks simultaneously, using OpenMP for parallel execution.

This program demonstrates how OpenMP can be used for multitasking, that is, a simple kind of parallel processing in which a certain number of perhaps quite unrelated tasks must be done.

The OpenMP SECTIONS directive identifies the portion of the program where the code for these tasks is given.

The OpenMP SECTION directive is used repeatedly to divide this area of the program into independent tasks.

The code will get the benefit of parallel processing up to the point where there are as many threads as there are tasks.

The code will get a substantial speedup if the tasks take roughly the same amount of time. However, if one task takes substantially more time than the others, this results in a limit to the parallel speedup that is possible.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

multitask_openmp is available in a C version and a C++ version and a Fortran90 version.

Related Data and Programs:

multitask_openmp_test

openmp_test, a Fortran90 code which uses the OpenMP application code interface for carrying out parallel computations in a shared memory environment.

Reference:

  1. Peter Arbenz, Wesley Petersen,
    Introduction to Parallel Computing - A practical guide with examples in C,
    Oxford University Press,
    ISBN: 0-19-851576-6,
    LC: QA76.58.P47.
  2. 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.
  3. Barbara Chapman, Gabriele Jost, Ruud vanderPas, David Kuck,
    Using OpenMP: Portable Shared Memory Parallel Processing,
    MIT Press, 2007,
    ISBN13: 978-0262533027.
  4. OpenMP Architecture Review Board,
    OpenMP Application Program Interface,
    Version 3.0,
    May 2008.

Source Code:


Last revised on 25 March 2023.