Skip to content

Commit

Permalink
Minor changes for OpenMP compilers that don't support all omp_get_* c…
Browse files Browse the repository at this point in the history
…alls.

Former-commit-id: 9c02a6be01bdcd3d7309a911455f9b97f2df9cb6
  • Loading branch information
khuck committed Nov 16, 2014
1 parent 4b46f64 commit 07356d5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Profile/TauEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1570,10 +1570,11 @@ void TauEnv_initialize()

// MPC wht OpenMP isn't initialized before TAU is, so these function calls will hang.
#if TAU_OPENMP && !defined(TAU_MPC)
omp_sched_t kind;
const char* schedule;
int modifier;
#if defined(omp_sched_t)
omp_sched_t kind;
omp_get_schedule(&kind, &modifier);
const char* schedule;
if (kind == omp_sched_static) {
schedule = "STATIC";
} else if (kind == omp_sched_dynamic) {
Expand All @@ -1588,6 +1589,13 @@ void TauEnv_initialize()
TAU_METADATA("OMP_SCHEDULE", schedule);
sprintf(tmpstr,"%d",modifier);
TAU_METADATA("OMP_CHUNK_SIZE", tmpstr);
#else
schedule = "UNKNOWN";
modifier = 1;
TAU_METADATA("OMP_SCHEDULE", schedule);
sprintf(tmpstr,"%d",modifier);
TAU_METADATA("OMP_CHUNK_SIZE", tmpstr);
#endif

int value = omp_get_max_threads();
sprintf(tmpstr,"%d",value);
Expand All @@ -1605,13 +1613,17 @@ void TauEnv_initialize()
sprintf(tmpstr,"%s",value?"on":"off");
TAU_METADATA("OMP_NESTED", tmpstr);

#if defined(omp_get_thread_limit)
value = omp_get_thread_limit();
sprintf(tmpstr,"%d",value);
TAU_METADATA("OMP_THREAD_LIMIT", tmpstr);
#endif

#if defined(omp_get_max_active_levels)
value = omp_get_max_active_levels();
sprintf(tmpstr,"%d",value);
TAU_METADATA("OMP_MAX_ACTIVE_LEVELS", tmpstr);
#endif
#endif

tmp = getconf("TAU_MEASURE_TAU");
Expand Down

0 comments on commit 07356d5

Please sign in to comment.