CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
parallelToolbox.hpp
1/*
2 * CoDiPack, a Code Differentiation Package
3 *
4 * Copyright (C) 2015-2024 Chair for Scientific Computing (SciComp), University of Kaiserslautern-Landau
5 * Homepage: http://scicomp.rptu.de
6 * Contact: Prof. Nicolas R. Gauger (codi@scicomp.uni-kl.de)
7 *
8 * Lead developers: Max Sagebaum, Johannes Blühdorn (SciComp, University of Kaiserslautern-Landau)
9 *
10 * This file is part of CoDiPack (http://scicomp.rptu.de/software/codi).
11 *
12 * CoDiPack is free software: you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, either version 3 of the
15 * License, or (at your option) any later version.
16 *
17 * CoDiPack is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty
19 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * See the GNU General Public License for more details.
22 * You should have received a copy of the GNU
23 * General Public License along with CoDiPack.
24 * If not, see <http://www.gnu.org/licenses/>.
25 *
26 * For other licensing options please contact us.
27 *
28 * Authors:
29 * - SciComp, University of Kaiserslautern-Landau:
30 * - Max Sagebaum
31 * - Johannes Blühdorn
32 * - Former members:
33 * - Tim Albring
34 */
35#pragma once
36
37#include "atomicInterface.hpp"
38#include "mutexInterface.hpp"
39#include "readWriteMutex.hpp"
40#include "staticThreadLocalPointerInterface.hpp"
41#include "synchronizationInterface.hpp"
42#include "threadInformationInterface.hpp"
43
45namespace codi {
46
66 template<typename T_ThreadInformation, template<typename> class T_Atomic, typename T_Mutex,
67 template<typename, typename> class T_StaticThreadLocalPointer, typename T_Synchronization>
69 public:
72 template<typename Type>
73 using Atomic = CODI_DD(T_Atomic<Type>, CODI_DEFAULT_ATOMIC<Type>);
74 using Mutex = CODI_DD(T_Mutex, MutexInterface);
75
77 template<typename Type, typename Owner>
78 using StaticThreadLocalPointer = CODI_DD(CODI_T(T_StaticThreadLocalPointer<Type, Owner>),
80
81 using Synchronization = CODI_DD(T_Synchronization, DefaultSynchronization);
82
87 };
88
89#if CODI_IDE
91 using CODI_DEFAULT_PARALLEL_TOOLBOX =
93 CODI_DEFAULT_STATIC_THREAD_LOCAL_POINTER, DefaultSynchronization>;
94#endif
95}
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
#define CODI_T(...)
Abbreviation for CODI_TEMPLATE.
Definition macros.hpp:111
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
Default implementation of SynchronizationInterface for serial applications.
Definition synchronizationInterface.hpp:62
Default implementation of ThreadInformationInterface for serial applications.
Definition threadInformationInterface.hpp:63
RAII lock for read. ´
Definition readWriteMutex.hpp:206
RAII lock for write.
Definition readWriteMutex.hpp:233
RAII mutex locking.
Definition mutexInterface.hpp:65
Abstracts a mutex.
Definition mutexInterface.hpp:47
Collects parallel programming facilties required to make CoDiPack applicable in a shared memory paral...
Definition parallelToolbox.hpp:68
T_Mutex Mutex
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:74
T_ThreadInformation ThreadInformation
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:71
T_StaticThreadLocalPointer< Type, Owner > StaticThreadLocalPointer
See codi::StaticThreadLocalPointerInterface.
Definition parallelToolbox.hpp:78
T_Synchronization Synchronization
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:81
T_Atomic< Type > Atomic
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:73
Mutex construct that distinguishes between lock for read and lock for write.
Definition readWriteMutex.hpp:74
Abstracts a static thread-local pointer.
Definition staticThreadLocalPointerInterface.hpp:50
Provides information on threads.
Definition threadInformationInterface.hpp:45