Parallel Algorithms - course for 3-year students of the DCAM MIPT, where students learn the basics of parallel programming using the MPI and openMP libraries.
In this problem, the trapezoid method is used to calculate the value of the integral with a given precision.
OpenMP with the task scheduling is used for acceleration, since the trapezoid method is recursive.
Used function:
Tested on Macbook Pro 13 / 2,3 GHz Quad-Core Intel Core i5 - 4 Cores.
Ready-to-use for MacOS.
Clone a repository on your machine. When move to the Integral_OpenMP_with_Precision directory and run:
chmod +x build.sh
./build.sh 0.000001
It will automatically generate Acceleration.png and Efficiency.png plots and store it in the res folder.
You can change 0.000001 to any precision you want.
This program accelerates up to 4 times when using 4 cores of the system.
Efficiency of each process slightly reduces with increase of number of threads.