LifeV
OpenMPParameters.cpp
Go to the documentation of this file.
1
//@HEADER
2
/*
3
*******************************************************************************
4
5
Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6
Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7
8
This file is part of LifeV.
9
10
LifeV is free software; you can redistribute it and/or modify
11
it under the terms of the GNU Lesser General Public License as published by
12
the Free Software Foundation, either version 3 of the License, or
13
(at your option) any later version.
14
15
LifeV is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
Lesser General Public License for more details.
19
20
You should have received a copy of the GNU Lesser General Public License
21
along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22
23
*******************************************************************************
24
*/
25
//@HEADER
26
/*!
27
@file
28
@brief Class that handles setting OpenMP parameters
29
30
@date 2013-03
31
@author Radu Popescu <radu.popescu@epfl.ch>
32
33
@maintainer Radu Popescu <radu.popescu@epfl.ch>
34
*/
35
36
#
include
<
lifev
/
core
/
util
/
OpenMPParameters
.
hpp
>
37
38
namespace
LifeV
39
{
40
41
OpenMPParameters
::
OpenMPParameters
()
42
:
numThreads
(1),
chunkSize
(0)
43
{
44
#
ifdef
_OPENMP
45
scheduler = omp_sched_static;
46
#
endif
47
}
48
49
void
OpenMPParameters
::
apply
()
50
{
51
#
ifdef
_OPENMP
52
numThreads_backup = omp_get_max_threads();
53
omp_set_num_threads (numThreads);
54
omp_set_schedule (scheduler, chunkSize);
55
#
endif
56
}
57
58
void
OpenMPParameters
::
restorePreviousNumThreads
()
59
{
60
#
ifdef
_OPENMP
61
omp_set_num_threads (numThreads_backup);
62
#
endif
63
}
64
65
}
// namespace LifeV
LifeV::OpenMPParameters::chunkSize
int chunkSize
Definition:
OpenMPParameters.hpp:63
LifeV::OpenMPParameters::numThreads
int numThreads
Definition:
OpenMPParameters.hpp:58
LifeV::OpenMPParameters::restorePreviousNumThreads
void restorePreviousNumThreads()
Definition:
OpenMPParameters.cpp:58
ETCurrentFE::updateInverseJacobian
void updateInverseJacobian(const UInt &iQuadPt)
Definition:
ETCurrentFE.cpp:405
LifeV::OpenMPParameters::apply
void apply()
Definition:
OpenMPParameters.cpp:49
LifeV::OpenMPParameters
OpenMP parameter class.
Definition:
OpenMPParameters.hpp:47
LifeV::OpenMPParameters::OpenMPParameters
OpenMPParameters()
Definition:
OpenMPParameters.cpp:41
lifev-release-doc
lifev
core
util
OpenMPParameters.cpp
Generated on Wed Mar 7 2018 19:48:47 for LifeV by
1.8.13