GemaCoreLib
The GeMA Core library
Macros | Functions
gmOmp.h File Reference

Declaration of helper functions for using OpenMP that translate into "empty" statements if compiled without OpenMP support. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GM_OMP_ASSERT_NO_DYNAMIC   ((void)0)
 

Functions

void GmOmpInit (int maxThreads)
 Initializes OpenMP to use the given maximum number of threads. It also disables dynamic scheduling.
 
int GmOmpAdjustNumThreads (int nt)
 Adjusts the given number of threads. If nt <= 0 or if nt > maximum number of omp threads, returns the maximum number of threads. Otherwise returns nt. More...
 
int GmOmpThreadNum ()
 Returns the current Open Mp thread number (omp_get_thread_num()). More...
 

Detailed Description

Declaration of helper functions for using OpenMP that translate into "empty" statements if compiled without OpenMP support.

Author
Carlos Augusto Teixeira Mendes
Date
april, 2020

Function Documentation

◆ GmOmpAdjustNumThreads()

int GmOmpAdjustNumThreads ( int  nt)
inline

Adjusts the given number of threads. If nt <= 0 or if nt > maximum number of omp threads, returns the maximum number of threads. Otherwise returns nt.

If compiling without OpenMP support, always returns 1.

◆ GmOmpThreadNum()

int GmOmpThreadNum ( )
inline

Returns the current Open Mp thread number (omp_get_thread_num()).

If compiling without OpenMP support, always returns 0.