daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 50 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <omp.h>
  2. #include <stdio.h>
  3.  
  4. int main (int argc, char *argv[]) {
  5.     int th_id, nthreads;
  6.    
  7.     #pragma omp parallel private(th_id)
  8.     {
  9.         th_id = omp_get_thread_num();
  10.         printf("Hello World from thread %d\n", th_id);
  11.         #pragma omp barrier
  12.         if ( th_id == 0 ) {
  13.             nthreads = omp_get_num_threads();
  14.             printf("There are %d threads\n",nthreads);
  15.         }
  16.     }
  17.    
  18.     return 0;
  19. }
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