<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/openmp/runtime/src/ompt-specific.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[OpenMP][OMPT][OMPD] Fix frame flags for OpenMP tool APIs (#114118)</title>
<updated>2025-02-27T17:47:57+00:00</updated>
<author>
<name>Joachim</name>
<email>jenke@itc.rwth-aachen.de</email>
</author>
<published>2025-02-27T17:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=12a9e2adc3842aee4d6ae01a33eb3103e2224af9'/>
<id>12a9e2adc3842aee4d6ae01a33eb3103e2224af9</id>
<content type='text'>
In several cases the flags entries in ompt_frame_t are not initialized.
According to @jdelsign the address provided as reenter and exit address
is the canonical frame address (cfa) rather than a "framepointer". This
patch makes sure that the flags entry is always initialized and changes
the value from ompt_frame_framepointer to ompt_frame_cfa.

The assertion in the tests makes sure that the flags are always set,
when a tool (callback.h in this case) looks at the value.

Fixes #89058</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In several cases the flags entries in ompt_frame_t are not initialized.
According to @jdelsign the address provided as reenter and exit address
is the canonical frame address (cfa) rather than a "framepointer". This
patch makes sure that the flags entry is always initialized and changes
the value from ompt_frame_framepointer to ompt_frame_cfa.

The assertion in the tests makes sure that the flags are always set,
when a tool (callback.h in this case) looks at the value.

Fixes #89058</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Use new OMPT state and sync kinds for barrier events (#95602)</title>
<updated>2024-07-16T14:52:20+00:00</updated>
<author>
<name>Hansang Bae</name>
<email>hansang.bae@intel.com</email>
</author>
<published>2024-07-16T14:52:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7a72856af8b30f50e546b8368596fdc5f44cbca9'/>
<id>7a72856af8b30f50e546b8368596fdc5f44cbca9</id>
<content type='text'>
This change makes the runtime use new OMPT state and sync kinds
introduced in OpenMP 5.1 in place of the deprecated implicit state and
sync kinds. Events from implicit barriers use different enumerators for
workshare, parallel, and teams.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change makes the runtime use new OMPT state and sync kinds
introduced in OpenMP 5.1 in place of the deprecated implicit state and
sync kinds. Events from implicit barriers use different enumerators for
workshare, parallel, and teams.</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][OMPT] Add missing callbacks for asynchronous target tasks (#93472)</title>
<updated>2024-06-04T15:07:15+00:00</updated>
<author>
<name>Joachim</name>
<email>jenke@itc.rwth-aachen.de</email>
</author>
<published>2024-06-04T15:07:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2464f1cef3d28182da42debe6abf9bad8ab5a4d2'/>
<id>2464f1cef3d28182da42debe6abf9bad8ab5a4d2</id>
<content type='text'>
- The first hidden-helper-thread did not trigger thread-begin
- The "detaching" from a target-task when waiting for completion missed
to call task-switch
- Target tasks identified themself as explicit task

Co-authored-by: Kaloyan Ignatov &lt;kaloyan.ignatov@rwth-aachen.de&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- The first hidden-helper-thread did not trigger thread-begin
- The "detaching" from a target-task when waiting for completion missed
to call task-switch
- Target tasks identified themself as explicit task

Co-authored-by: Kaloyan Ignatov &lt;kaloyan.ignatov@rwth-aachen.de&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][OMPT] Fix ompt_get_task_memory implementation</title>
<updated>2023-08-28T07:19:52+00:00</updated>
<author>
<name>Joachim Jenke</name>
<email>jenke@itc.rwth-aachen.de</email>
</author>
<published>2023-08-28T07:09:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cec855af3e17274b4bceda9f96c6a80aa7a5252d'/>
<id>cec855af3e17274b4bceda9f96c6a80aa7a5252d</id>
<content type='text'>
Since td_allow_completion_event is a member of the taskdata struct, not all
firstprivate/shared variables are stored at the end of the task memory
allocation. Simply report the whole allocation instead.

Furthermore, the function should always return 0 since in no case there is
another block to report.

Differential Review: https://reviews.llvm.org/D158080
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since td_allow_completion_event is a member of the taskdata struct, not all
firstprivate/shared variables are stored at the end of the task memory
allocation. Simply report the whole allocation instead.

Furthermore, the function should always return 0 since in no case there is
another block to report.

Differential Review: https://reviews.llvm.org/D158080
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] [OMPT] [6/8] Added callback support for target data operations, target submit, and target regions.</title>
<updated>2023-07-21T10:24:12+00:00</updated>
<author>
<name>Michael Halkenhaeuser</name>
<email>MichaelGerald.Halkenhauser@amd.com</email>
</author>
<published>2022-06-08T23:33:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=453a75dc52e73a664505ebb196c93ff952754909'/>
<id>453a75dc52e73a664505ebb196c93ff952754909</id>
<content type='text'>
This patch adds support for invoking target callbacks but does not yet
invoke them. A new structure OmptInterface has been added that tracks
thread local states including correlation ids. This structure defines
methods that will be called from the device independent target library
with information related to a target entry point for which a callback
is invoked. These methods in turn use the callback functions maintained
by OmptDeviceCallbacksTy to invoke the tool supplied callbacks.

Depends on D124652

Patch from John Mellor-Crummey &lt;johnmc@rice.edu&gt;
With contributions from:
Dhruva Chakrabarti &lt;Dhruva.Chakrabarti@amd.com&gt;

Differential Revision: https://reviews.llvm.org/D127365
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds support for invoking target callbacks but does not yet
invoke them. A new structure OmptInterface has been added that tracks
thread local states including correlation ids. This structure defines
methods that will be called from the device independent target library
with information related to a target entry point for which a callback
is invoked. These methods in turn use the callback functions maintained
by OmptDeviceCallbacksTy to invoke the tool supplied callbacks.

Depends on D124652

Patch from John Mellor-Crummey &lt;johnmc@rice.edu&gt;
With contributions from:
Dhruva Chakrabarti &lt;Dhruva.Chakrabarti@amd.com&gt;

Differential Revision: https://reviews.llvm.org/D127365
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] [OMPT] [2/8] Implemented a connector for communication of OMPT callbacks between libraries.</title>
<updated>2022-11-15T22:21:55+00:00</updated>
<author>
<name>Dhruva Chakrabarti</name>
<email>Dhruva.Chakrabarti@amd.com</email>
</author>
<published>2022-11-15T20:27:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5b67bce787e4eeee1222c78bee7c0e9bc5563a3a'/>
<id>5b67bce787e4eeee1222c78bee7c0e9bc5563a3a</id>
<content type='text'>
This is part of a set of patches implementing OMPT target callback support and has been split out of the originally submitted https://reviews.llvm.org/D113728. The overall design can be found in https://rice.app.box.com/s/pf3gix2hs4d4o1aatwir1set05xmjljc

The purpose of this patch is to provide a way to register tool-provided callbacks into libomp when libomptarget is loaded.

Introduced a cmake variable LIBOMPTARGET_OMPT_SUPPORT that can be used to control OMPT target support. It follows host OMPT support, controlled by LIBOMP_HAVE_OMPT_SUPPORT.

Added a connector that can be used to communicate between OMPT implementations in libomp and libomptarget or libomptarget and a plugin.

Added a global constructor in libomptarget that uses the connector to force registration of tool-provided callbacks in libomp. A pair of init and fini functions are provided to libomp as part of the connect process which will be used to register the tool-provided callbacks in libomptarget.

Patch from John Mellor-Crummey &lt;johnmc@rice.edu&gt;
(With contributions from Dhruva Chakrabarti &lt;Dhruva.Chakrabarti@amd.com&gt;)

Reviewed By: dreachem, jhuber6

Differential Revision: https://reviews.llvm.org/D123572
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is part of a set of patches implementing OMPT target callback support and has been split out of the originally submitted https://reviews.llvm.org/D113728. The overall design can be found in https://rice.app.box.com/s/pf3gix2hs4d4o1aatwir1set05xmjljc

The purpose of this patch is to provide a way to register tool-provided callbacks into libomp when libomptarget is loaded.

Introduced a cmake variable LIBOMPTARGET_OMPT_SUPPORT that can be used to control OMPT target support. It follows host OMPT support, controlled by LIBOMP_HAVE_OMPT_SUPPORT.

Added a connector that can be used to communicate between OMPT implementations in libomp and libomptarget or libomptarget and a plugin.

Added a global constructor in libomptarget that uses the connector to force registration of tool-provided callbacks in libomp. A pair of init and fini functions are provided to libomp as part of the connect process which will be used to register the tool-provided callbacks in libomptarget.

Patch from John Mellor-Crummey &lt;johnmc@rice.edu&gt;
(With contributions from Dhruva Chakrabarti &lt;Dhruva.Chakrabarti@amd.com&gt;)

Reviewed By: dreachem, jhuber6

Differential Revision: https://reviews.llvm.org/D123572
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[OpenMP] [OMPT] [2/8] Implemented a connector for communication of OMPT callbacks between libraries."</title>
<updated>2022-11-01T15:59:58+00:00</updated>
<author>
<name>Dhruva Chakrabarti</name>
<email>Dhruva.Chakrabarti@amd.com</email>
</author>
<published>2022-11-01T15:59:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=88e557cbc94095e4dd933eac30247c6ccb0bb56f'/>
<id>88e557cbc94095e4dd933eac30247c6ccb0bb56f</id>
<content type='text'>
This reverts commit f94c2679cb1db92ce4103487bf0247eca6e4d722.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit f94c2679cb1db92ce4103487bf0247eca6e4d722.
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] [OMPT] [2/8] Implemented a connector for communication of OMPT callbacks between libraries.</title>
<updated>2022-10-31T17:33:23+00:00</updated>
<author>
<name>Dhruva Chakrabarti</name>
<email>Dhruva.Chakrabarti@amd.com</email>
</author>
<published>2022-06-17T23:05:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f94c2679cb1db92ce4103487bf0247eca6e4d722'/>
<id>f94c2679cb1db92ce4103487bf0247eca6e4d722</id>
<content type='text'>
This is part of a set of patches implementing OMPT target callback support and has been split out of the originally submitted https://reviews.llvm.org/D113728. The overall design can be found in https://rice.app.box.com/s/pf3gix2hs4d4o1aatwir1set05xmjljc

The purpose of this patch is to provide a way to register tool-provided callbacks into libomp when libomptarget is loaded.

Introduced a cmake variable LIBOMPTARGET_OMPT_SUPPORT that can be used to control OMPT target support. It follows host OMPT support, controlled by LIBOMP_HAVE_OMPT_SUPPORT.

Added a connector that can be used to communicate between OMPT implementations in libomp and libomptarget or libomptarget and a plugin.

Added a global constructor in libomptarget that uses the connector to force registration of tool-provided callbacks in libomp. A pair of init and fini functions are provided to libomp as part of the connect process which will be used to register the tool-provided callbacks in libomptarget.

Depends on D123429

Patch from John Mellor-Crummey &lt;johnmc@rice.edu&gt;
(With contributions from Dhruva Chakrabarti &lt;Dhruva.Chakrabarti@amd.com&gt;)

Reviewed By: dreachem

Differential Revision: https://reviews.llvm.org/D123572
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is part of a set of patches implementing OMPT target callback support and has been split out of the originally submitted https://reviews.llvm.org/D113728. The overall design can be found in https://rice.app.box.com/s/pf3gix2hs4d4o1aatwir1set05xmjljc

The purpose of this patch is to provide a way to register tool-provided callbacks into libomp when libomptarget is loaded.

Introduced a cmake variable LIBOMPTARGET_OMPT_SUPPORT that can be used to control OMPT target support. It follows host OMPT support, controlled by LIBOMP_HAVE_OMPT_SUPPORT.

Added a connector that can be used to communicate between OMPT implementations in libomp and libomptarget or libomptarget and a plugin.

Added a global constructor in libomptarget that uses the connector to force registration of tool-provided callbacks in libomp. A pair of init and fini functions are provided to libomp as part of the connect process which will be used to register the tool-provided callbacks in libomptarget.

Depends on D123429

Patch from John Mellor-Crummey &lt;johnmc@rice.edu&gt;
(With contributions from Dhruva Chakrabarti &lt;Dhruva.Chakrabarti@amd.com&gt;)

Reviewed By: dreachem

Differential Revision: https://reviews.llvm.org/D123572
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][OMPT] thread_num determination during execution of nested serialized parallel regions</title>
<updated>2021-10-25T16:21:20+00:00</updated>
<author>
<name>Vladimir Inđić</name>
<email>vladaindjic@uns.ac.rs</email>
</author>
<published>2021-10-25T16:16:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f41d08540be21f852b7ee6293953f66f5a1123b6'/>
<id>f41d08540be21f852b7ee6293953f66f5a1123b6</id>
<content type='text'>
__ompt_get_task_info_internal function is adapted to support thread_num
determination during the execution of multiple nested serialized
parallel regions enclosed by a regular parallel region.

Consider the following program that contains parallel region R1 executed
by two threads. Let the worker thread T of region R1 executes serialized
parallel regions R2 that encloses another serialized parallel region R3.
Note that the thread T is the master thread of both R2 and R3 regions.

Assume that __ompt_get_task_info_internal function is called with the
argument "ancestor_level == 1" during the execution of region R3.
The function should determine the "thread_num" of the thread T inside
the team of region R2, whose implicit task is at level 1 inside the
hierarchy of active tasks. Since the thread T is the master thread of
region R2, one should expected that "thread_num" takes a value 0.
After the while loop finishes, the following stands: "lwt != NULL",
"prev_lwt == NULL", "prev_team" represents the team information about
the innermost serialized parallel region R3. This results in executing
the assignment "thread_num = prev_team-&gt;t.t_master_tid". Note that
"prev_team-&gt;t.t_master_tid" was initialized at the moment of
R2’s creation and represents the "thread_num" of the thread T inside
the region R1 which encloses R2. Since the thread T is the worker thread
of the region R1, "the thread_num" takes value 1, which is a contradiction.

This patch proposes to use "lwt" instead of "prev_lwt" when determining
the "thread_num". If "lwt" exists, the task at the requested level belongs
to the serialized parallel region. Since the serialized parallel region
is executed by one thread only, the "thread_num" takes value 0.

Similarly, assume that __ompt_get_task_info_internal function is called
with the argument "ancestor_level == 2" during the execution of region R3.
The function should determine the "thread_num" of the thread T inside the
team of region R1. Since the thread is the worker inside the region R1,
one should expected that "thread_num" takes value 1. After the loop finishes,
the following stands: "lwt == NULL", "prev_lwt != NULL", "prev_team" represents
the team information about the innermost serialized parallel region R3.
This leads to execution of the assignment "thread_num = 0", which causes
a contradiction.

Ignoring the "prev_lwt" leads to executing the assignment
"thread_num = prev_team-&gt;t.t_master_tid" instead. From the previous explanation,
it is obvious that "thread_num" takes value 1.

Note that the "prev_lwt" variable is marked as unnecessary and thus removed.

This patch introduces the test case which represents the OpenMP program
described earlier in the summary.

Differential Revision: https://reviews.llvm.org/D110699
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__ompt_get_task_info_internal function is adapted to support thread_num
determination during the execution of multiple nested serialized
parallel regions enclosed by a regular parallel region.

Consider the following program that contains parallel region R1 executed
by two threads. Let the worker thread T of region R1 executes serialized
parallel regions R2 that encloses another serialized parallel region R3.
Note that the thread T is the master thread of both R2 and R3 regions.

Assume that __ompt_get_task_info_internal function is called with the
argument "ancestor_level == 1" during the execution of region R3.
The function should determine the "thread_num" of the thread T inside
the team of region R2, whose implicit task is at level 1 inside the
hierarchy of active tasks. Since the thread T is the master thread of
region R2, one should expected that "thread_num" takes a value 0.
After the while loop finishes, the following stands: "lwt != NULL",
"prev_lwt == NULL", "prev_team" represents the team information about
the innermost serialized parallel region R3. This results in executing
the assignment "thread_num = prev_team-&gt;t.t_master_tid". Note that
"prev_team-&gt;t.t_master_tid" was initialized at the moment of
R2’s creation and represents the "thread_num" of the thread T inside
the region R1 which encloses R2. Since the thread T is the worker thread
of the region R1, "the thread_num" takes value 1, which is a contradiction.

This patch proposes to use "lwt" instead of "prev_lwt" when determining
the "thread_num". If "lwt" exists, the task at the requested level belongs
to the serialized parallel region. Since the serialized parallel region
is executed by one thread only, the "thread_num" takes value 0.

Similarly, assume that __ompt_get_task_info_internal function is called
with the argument "ancestor_level == 2" during the execution of region R3.
The function should determine the "thread_num" of the thread T inside the
team of region R1. Since the thread is the worker inside the region R1,
one should expected that "thread_num" takes value 1. After the loop finishes,
the following stands: "lwt == NULL", "prev_lwt != NULL", "prev_team" represents
the team information about the innermost serialized parallel region R3.
This leads to execution of the assignment "thread_num = 0", which causes
a contradiction.

Ignoring the "prev_lwt" leads to executing the assignment
"thread_num = prev_team-&gt;t.t_master_tid" instead. From the previous explanation,
it is obvious that "thread_num" takes value 1.

Note that the "prev_lwt" variable is marked as unnecessary and thus removed.

This patch introduces the test case which represents the OpenMP program
described earlier in the summary.

Differential Revision: https://reviews.llvm.org/D110699
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][OMPT] thread_num determination for programs with explicit tasks</title>
<updated>2021-10-18T11:54:22+00:00</updated>
<author>
<name>@vladaindjic</name>
<email>vladaindjic@uns.ac.rs</email>
</author>
<published>2021-10-18T09:33:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=59a994e8daeef94976841a11bc92ca3a2b6a10b3'/>
<id>59a994e8daeef94976841a11bc92ca3a2b6a10b3</id>
<content type='text'>
__ompt_get_task_info_internal is now able to determine the right value of the
“thread_num” argument during the execution of an explicit task.

During the execution of a while loop that iterates over the ancestor tasks
hierarchy, the “prev_team” variable was always set to “team” variable at the
beginning of each loop iteration.

Assume that the program contains a parallel region which encloses an explicit
task executed by the worker thread of the region. Also assume that the tool
inquires the “thread_num” of a worker thread for the implicit task that
corresponds to the region (task at “ancestor_level == 1”) and expects to
receive the value of “thread_num &gt; 0”.
After the loop finishes, both “team” and “prev_team” variables are equal and
point to the team information of the parallel region.
The “thread_num” is set to “prev_team-&gt;t.t_master_tid”, that is equal to
“team-&gt;t.t_master_tid”. In this case, “team-&gt;t.t_master_tid” is 0, since
the master thread of the region is the initial master thread of the program.
This leads to a contradiction.

To prevent this, “prev_team” variable is set to “team” variable only at the
time when the loop that has already encountered the implicit task (“taskdata”
variable contains the information about an implicit task) continues iterating
over the implicit task’s ancestors, if any.

After the mentioned loop finishes, the “prev_team” variable might be equal to
NULL. This means that the task at requested “ancestor_level” belongs to the
innermost parallel region, so the “thread_num” will be determined by calling
the “__kmp_get_tid”.

To prove that this patch works, the test case “explicit_task_thread_num.c” is
provided.
It contains the example of the program explained earlier in the summary.

Differential Revision: https://reviews.llvm.org/D110473
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__ompt_get_task_info_internal is now able to determine the right value of the
“thread_num” argument during the execution of an explicit task.

During the execution of a while loop that iterates over the ancestor tasks
hierarchy, the “prev_team” variable was always set to “team” variable at the
beginning of each loop iteration.

Assume that the program contains a parallel region which encloses an explicit
task executed by the worker thread of the region. Also assume that the tool
inquires the “thread_num” of a worker thread for the implicit task that
corresponds to the region (task at “ancestor_level == 1”) and expects to
receive the value of “thread_num &gt; 0”.
After the loop finishes, both “team” and “prev_team” variables are equal and
point to the team information of the parallel region.
The “thread_num” is set to “prev_team-&gt;t.t_master_tid”, that is equal to
“team-&gt;t.t_master_tid”. In this case, “team-&gt;t.t_master_tid” is 0, since
the master thread of the region is the initial master thread of the program.
This leads to a contradiction.

To prevent this, “prev_team” variable is set to “team” variable only at the
time when the loop that has already encountered the implicit task (“taskdata”
variable contains the information about an implicit task) continues iterating
over the implicit task’s ancestors, if any.

After the mentioned loop finishes, the “prev_team” variable might be equal to
NULL. This means that the task at requested “ancestor_level” belongs to the
innermost parallel region, so the “thread_num” will be determined by calling
the “__kmp_get_tid”.

To prove that this patch works, the test case “explicit_task_thread_num.c” is
provided.
It contains the example of the program explained earlier in the summary.

Differential Revision: https://reviews.llvm.org/D110473
</pre>
</div>
</content>
</entry>
</feed>
