[Openmp-commits] [openmp] [OpenMP] Rename worker threads for improved debuggability (PR #102065)
via Openmp-commits
openmp-commits at lists.llvm.org
Wed Aug 7 17:20:41 PDT 2024
================
@@ -878,6 +878,13 @@ void __kmp_create_worker(int gtid, kmp_info_t *th, size_t stack_size) {
KMP_SYSFAIL("pthread_create", status);
}
+#if defined(KMP_OS_LINUX) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12)))
+ // Rename worker threads for improved debuggability
+ if (!KMP_UBER_GTID(gtid)) {
+ pthread_setname_np(handle, "openmp_worker");
----------------
HighW4y2H3ll wrote:
`pthread_setname_np` is introduced in glibc 2.12, so yes, older version of glibc doesn't have this API.
https://github.com/llvm/llvm-project/pull/102065
More information about the Openmp-commits
mailing list