SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <omp.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main(int argc, char* argv[])
  6. {
  7.     omp_set_dynamic(0);
  8.     // Beginning of parallel region
  9.     #pragma omp parallel num_threads(1000)
  10.     {
  11.         #pragma omp single
  12.         {
  13.             printf("Number of threads: %d\n",
  14.                 omp_get_num_threads());
  15.         }
  16.        
  17.         printf("Hello World... from thread = %d\n",
  18.             omp_get_thread_num());
  19.        
  20.        
  21.     }
  22.     // Ending of parallel region
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top