Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The omp_get_thread_num function returns the thread number, within its team, of the thread executing the function. The thread number lies between 0 and omp_get_num_threads()–1, inclusive. The master thread of the team is thread 0.
The format is as follows:
#include <omp.h>
int omp_get_thread_num(void);
If called from a serial region, omp_get_thread_num returns 0. If called from within a nested parallel region that is serialized, this function returns 0.
Cross References:
omp_get_num_threadsfunction, see Section 3.1.2 on page 37.