ARTS  2.2.66
arts_omp.cc File Reference

Helper functions for OpenMP. More...

#include "arts.h"
#include <iostream>
#include "arts_omp.h"
Include dependency graph for arts_omp.cc:

Go to the source code of this file.

Functions

int arts_omp_get_max_threads ()
 Wrapper for omp_get_max_threads. More...
 
bool arts_omp_in_parallel ()
 Wrapper for omp_in_parallel. More...
 
int arts_omp_get_thread_num ()
 Wrapper for omp_get_thread_num. More...
 
int arts_omp_get_nested ()
 Wrapper for omp_get_nested. More...
 
void arts_omp_set_nested (int i)
 Wrapper for omp_set_nested. More...
 
void arts_omp_set_dynamic (int i)
 Wrapper for omp_set_dynamic. More...
 

Detailed Description

Helper functions for OpenMP.

Author
Stefan Buehler <sbuehler(at)ltu.se>
Date
Thu Jan 31 10:04:57 2008

This file contains wrapper functions for standard OMP functions, that work with and without OMP support. This saves the use of #ifdef statements around omp functions in the ARTS main code.

All functions start with arts_omp. Otherwise, names are the same as the standard OMP function names.

Definition in file arts_omp.cc.

Function Documentation

◆ arts_omp_get_max_threads()

int arts_omp_get_max_threads ( )

Wrapper for omp_get_max_threads.

This wrapper works with and without OMP support.

Returns
Maximum number of OMP threads, or 1 without OMP.

Definition at line 47 of file arts_omp.cc.

Referenced by iyb_calc(), main(), xsec_species(), and yCalc().

◆ arts_omp_get_nested()

int arts_omp_get_nested ( )

Wrapper for omp_get_nested.

This wrapper works with and without OMP support.

Returns
1 or 0, depending on if nested parallel execution is enabled or not.

Definition at line 102 of file arts_omp.cc.

References arts_omp_set_nested().

◆ arts_omp_get_thread_num()

int arts_omp_get_thread_num ( )

Wrapper for omp_get_thread_num.

This wrapper works with and without OMP support.

Returns
ID number of the current thread, or 0 without OMP.

Definition at line 83 of file arts_omp.cc.

Referenced by main(), xsec_species(), and ybatchCalc().

◆ arts_omp_in_parallel()

bool arts_omp_in_parallel ( )

Wrapper for omp_in_parallel.

This wrapper works with and without OMP support.

Returns
Returns true if the current region is running parallelized.

Definition at line 66 of file arts_omp.cc.

Referenced by xsec_species().

◆ arts_omp_set_dynamic()

void arts_omp_set_dynamic ( int  i)

Wrapper for omp_set_dynamic.

This wrapper works with and without OMP support.

Parameters
iTurn on dynamic parallelism with 1, turn off with 0.

Definition at line 146 of file arts_omp.cc.

Referenced by arts_omp_set_nested().

◆ arts_omp_set_nested()

void arts_omp_set_nested ( int  i)

Wrapper for omp_set_nested.

This wrapper works with and without OMP support.

Parameters
iTurn on nested parallelism with 1, turn off with 0.

Definition at line 124 of file arts_omp.cc.

References arts_omp_set_dynamic().

Referenced by arts_omp_get_nested().