#include #include #include int main(int argc, char** argv) { int rank, val, ori; #pragma omp parallel default(shared) private(val,rank) shared(ori) { rank = omp_get_thread_num(); // get the rank of current thread #pragma omp single { val = 10; } #pragma omp master { ori = 7777; val = val + 5; } printf("I am rank %d and my values are %d, %d\n", rank, val, ori); } return 0; }