multitask_openmp, a C++ 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.
The information on this web page is distributed under the MIT license.
multitask_openmp is available in a C version and a C++ version and a Fortran90 version.
multitask_mpi, a C++ code which demonstrates how to multitask, that is, to execute several unrelated and distinct tasks simultaneously, using MPI for parallel execution.
openmp_test, a C++ code which uses the OpenMP application program interface for parallel computations in a shared memory environment.