Advertisement
SpandITime

omp.c

May 20th, 2022 (edited)
678
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <omp.h>
  2. #include <stdio.h>
  3.  
  4. int main(){
  5.     int b = 18;
  6.     omp_set_num_threads(5);
  7.     #pragma omp parallel reduction(+:b)
  8.     {
  9.         b+=2;
  10.     }
  11.     printf("after reduction b=%d\n",b);
  12. }
Advertisement
RAW Paste Data Copied
Advertisement