Parallel & Distributed Computing (L31+32) : Write A Simple Openmp Program To Demonstrate The Parallel Loop Construct
Parallel & Distributed Computing (L31+32) : Write A Simple Openmp Program To Demonstrate The Parallel Loop Construct
Parallel & Distributed Computing (L31+32) : Write A Simple Openmp Program To Demonstrate The Parallel Loop Construct
Aim: Write a simple OpenMP program to demonstrate the parallel loop construct.
SOURCE CODE:
#include "stdio.h"
#include "omp.h"
void main(){
DATED-18-07-20 18BCE0707
ASSESSMENT 1 MUSKAN AGRAWAL
if(omp_get_nested())
else
omp_set_num_threads(4);
printf("Hello(%d)", tnum);
EXECUTION:
a. When we check for nested parallelism, our program output comes out to be disabled which
means that the return value of the omp_get_nested is 0.
b. #pragma omp parallel is a layout used to store the program which needs to be parallelized.
DATED-18-07-20 18BCE0707
ASSESSMENT 1 MUSKAN AGRAWAL
c. Lastly the no of processes which are in the output screen are 8 which means that the master
process is forked into 8 subprocesses showing output of each one of the sub processes as
shown above.