aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/kmp_os.h
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2018-12-13 23:14:24 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2018-12-13 23:14:24 +0000
commit09185848651b1cfab16634c40b3151ec5dad9567 (patch)
treebbc9ce7321bfe7cc7955973ab5f0bb2df93a794c /runtime/src/kmp_os.h
parent12258aa8d931d81cb7673994caa96bcc457256f8 (diff)
[OpenMP] Implement OpenMP 5.0 affinity format functionality
This patch adds the affinity format functionality introduced in OpenMP 5.0. This patch adds: Two new environment variables: OMP_DISPLAY_AFFINITY=TRUE|FALSE OMP_AFFINITY_FORMAT=<string> and Four new API: 1) omp_set_affinity_format() 2) omp_get_affinity_format() 3) omp_display_affinity() 4) omp_capture_affinity() The affinity format functionality has two ICV's associated with it: affinity-display-var (bool) and affinity-format-var (string). The affinity-display-var enables/disables the functionality through the envirable OMP_DISPLAY_AFFINITY. The affinity-format-var is a formatted string with the special field types beginning with a '%' character similar to printf For example, the affinity-format-var could be: "OMP: host:%H pid:%P OStid:%i num_threads:%N thread_num:%n affinity:{%A}" The affinity-format-var is displayed by every thread implicitly at the beginning of a parallel region when any thread's affinity has changed (including a brand new thread being spawned), or explicitly using the omp_display_affinity() API. The omp_capture_affinity() function can capture the affinity-format-var in a char buffer. And omp_set|get_affinity_format() allow the user to set|get the affinity-format-var explicitly at runtime. omp_capture_affinity() and omp_get_affinity_format() both return the number of characters needed to hold the entire string it tried to make (not including NULL character). If not enough buffer space is available, both these functions truncate their output. Differential Revision: https://reviews.llvm.org/D55148 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@349089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/src/kmp_os.h')
-rw-r--r--runtime/src/kmp_os.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/src/kmp_os.h b/runtime/src/kmp_os.h
index 54daaf5..3c2426b 100644
--- a/runtime/src/kmp_os.h
+++ b/runtime/src/kmp_os.h
@@ -105,6 +105,7 @@ typedef long double _Quad;
#define KMP_USE_X87CONTROL 0
#if KMP_OS_WINDOWS
+#define KMP_END_OF_LINE "\r\n"
typedef char kmp_int8;
typedef unsigned char kmp_uint8;
typedef short kmp_int16;
@@ -140,6 +141,7 @@ typedef unsigned __int64 kmp_uintptr_t;
#endif /* KMP_OS_WINDOWS */
#if KMP_OS_UNIX
+#define KMP_END_OF_LINE "\n"
typedef char kmp_int8;
typedef unsigned char kmp_uint8;
typedef short kmp_int16;