Module 11: The “lastprivate” Clause
  Lecture 21: Clause and Routines
 


Run-Time Library Routines

OMP GET NUM THREADS: Returns the number of threads that are currently in the team executing the parallel region from which it is called.

Format
int omp get num threads(void)
  • If this call is made from a serial portion of the program, or a nested parallel region that is serialized, it will return 1.
  • The default number of threads is implementation dependent

OMP GET MAX THREADS: Returns the maximum value that can be returned by a call to the OMP GET NUM THREADS function.

Format
int omp get max threads(void)
  • This routine can only be called from the serial portion of the code.
  • This call has precedence over the OMP NUM THREADS

OMP GET THREAD NUM: Returns the thread number of the thread, within the team, making this call. This number will be between 0 and OMP GET NUM THREADS-1. The master thread of the team is thread 0

Format
int omp get thread num(void)
  • If called from a nested parallel region, or a serial region, this function will return 0

OMP GET THREAD LIMIT: New with OpenMP 3.0. Returns the maximum number of OpenMP threads available to a program.

Format
int omp get thread limit(void)

OMP GET NUM PROCS: Returns the number of processors that are available to the program.

Format
int omp get num procs(void)