3fe53b00a762d954f594403276241b8e433bc5cb
[alexxy/gromacs.git] / include / gmx_omp.h
1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
2  *
3  *
4  *                This source code is part of
5  *
6  *                 G   R   O   M   A   C   S
7  *
8  *          GROningen MAchine for Chemical Simulations
9  *
10  * Written by the Gromacs development team under coordination of
11  * David van der Spoel, Berk Hess, and Erik Lindahl.
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * To help us fund GROMACS development, we humbly ask that you cite
19  * the research papers on the package. Check out http://www.gromacs.org
20  *
21  * And Hey:
22  * GROup of MAchos and Cynical Suckers
23  */
24
25 #ifndef GMX_OMP_H
26 #define GMX_OMP_H
27
28 /* This module defines wrappers for OpenMP API functions and enables compiling
29  * code even when OpenMP is turned off in the build system.
30  * Therfore, OpenMP API functions should always be used through these wrappers
31  * and omp.h should never be directly included. Instead, this header should be
32  * used whnever OpenMP API functions are needed.
33  */
34
35 /*! Sets the number of threads in subsequent parallel regions, unless overridden
36  *  by a num_threads clause. Acts as a wrapper for omp_get_max_threads(void). */
37 int  gmx_omp_get_max_threads(void);
38
39 /*! Returns the thread number of the thread executing within its thread team.
40  *  Acts as a warpper for omp_get_thread_num(void). */
41 int  gmx_omp_get_thread_num(void);
42
43 /*! Returns an integer that is equal to or greater than the number of threads
44  * that would be available if a parallel region without num_threads were
45  * defined at that point in the code. Acts as a wapepr for omp_set_num_threads(void). */
46 void gmx_omp_set_num_threads(int num_threads);
47
48 #endif /* GMX_OMP_H */