casacore
Functions
casacore::OMP Namespace Reference

Functions

uInt maxThreads ()
 Get the maximum number of threads. More...
 
uInt nMaxThreads ()
 Backward
More...
 
void setNumThreads (uInt)
 Set the number of threads to use. More...
 
uInt numThreads ()
 Get the number of threads used in a parallel piece of code. More...
 
uInt threadNum ()
 Get the thread number (0 till numThreads). More...
 
void setNested (Bool)
 Set if nested parallel sections are possible or not. More...
 
bool nested ()
 Test if nested parallel sections are possible. More...
 

Function Documentation

◆ maxThreads()

uInt casacore::OMP::maxThreads ( )
inline

Get the maximum number of threads.

OpenMP sets it to the env.var. OMP_NUM_THREADS. If undefined, it is the number of cores. If OpenMP is not used, 1 is returned.

Definition at line 41 of file OMP.h.

◆ nested()

bool casacore::OMP::nested ( )
inline

Test if nested parallel sections are possible.

If OpenMP is not used, false is returned.

Definition at line 97 of file OMP.h.

◆ nMaxThreads()

uInt casacore::OMP::nMaxThreads ( )

Backward

◆ numThreads()

uInt casacore::OMP::numThreads ( )
inline

Get the number of threads used in a parallel piece of code.

If OpenMP is not used, 1 is returned.

Definition at line 65 of file OMP.h.

◆ setNested()

void casacore::OMP::setNested ( Bool  )
inline

Set if nested parallel sections are possible or not.

Nothing is done if OpenMP is not used.

Definition at line 91 of file OMP.h.

◆ setNumThreads()

void casacore::OMP::setNumThreads ( uInt  )
inline

Set the number of threads to use.

Note it can be overridden for a parallel section by 'omp parallel num_threads(n)'. Nothing is done if OpenMP is not used.

Definition at line 59 of file OMP.h.

◆ threadNum()

uInt casacore::OMP::threadNum ( )
inline

Get the thread number (0 till numThreads).

If OpenMP is not used, 0 is returned.

Definition at line 76 of file OMP.h.