next up previous
Next: Further Reading Up: No Title Previous: Reductions

Function calls

omp_get_num_threads()
return current number of threads
omp_get_max_threads()
return number of threads
omp_get_thread_num()
get current thread number

These calls should be enclosed with the C$ conditional compilation directive, or in a #ifdef _OPENMP, in order to avoid link errors when compiling on a non-OpenMP compiler. eg

       myid = 0
C$     myid = mp_get_thread_num()



Russell Standish
2001-05-11