diff options
Diffstat (limited to 'Carpet/CarpetLib/src/dist.hh')
-rw-r--r-- | Carpet/CarpetLib/src/dist.hh | 8 |
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 (); |