CoDiPack  2.3.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 "reverseAtomicInterface.hpp"
41#include "staticThreadLocalPointerInterface.hpp"
42#include "synchronizationInterface.hpp"
43#include "threadInformationInterface.hpp"
44
46namespace codi {
47
69 template<typename T_ThreadInformation, template<typename> class T_Atomic, template<typename> class T_ReverseAtomic,
70 typename T_Mutex, template<typename, typename> class T_StaticThreadLocalPointer, typename T_Synchronization>
72 public:
75 template<typename Type>
76 using Atomic = CODI_DD(T_Atomic<Type>, CODI_DEFAULT_ATOMIC<Type>);
78 template<typename Type>
79 using ReverseAtomic = CODI_DD(T_ReverseAtomic<Type>, CODI_DEFAULT_REVERSE_ATOMIC<Type>);
80 using Mutex = CODI_DD(T_Mutex, MutexInterface);
81
83 template<typename Type, typename Owner>
84 using StaticThreadLocalPointer = CODI_DD(CODI_T(T_StaticThreadLocalPointer<Type, Owner>),
86
87 using Synchronization = CODI_DD(T_Synchronization, DefaultSynchronization);
88
93 };
94
95#if CODI_IDE
97 using CODI_DEFAULT_PARALLEL_TOOLBOX =
99 CODI_DEFAULT_STATIC_THREAD_LOCAL_POINTER, DefaultSynchronization>;
100#endif
101}
#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:91
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:71
T_Synchronization Synchronization
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:87
T_StaticThreadLocalPointer< Type, Owner > StaticThreadLocalPointer
See codi::StaticThreadLocalPointerInterface.
Definition parallelToolbox.hpp:84
T_ReverseAtomic< Type > ReverseAtomic
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:79
T_Atomic< Type > Atomic
Definition parallelToolbox.hpp:76
T_ThreadInformation ThreadInformation
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:74
T_Mutex Mutex
See codi::ParallelToolbox.
Definition parallelToolbox.hpp:80
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