Index: runtime/src/dllexports =================================================================== --- runtime/src/dllexports +++ runtime/src/dllexports @@ -539,6 +539,9 @@ kmp_set_disp_num_buffers 890 +%ifdef OMP_50 + omp_control_tool 891 +%endif # OMP_50 %ifndef stub # Ordinals between 900 and 999 are reserved Index: runtime/src/kmp_dispatch.h =================================================================== --- runtime/src/kmp_dispatch.h +++ runtime/src/kmp_dispatch.h @@ -17,13 +17,6 @@ /* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */ -// Need to raise Win version from XP to Vista here for support of -// InterlockedExchange64 -#if defined(_WIN32_WINNT) && defined(_M_IX86) -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0502 -#endif - #include "kmp.h" #include "kmp_error.h" #include "kmp_i18n.h" Index: runtime/src/kmp_dispatch.cpp =================================================================== --- runtime/src/kmp_dispatch.cpp +++ runtime/src/kmp_dispatch.cpp @@ -18,13 +18,6 @@ * is the largest value __kmp_nth may take, 1 is the smallest. */ -// Need to raise Win version from XP to Vista here for support of -// InterlockedExchange64 -#if defined(_WIN32_WINNT) && defined(_M_IX86) -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0502 -#endif - #include "kmp.h" #include "kmp_error.h" #include "kmp_i18n.h" Index: runtime/src/kmp_settings.h =================================================================== --- runtime/src/kmp_settings.h +++ runtime/src/kmp_settings.h @@ -31,9 +31,11 @@ __kmp_str_buf_print(buffer, " %s %s", KMP_I18N_STR(Device), name) #define KMP_STR_BUF_PRINT_NAME_EX(x) \ __kmp_str_buf_print(buffer, " %s %s='", KMP_I18N_STR(Device), x) +#define KMP_STR_BUF_PRINT_BOOL_EX(n, v, t, f) \ + __kmp_str_buf_print(buffer, " %s %s='%s'\n", KMP_I18N_STR(Device), n, \ + (v) ? t : f) #define KMP_STR_BUF_PRINT_BOOL \ - __kmp_str_buf_print(buffer, " %s %s='%s'\n", KMP_I18N_STR(Device), name, \ - value ? "TRUE" : "FALSE"); + KMP_STR_BUF_PRINT_BOOL_EX(name, value, "TRUE", "FALSE") #define KMP_STR_BUF_PRINT_INT \ __kmp_str_buf_print(buffer, " %s %s='%d'\n", KMP_I18N_STR(Device), name, \ value) @@ -48,9 +50,11 @@ __kmp_str_buf_print(buffer, " %s %s", KMP_I18N_STR(Host), name) #define KMP_STR_BUF_PRINT_NAME_EX(x) \ __kmp_str_buf_print(buffer, " %s %s='", KMP_I18N_STR(Host), x) +#define KMP_STR_BUF_PRINT_BOOL_EX(n, v, t, f) \ + __kmp_str_buf_print(buffer, " %s %s='%s'\n", KMP_I18N_STR(Host), n, \ + (v) ? t : f) #define KMP_STR_BUF_PRINT_BOOL \ - __kmp_str_buf_print(buffer, " %s %s='%s'\n", KMP_I18N_STR(Host), name, \ - value ? "TRUE" : "FALSE"); + KMP_STR_BUF_PRINT_BOOL_EX(name, value, "TRUE", "FALSE") #define KMP_STR_BUF_PRINT_INT \ __kmp_str_buf_print(buffer, " %s %s='%d'\n", KMP_I18N_STR(Host), name, value) #define KMP_STR_BUF_PRINT_UINT64 \ Index: runtime/src/kmp_settings.cpp =================================================================== --- runtime/src/kmp_settings.cpp +++ runtime/src/kmp_settings.cpp @@ -4510,6 +4510,22 @@ #endif #if OMP_50_ENABLED && OMPT_SUPPORT +static int __kmp_tool = 1; + +static void __kmp_stg_parse_omp_tool(char const *name, char const *value, + void *data) { + __kmp_stg_parse_bool(name, value, &__kmp_tool); +} // __kmp_stg_parse_omp_tool + +static void __kmp_stg_print_omp_tool(kmp_str_buf_t *buffer, char const *name, + void *data) { + if (__kmp_env_format) { + KMP_STR_BUF_PRINT_BOOL_EX(name, __kmp_tool, "enabled", "disabled"); + } else { + __kmp_str_buf_print(buffer, " %s=%s\n", name, + __kmp_tool ? "enabled" : "disabled"); + } +} // __kmp_stg_print_omp_tool static char *__kmp_tool_libraries = NULL; @@ -4787,6 +4803,8 @@ #endif #if OMP_50_ENABLED && OMPT_SUPPORT + {"OMP_TOOL", __kmp_stg_parse_omp_tool, __kmp_stg_print_omp_tool, NULL, 0, + 0}, {"OMP_TOOL_LIBRARIES", __kmp_stg_parse_omp_tool_libraries, __kmp_stg_print_omp_tool_libraries, NULL, 0, 0}, #endif Index: runtime/src/kmp_str.cpp =================================================================== --- runtime/src/kmp_str.cpp +++ runtime/src/kmp_str.cpp @@ -452,7 +452,8 @@ int result = __kmp_str_match("false", 1, data) || __kmp_str_match("off", 2, data) || __kmp_str_match("0", 1, data) || __kmp_str_match(".false.", 2, data) || - __kmp_str_match(".f.", 2, data) || __kmp_str_match("no", 1, data); + __kmp_str_match(".f.", 2, data) || __kmp_str_match("no", 1, data) || + __kmp_str_match("disabled", 0, data); return result; } // __kmp_str_match_false @@ -460,7 +461,8 @@ int result = __kmp_str_match("true", 1, data) || __kmp_str_match("on", 2, data) || __kmp_str_match("1", 1, data) || __kmp_str_match(".true.", 2, data) || - __kmp_str_match(".t.", 2, data) || __kmp_str_match("yes", 1, data); + __kmp_str_match(".t.", 2, data) || __kmp_str_match("yes", 1, data) || + __kmp_str_match("enabled", 0, data); return result; } // __kmp_str_match_true Index: runtime/src/ompt-general.cpp =================================================================== --- runtime/src/ompt-general.cpp +++ runtime/src/ompt-general.cpp @@ -629,11 +629,14 @@ ****************************************************************************/ OMPT_API_ROUTINE int ompt_get_proc_id(void) { -#if KMP_OS_LINUX if (__kmp_get_gtid() < 0) return -1; - +#if KMP_OS_LINUX return sched_getcpu(); +#elif KMP_OS_WINDOWS + PROCESSOR_NUMBER pn; + GetCurrentProcessorNumberEx(&pn); + return 64 * pn.Group + pn.Number; #else return -1; #endif