--sas

apr22-single.c

Apr 28th, 2022
1,752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <omp.h>
  3.  
  4. int main() {
  5. #pragma omp parallel
  6.     {
  7. #pragma omp single
  8.         {
  9.             printf("*single1* Thread #%d\n", omp_get_thread_num());
  10.         }
  11.  
  12.         printf("*intermediate Thread #%d\n", omp_get_thread_num());
  13. #pragma omp single
  14.         {
  15.             printf("*single2* Thread #%d\n", omp_get_thread_num());
  16.         }
  17.     }
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment