aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/dist.hh
diff options
context:
space:
mode:
authorRoland Haas <rhaas@caltech.edu>2012-04-09 16:21:38 -0700
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:23:14 +0100
commit13b119ae15e14186fc7b5a72db8153d62bcc8d0e (patch)
tree1d7059d1179177da4549acf03f087fe2bdf43b0d /Carpet/CarpetLib/src/dist.hh
parentce2a2d08051a0a423761f986b33ec0b42bcae29a (diff)
CarpetLib: store OpenMP thread number in dist object
Diffstat (limited to 'Carpet/CarpetLib/src/dist.hh')
-rw-r--r--Carpet/CarpetLib/src/dist.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/dist.hh b/Carpet/CarpetLib/src/dist.hh
index cb0770efe..8634ed0ae 100644
--- a/Carpet/CarpetLib/src/dist.hh
+++ b/Carpet/CarpetLib/src/dist.hh
@@ -37,6 +37,8 @@ namespace dist {
extern int num_threads_;
extern int total_num_threads_;
+ extern int thread_num_;
+#pragma omp threadprivate(thread_num_)
void init (int& argc, char**& argv);
void pseudoinit (MPI_Comm const c);
@@ -180,6 +182,12 @@ namespace dist {
{
return num_threads_;
}
+
+ // My own thread number
+ inline int thread_num ()
+ {
+ return thread_num_;
+ }
// Global number of threads
void collect_total_num_threads ();