naginterfaces.library.omp.get_thread_num¶
- naginterfaces.library.omp.get_thread_num()[source]¶
get_thread_num
returns the OpenMP thread number of the calling thread.For full information please refer to the NAG Library document for x06ad
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/x06/x06adf.html
- Returns
- tnint
The returned OpenMP thread number of the calling thread.
- Notes
get_thread_num
, for multithreaded implementations, returns the calling OpenMP thread’s unique thread number within the current team. The master thread will always return . The remaining threads will return a value between and the value returned byget_num_threads()
less .If this function is called from a sequential part of a multithreaded program then it will return the value .
In serial implementations of the NAG Library this function will always return . See the X06 Introduction for a discussion of the behaviour of these functions when called in serial.
- References
The OpenMP API Specification for Parallel Programming
Chapman, B, Jost, G and van der Pas, R, 2008, Using OpenMP Portable Shared Memory Parallel Programming, The MIT Press