Calculating PI Value In Different Parallel Framework.
We use mid-rectangle method to calculate the integration, which includes loops that may be optimized using parallel computing methods.
Use pthread
as the parallel framework.
Use OpenMP
as the parallel framework to calculate, note that in macOS the default clang
does not support OpenMP
, thus it needs to be built with gcc
or clang-omp
.
gcc-6
could be directly installed by
brew install gcc --without-multilib
and clang-omp
could be installed via
brew install clang-omp
Use MPI
as the parallel framework.
Use CUDA
to optimize the parallel computing process, which must be run under CUDA environment. i.e., you must have
at least a nVidia card and nvcc
installed to compile and run the code.
Use mixed method of MPI
and OpenMP
to gain scalability and high parallel performance at the same time.
All experiments are carried out under Linux
with nvcc
and nVidia cards installed.
And I chose 2^30 as the STEP_NUM for all framework.
Parallel parameters are listed below:
Framework | Parameters |
---|---|
OpenMP | 16 Threads |
MPI | 16 Processes |
PThread | 16 Threads |
CUDA | 512 Threads / 64 Blocks |
MPIOMP | 4 Processes / 4 Threads |
MIT.