random_openmp, a Fortran90 code which uses random numbers during a calculation that has been parallelized with OpenMP.
The random numbers are generated by a function which depends on a user-defined integer called SEED. When multiple OpenMP threads are involved, each thread should be assigned a different initial value for SEED, in order that the threads generate distinct streams of random numbers. This example shows one way that that can be done.
The information on this web page is distributed under the MIT license.
random_openmp is available in a C version and a C++ version and a Fortran90 version.
openmp_test, a Fortran90 code which uses the OpenMP application code interface for carrying out parallel computations in a shared memory environment.