Script started on Fri 31 Jan 2014 10:31:08 AM EST ]0;smidkiff@qstruct01:~[smidkiff@qstruct01 ~]$ cat omp_hello.c #include #include #include int main (int argc, char *argv[]) { int nthreads, tid; /* Fork a team of threads giving them their own copies of variables */ #pragma omp parallel private(nthreads, tid) { /* Obtain thread number */ tid = omp_get_thread_num(); printf("Hello World from thread = %d\n", tid); /* Only master thread does this */ if (tid == 0) { nthreads = omp_get_num_threads(); printf("Number of threads = %d\n", nthreads); } } /* All threads join master thread and disband */ } ]0;smidkiff@qstruct01:~[smidkiff@qstruct01 ~]$ gcc -o omp_helloc -fopenmp omp_hello.c ]0;smidkiff@qstruct01:~[smidkiff@qstruct01 ~]$ mpomp_helloc Hello World from thread = 0 Number of threads = 8 Hello World from thread = 3 Hello World from thread = 1 Hello World from thread = 5 Hello World from thread = 2 Hello World from thread = 6 Hello World from thread = 7 Hello World from thread = 4 ]0;smidkiff@qstruct01:~[smidkiff@qstruct01 ~]$ qexit exit Script done on Fri 31 Jan 2014 10:31:33 AM EST