[Openmp-commits] [openmp] [OpenMP] Make use of getloadavg() on *BSD OS's (PR #70586)

Brad Smith via Openmp-commits openmp-commits at lists.llvm.org
Sun Oct 29 00:33:04 PDT 2023


https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/70586

OpenBSD does not have /proc filesystem, neither does FreeBSD (by default).

>From 962abde8e2ccde1e3172a4b9b9ea32015c93742e Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Sun, 29 Oct 2023 03:29:07 -0400
Subject: [PATCH] [OpenMP] Make use of getloadavg() on *BSD OS's

OpenBSD does not have /proc filesystem, neither does FreeBSD (by default).
---
 openmp/runtime/src/z_Linux_util.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openmp/runtime/src/z_Linux_util.cpp b/openmp/runtime/src/z_Linux_util.cpp
index 478c09baa1beefe..e6aa6f413d168c5 100644
--- a/openmp/runtime/src/z_Linux_util.cpp
+++ b/openmp/runtime/src/z_Linux_util.cpp
@@ -2206,7 +2206,8 @@ int __kmp_is_address_mapped(void *addr) {
 
 #ifdef USE_LOAD_BALANCE
 
-#if KMP_OS_DARWIN || KMP_OS_NETBSD
+#if KMP_OS_DARWIN || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD ||    \
+    KMP_OS_OPENBSD
 
 // The function returns the rounded value of the system load average
 // during given time interval which depends on the value of



More information about the Openmp-commits mailing list