[Openmp-commits] [openmp] [OpenMP][OMPT] Mark dispatch callback as sometimes on registration (PR #212991)

Jan André Reuter via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 12 07:16:51 PDT 2026


https://github.com/Thyre updated https://github.com/llvm/llvm-project/pull/212991

>From e440f031bad7c58ad3e2c227b09e91a878c692f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Andr=C3=A9=20Reuter?= <j.reuter at fz-juelich.de>
Date: Thu, 30 Jul 2026 12:31:17 +0200
Subject: [PATCH] [OpenMP][OMPT] Mark dispatch callback as sometimes on
 registration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Recently, multiple issues in the implementation of the `dispatch`
callback have been found (e.g., #212784, #207746). In these, the code
generation done by Clang and Flang does not provide a sufficient amount of
information for the runtime to dispatch the correct amount of flags, or a
callback for a given event at all.

These missing and incorrect events do not satisfy OpenMP's requirement
for `ompt_set_always` as a registration result, as the runtime does not
trace or invoke the correct callback whenever an associated event occurs
(OpenMP v5.2, p. 457, l.5-6).
As such, change the registration result for the `dispatch` callback to
`ompt_set_sometimes` for now, which is fulfilled. Here, an
implementation can dispatch callbacks or trace an implementation-defined
subset of associated event occurrences.

Based on the changed registration result, a tool can then decide if they are
still interested in recording the information provided by the runtime
implementation.

Signed-off-by: Jan André Reuter <j.reuter at fz-juelich.de>
---
 openmp/runtime/src/ompt-event-specific.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openmp/runtime/src/ompt-event-specific.h b/openmp/runtime/src/ompt-event-specific.h
index 7736ba8531635..539fe1548b666 100644
--- a/openmp/runtime/src/ompt-event-specific.h
+++ b/openmp/runtime/src/ompt-event-specific.h
@@ -103,7 +103,7 @@
 
 #define ompt_callback_reduction_implemented ompt_event_MAY_ALWAYS_OPTIONAL
 
-#define ompt_callback_dispatch_implemented ompt_event_MAY_ALWAYS_OPTIONAL
+#define ompt_callback_dispatch_implemented ompt_event_MAY_CONVENIENT
 
 #define ompt_callback_error_implemented ompt_event_MAY_ALWAYS_OPTIONAL
 



More information about the Openmp-commits mailing list