From 68e67452502b8bd37299f0c2e8cb2aec8337005c Mon Sep 17 00:00:00 2001 From: Matthias Jurenz Date: Mon, 13 Sep 2010 08:48:45 +0000 Subject: [PATCH] Renamed macros omp_get_thread_num -> MY_THREAD omp_get_num_threads -> THREAD_NUM to avoid conflicts with the 'omp.h' of the PGI compiler version 10.0.x This commit was SVN r23748. --- .../extlib/otf/tools/otfprofile/otfprofile.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ompi/contrib/vt/vt/extlib/otf/tools/otfprofile/otfprofile.cpp b/ompi/contrib/vt/vt/extlib/otf/tools/otfprofile/otfprofile.cpp index 72d1c4d4d2..26a5691e24 100644 --- a/ompi/contrib/vt/vt/extlib/otf/tools/otfprofile/otfprofile.cpp +++ b/ompi/contrib/vt/vt/extlib/otf/tools/otfprofile/otfprofile.cpp @@ -9,9 +9,11 @@ #ifdef _OPENMP # include +# define MY_THREAD omp_get_thread_num() +# define THREAD_NUM omp_get_num_threads() #else -# define omp_get_thread_num() 0 -# define omp_get_num_threads() 1 +# define MY_THREAD 0 +# define THREAD_NUM 1 #endif #if defined(HAVE_SYS_TIME_H) && HAVE_SYS_TIME_H @@ -455,7 +457,7 @@ int main( int argc, const char** argv ) # endif { - data_array[omp_get_thread_num()] = &data; + data_array[MY_THREAD] = &data; uint64_t events = 0; uint64_t read; @@ -466,17 +468,17 @@ int main( int argc, const char** argv ) bool ready = false; map invers_proc_map; - uint32_t maxfiles = ( nfiles / omp_get_num_threads() ) + - ( (uint32_t)omp_get_thread_num() < (nfiles % (uint32_t)omp_get_num_threads()) ? 1 : 0 ); + uint32_t maxfiles = ( nfiles / THREAD_NUM ) + + ( (uint32_t)MY_THREAD < (nfiles % (uint32_t)THREAD_NUM) ? 1 : 0 ); uint32_t start = 0; uint32_t end = 0; # ifdef _OPENMP - for(int k=0; k