From 3adcbfa68f7e4d2d16336ec90d7965777a4db5e2 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Sat, 23 Apr 2022 16:58:50 +0200
Subject: [PATCH] [parallel] Add function to query whether the multithreading
 backend is serial

---
 dumux/parallel/multithreading.hh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/dumux/parallel/multithreading.hh b/dumux/parallel/multithreading.hh
index 1efc82f8be..b8bf23402e 100644
--- a/dumux/parallel/multithreading.hh
+++ b/dumux/parallel/multithreading.hh
@@ -46,4 +46,18 @@ using ExecutionBackend = ExecutionBackends::DUMUX_MULTITHREADING_BACKEND;
 
 } // end namespace Dumux::Detail::Multithreading
 
+namespace Dumux::Multithreading {
+
+/*!
+ * \ingroup Parallel
+ * \brief Checking whether the backend is serial
+ */
+inline constexpr bool isSerial()
+{
+    using namespace Dumux::Detail::Multithreading;
+    return std::is_same_v<ExecutionBackends::Serial, ExecutionBackend>;
+};
+
+} // end namespace Dumux
+
 #endif
-- 
GitLab