<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/llvm.git/openmp/runtime/src/kmp_tasking.cpp, branch EmptyLineAfterFunctionDefinition</title>
<subtitle>github.com: llvm/llvm-project.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/'/>
<entry>
<title>[OpenMP] libomp: add check of task function pointer for NULL.</title>
<updated>2021-10-18T16:48:30+00:00</updated>
<author>
<name>AndreyChurbanov</name>
<email>andrey.churbanov@intel.com</email>
</author>
<published>2021-10-18T16:48:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=63f8099e233c37bae1dcf2629ec62db8de6cc356'/>
<id>63f8099e233c37bae1dcf2629ec62db8de6cc356</id>
<content type='text'>
This patch allows to simplify compiler implementation on "taskwait nowait"
construct. The "taskwait nowait" is semantically equivalent to the empty task.
Instead of creating an empty routine as a task entry, compiler can just send
NULL pointer to the runtime. Then the runtime will make all the work with
dependences and return because of the absent task routine.

Differential Revision: https://reviews.llvm.org/D112015
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch allows to simplify compiler implementation on "taskwait nowait"
construct. The "taskwait nowait" is semantically equivalent to the empty task.
Instead of creating an empty routine as a task entry, compiler can just send
NULL pointer to the runtime. Then the runtime will make all the work with
dependences and return because of the absent task routine.

Differential Revision: https://reviews.llvm.org/D112015
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Fix task wait doesn't work as expected in serialized team</title>
<updated>2021-08-31T16:15:46+00:00</updated>
<author>
<name>Shilei Tian</name>
<email>tianshilei1992@gmail.com</email>
</author>
<published>2021-08-31T16:15:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=8442967fe32453ada32913d1e0fdd97b19520df2'/>
<id>8442967fe32453ada32913d1e0fdd97b19520df2</id>
<content type='text'>
As discussed in D107121, task wait doesn't work when a regular task T depends on
a detached task or a hidden helper task T' in a serialized team. The root cause is,
since the team is serialized, the last task will not be tracked by
`td_incomplete_child_tasks`. When T' is finished, it first releases its
dependences, and then decrements its parent counter. So far so good. For the thread
that is running task wait, if at the moment it is still spinning and trying to
execute tasks, it is fine because it can detect the new task and execute it.
However, if it happends to finish the function `flag.execute_tasks(...)`, it will
be broken because `td_incomplete_child_tasks` is 0 now.

In this patch, we update the rule to track children tasks a little bit. If the
task team encounters a proxy task or a hidden helper task, all following tasks
will be tracked.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D107496
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As discussed in D107121, task wait doesn't work when a regular task T depends on
a detached task or a hidden helper task T' in a serialized team. The root cause is,
since the team is serialized, the last task will not be tracked by
`td_incomplete_child_tasks`. When T' is finished, it first releases its
dependences, and then decrements its parent counter. So far so good. For the thread
that is running task wait, if at the moment it is still spinning and trying to
execute tasks, it is fine because it can detect the new task and execute it.
However, if it happends to finish the function `flag.execute_tasks(...)`, it will
be broken because `td_incomplete_child_tasks` is 0 now.

In this patch, we update the rule to track children tasks a little bit. If the
task team encounters a proxy task or a hidden helper task, all following tasks
will be tracked.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D107496
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Use `__kmpc_give_task` in `__kmp_push_task` when encountering a hidden helper task</title>
<updated>2021-08-20T00:49:29+00:00</updated>
<author>
<name>Shilei Tian</name>
<email>tianshilei1992@gmail.com</email>
</author>
<published>2021-08-20T00:49:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=1d8d43ae61509c91ccd8f647d99bfd53fa254d3c'/>
<id>1d8d43ae61509c91ccd8f647d99bfd53fa254d3c</id>
<content type='text'>
This patch replaces the current implementation, overwrites `gtid` and `thread`,
with `__kmpc_give_task`.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D106977
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces the current implementation, overwrites `gtid` and `thread`,
with `__kmpc_give_task`.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D106977
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] mark target task untied</title>
<updated>2021-08-07T16:31:20+00:00</updated>
<author>
<name>Ye Luo</name>
<email>yeluo@anl.gov</email>
</author>
<published>2021-08-07T16:31:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=262289c1037745bf3dfe45941d9002ff80b77db8'/>
<id>262289c1037745bf3dfe45941d9002ff80b77db8</id>
<content type='text'>
OpenMP specification Tasking Terminology
target task :A mergeable and untied task that ...

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D107686
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenMP specification Tasking Terminology
target task :A mergeable and untied task that ...

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D107686
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Clean up for hidden helper task</title>
<updated>2021-08-04T16:36:44+00:00</updated>
<author>
<name>Shilei Tian</name>
<email>tianshilei1992@gmail.com</email>
</author>
<published>2021-08-04T16:36:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=680c71b127a995389869f51eaef24c7e9d0b2505'/>
<id>680c71b127a995389869f51eaef24c7e9d0b2505</id>
<content type='text'>
This patch makes some clean up for code of hidden helper task.

Reviewed By: protze.joachim

Differential Revision: https://reviews.llvm.org/D107008
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes some clean up for code of hidden helper task.

Reviewed By: protze.joachim

Differential Revision: https://reviews.llvm.org/D107008
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Fix performance regression reported in bug #51235</title>
<updated>2021-08-04T16:34:49+00:00</updated>
<author>
<name>Shilei Tian</name>
<email>tianshilei1992@gmail.com</email>
</author>
<published>2021-08-04T16:34:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=9f5d6ea52eb120ba370bf16ee0537602c6fc727e'/>
<id>9f5d6ea52eb120ba370bf16ee0537602c6fc727e</id>
<content type='text'>
This patch fixes the "performance regression" reported in https://bugs.llvm.org/show_bug.cgi?id=51235. In fact it has nothing to do with performance. The root cause is, the stolen task is not allowed to execute by another thread because by default it is tied task. Since hidden helper task will always be executed by hidden helper threads, it should be untied.

Reviewed By: protze.joachim

Differential Revision: https://reviews.llvm.org/D107121
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes the "performance regression" reported in https://bugs.llvm.org/show_bug.cgi?id=51235. In fact it has nothing to do with performance. The root cause is, the stolen task is not allowed to execute by another thread because by default it is tied task. Since hidden helper task will always be executed by hidden helper threads, it should be untied.

Reviewed By: protze.joachim

Differential Revision: https://reviews.llvm.org/D107121
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][NFC] libomp: silence warnings on unused variables.</title>
<updated>2021-07-30T14:04:42+00:00</updated>
<author>
<name>AndreyChurbanov</name>
<email>andrey.churbanov@intel.com</email>
</author>
<published>2021-07-30T14:04:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=8b81524c6dd27b8dd7a36d525e5569cdf8d5e188'/>
<id>8b81524c6dd27b8dd7a36d525e5569cdf8d5e188</id>
<content type='text'>
Put declarations/definitions of unused variables under corresponding macros
to silence clang build warnings.

Differential Revision: https://reviews.llvm.org/D106608
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Put declarations/definitions of unused variables under corresponding macros
to silence clang build warnings.

Differential Revision: https://reviews.llvm.org/D106608
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] libomp: Add new experimental barrier: two-level distributed barrier</title>
<updated>2021-07-29T19:09:26+00:00</updated>
<author>
<name>Terry Wilmarth</name>
<email>terry.l.wilmarth@intel.com</email>
</author>
<published>2021-07-15T15:28:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=d8e4cb912180ce0a35d31b616e6f4c0c3d64abb7'/>
<id>d8e4cb912180ce0a35d31b616e6f4c0c3d64abb7</id>
<content type='text'>
Two-level distributed barrier is a new experimental barrier designed
for Intel hardware that has better performance in some cases than the
default hyper barrier.

This barrier is designed to handle fine granularity parallelism where
barriers are used frequently with little compute and memory access
between barriers. There is no need to use it for codes with few
barriers and large granularity compute, or memory intensive
applications, as little difference will be seen between this barrier
and the default hyper barrier. This barrier is designed to work
optimally with a fixed number of threads, and has a significant setup
time, so should NOT be used in situations where the number of threads
in a team is varied frequently.

The two-level distributed barrier is off by default -- hyper barrier
is used by default. To use this barrier, you must set all barrier
patterns to use this type, because it will not work with other barrier
patterns. Thus, to turn it on, the following settings are required:

KMP_FORKJOIN_BARRIER_PATTERN=dist,dist
KMP_PLAIN_BARRIER_PATTERN=dist,dist
KMP_REDUCTION_BARRIER_PATTERN=dist,dist

Branching factors (set with KMP_FORKJOIN_BARRIER, KMP_PLAIN_BARRIER,
and KMP_REDUCTION_BARRIER) are ignored by the two-level distributed
barrier.

Patch fixed for ITTNotify disabled builds and non-x86 builds

Co-authored-by: Jonathan Peyton &lt;jonathan.l.peyton@intel.com&gt;
Co-authored-by: Vladislav Vinogradov &lt;vlad.vinogradov@intel.com&gt;

Differential Revision: https://reviews.llvm.org/D103121
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two-level distributed barrier is a new experimental barrier designed
for Intel hardware that has better performance in some cases than the
default hyper barrier.

This barrier is designed to handle fine granularity parallelism where
barriers are used frequently with little compute and memory access
between barriers. There is no need to use it for codes with few
barriers and large granularity compute, or memory intensive
applications, as little difference will be seen between this barrier
and the default hyper barrier. This barrier is designed to work
optimally with a fixed number of threads, and has a significant setup
time, so should NOT be used in situations where the number of threads
in a team is varied frequently.

The two-level distributed barrier is off by default -- hyper barrier
is used by default. To use this barrier, you must set all barrier
patterns to use this type, because it will not work with other barrier
patterns. Thus, to turn it on, the following settings are required:

KMP_FORKJOIN_BARRIER_PATTERN=dist,dist
KMP_PLAIN_BARRIER_PATTERN=dist,dist
KMP_REDUCTION_BARRIER_PATTERN=dist,dist

Branching factors (set with KMP_FORKJOIN_BARRIER, KMP_PLAIN_BARRIER,
and KMP_REDUCTION_BARRIER) are ignored by the two-level distributed
barrier.

Patch fixed for ITTNotify disabled builds and non-x86 builds

Co-authored-by: Jonathan Peyton &lt;jonathan.l.peyton@intel.com&gt;
Co-authored-by: Vladislav Vinogradov &lt;vlad.vinogradov@intel.com&gt;

Differential Revision: https://reviews.llvm.org/D103121
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Fix deadlock for detachable task with child tasks</title>
<updated>2021-07-27T22:01:35+00:00</updated>
<author>
<name>Joachim Protze</name>
<email>protze@itc.rwth-aachen.de</email>
</author>
<published>2021-06-02T15:39:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=3c76e992911afdf0cb2394e3fba3f13c17c15b26'/>
<id>3c76e992911afdf0cb2394e3fba3f13c17c15b26</id>
<content type='text'>
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=49066.

For detachable tasks, the assumption breaks that the proxy task cannot have
remaining child tasks when the proxy completes.
In stead of increment/decrement the incomplete task count, a high-order bit
is flipped to mark and wait for the incomplete proxy task.

Differential Revision: https://reviews.llvm.org/D101082
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=49066.

For detachable tasks, the assumption breaks that the proxy task cannot have
remaining child tasks when the proxy completes.
In stead of increment/decrement the incomplete task count, a high-order bit
is flipped to mark and wait for the incomplete proxy task.

Differential Revision: https://reviews.llvm.org/D101082
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Fix bug 50022</title>
<updated>2021-07-23T20:54:11+00:00</updated>
<author>
<name>Shilei Tian</name>
<email>tianshilei1992@gmail.com</email>
</author>
<published>2021-07-23T20:53:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=c2c43132f69c6f7e89d97c0c2ce32b0cf2f30e90'/>
<id>c2c43132f69c6f7e89d97c0c2ce32b0cf2f30e90</id>
<content type='text'>
Bug 50022 [0] reports target nowait fails in certain case, which is added in this
patch. The root cause of the failure is, when the second task is created, its
parent's `td_incomplete_child_tasks` will not be incremented because there is no
parallel region here thus its team is serialized. Therefore, when the initial
thread is waiting for its unfinished children tasks, it thought there is only
one, the first task, because it is hidden helper task, so it is tracked. The
second task will only be pushed to the queue when the first task is finished.
However, when the first task finishes, it first decrements the counter of its
parent, and then release dependences. Once the counter is decremented, the thread
will move on because its counter is reset, but actually, the second task has not
been executed at all. As a result, since in this case, the main function finishes,
then `libomp` starts to destroy. When the second task is pushed somewhere, all
some of the structures might already have already been destroyed, then anything
could happen.

This patch simply moves `__kmp_release_deps` ahead of decrement of the counter.
In this way, we can make sure that the initial thread is aware of the existence
of another task(s) so it will not move on. In addition, in order to tackle
dependence chain starting with hidden helper thread, when hidden helper task is
encountered, we force the task to release dependences.

Reference:
[0] https://bugs.llvm.org/show_bug.cgi?id=50022

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D106519
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug 50022 [0] reports target nowait fails in certain case, which is added in this
patch. The root cause of the failure is, when the second task is created, its
parent's `td_incomplete_child_tasks` will not be incremented because there is no
parallel region here thus its team is serialized. Therefore, when the initial
thread is waiting for its unfinished children tasks, it thought there is only
one, the first task, because it is hidden helper task, so it is tracked. The
second task will only be pushed to the queue when the first task is finished.
However, when the first task finishes, it first decrements the counter of its
parent, and then release dependences. Once the counter is decremented, the thread
will move on because its counter is reset, but actually, the second task has not
been executed at all. As a result, since in this case, the main function finishes,
then `libomp` starts to destroy. When the second task is pushed somewhere, all
some of the structures might already have already been destroyed, then anything
could happen.

This patch simply moves `__kmp_release_deps` ahead of decrement of the counter.
In this way, we can make sure that the initial thread is aware of the existence
of another task(s) so it will not move on. In addition, in order to tackle
dependence chain starting with hidden helper thread, when hidden helper task is
encountered, we force the task to release dependences.

Reference:
[0] https://bugs.llvm.org/show_bug.cgi?id=50022

Reviewed By: AndreyChurbanov

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