<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112545>112545</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][OpenMP][OMPT] Warning for loop types not needed anymore
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Thyre
</td>
</tr>
</table>
<pre>
Back in https://github.com/llvm/llvm-project/issues/63904, I've reported that the OpenMP Tools Interface implementation in LLVM fails to transfer the loop type to an attached tool, giving only a limited amount of information.
At some point between the reported issue and https://github.com/llvm/llvm-project/pull/97429, a warning was added for Flang explicitly:
```
OMP: Warning #189: OMPT: Cannot determine workshare type; using the default (loop) instead. This issue is fixed in an up-to-date compiler.
```
Back when the issue was not fixed in `libomp`, the warning was a bit weird, as the issue was not fixed in an up-to-date compiler. However, the issue is now irrelevant, as the information is transferred correctly:
```fortran
program parallel_sum
use omp_lib
implicit none
integer(8) :: sum
integer :: i
sum = 0
call omp_set_num_threads( 2 )
!$omp parallel do reduction(+:sum) default(none)
do i = 0, 99
sum = sum + i
end do
!$omp end parallel do
!$omp parallel do reduction(+:sum) default(none) schedule(static)
do i = 0, 99
sum = sum + i
end do
!$omp end parallel do
!$omp parallel do reduction(+:sum) default(none) schedule(dynamic)
do i = 0, 99
sum = sum + i
end do
!$omp end parallel do
!$omp parallel do reduction(+:sum) default(none) schedule(guided)
do i = 0, 99
sum = sum + i
end do
!$omp end parallel do
!$omp parallel do reduction(+:sum) default(none) schedule(auto)
do i = 0, 99
sum = sum + i
end do
!$omp end parallel do
!$omp parallel do reduction(+:sum) default(none) schedule(runtime)
do i = 0, 99
sum = sum + i
end do
!$omp end parallel do
end program parallel_sum
```
Attaching a basic information dumping tool, the following information is obtained:
```console
$ flang --version
flang version 20.0.0git (https://github.com/llvm/llvm-project.git 77f8297c6fdaa62121ddb108043dcaad5c45c7ad)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/apps/software/Clang/trunk/bin
Build config: +assertions
$ flang -fopenmp test.f90
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
$ ./a.out | grep "callback_work"
OMP: Warning #189: OMPT: Cannot determine workshare type; using the default (loop) instead. This issue is fixed in an up-to-date compiler.
[0][callback_work] work_type = loop_static | endpoint = begin | parallel_data->value = 666000001 (0x55b5b7030f60) | task_data->value = 555000002 (0x55b5b7039640) | count = 100 | codeptr_ra = 0x55b5b591b310
[0][callback_work] work_type = loop_static | endpoint = end | parallel_data->value = 666000001 (0x55b5b7030f60) | task_data->value = 555000002 (0x55b5b7039640) | count = 0 | codeptr_ra = 0x55b5b591b34d
[1][callback_work] work_type = loop_static | endpoint = begin | parallel_data->value = 666000001 (0x55b5b7030f60) | task_data->value = 555000003 (0x55b5b7039780) | count = 100 | codeptr_ra = 0x55b5b591b310
[1][callback_work] work_type = loop_static | endpoint = end | parallel_data->value = 666000001 (0x55b5b7030f60) | task_data->value = 555000003 (0x55b5b7039780) | count = 0 | codeptr_ra = 0x55b5b591b34d
[0][callback_work] work_type = loop_static | endpoint = begin | parallel_data->value = 666000002 (0x55b5b7030f60) | task_data->value = 555000004 (0x55b5b7039640) | count = 100 | codeptr_ra = 0x55b5b591b140
[0][callback_work] work_type = loop_static | endpoint = end | parallel_data->value = 666000002 (0x55b5b7030f60) | task_data->value = 555000004 (0x55b5b7039640) | count = 0 | codeptr_ra = 0x55b5b591b17d
[1][callback_work] work_type = loop_static | endpoint = begin | parallel_data->value = 666000002 (0x55b5b7030f60) | task_data->value = 555000005 (0x55b5b7039780) | count = 100 | codeptr_ra = 0x55b5b591b140
[1][callback_work] work_type = loop_static | endpoint = end | parallel_data->value = 666000002 (0x55b5b7030f60) | task_data->value = 555000005 (0x55b5b7039780) | count = 0 | codeptr_ra = 0x55b5b591b17d
[0][callback_work] work_type = loop_dynamic | endpoint = begin | parallel_data->value = 666000003 (0x55b5b7030f60) | task_data->value = 555000006 (0x55b5b7039640) | count = 100 | codeptr_ra = 0x55b5b591af5f
[1][callback_work] work_type = loop_dynamic | endpoint = begin | parallel_data->value = 666000003 (0x55b5b7030f60) | task_data->value = 555000007 (0x55b5b7039780) | count = 100 | codeptr_ra = 0x55b5b591af5f
[0][callback_work] work_type = loop_dynamic | endpoint = end | parallel_data->value = 666000003 (0x55b5b7030f60) | task_data->value = 555000006 (0x55b5b7039640) | count = 0 | codeptr_ra = 0x55b5b591af82
[1][callback_work] work_type = loop_dynamic | endpoint = end | parallel_data->value = 666000003 (0x55b5b7030f60) | task_data->value = 555000007 (0x55b5b7039780) | count = 0 | codeptr_ra = 0x55b5b591af82
[0][callback_work] work_type = loop_guided | endpoint = begin | parallel_data->value = 666000004 (0x55b5b7030f60) | task_data->value = 555000008 (0x55b5b7039640) | count = 100 | codeptr_ra = 0x55b5b591ad8f
[1][callback_work] work_type = loop_guided | endpoint = begin | parallel_data->value = 666000004 (0x55b5b7030f60) | task_data->value = 555000009 (0x55b5b7039780) | count = 100 | codeptr_ra = 0x55b5b591ad8f
[1][callback_work] work_type = loop_guided | endpoint = end | parallel_data->value = 666000004 (0x55b5b7030f60) | task_data->value = 555000009 (0x55b5b7039780) | count = 0 | codeptr_ra = 0x55b5b591adb2
[0][callback_work] work_type = loop_guided | endpoint = end | parallel_data->value = 666000004 (0x55b5b7030f60) | task_data->value = 555000008 (0x55b5b7039640) | count = 0 | codeptr_ra = 0x55b5b591adb2
[0][callback_work] work_type = loop_guided | endpoint = begin | parallel_data->value = 666000005 (0x55b5b7030f60) | task_data->value = 555000010 (0x55b5b7039640) | count = 100 | codeptr_ra = 0x55b5b591abbf
[0][callback_work] work_type = loop_guided | endpoint = end | parallel_data->value = 666000005 (0x55b5b7030f60) | task_data->value = 555000010 (0x55b5b7039640) | count = 0 | codeptr_ra = 0x55b5b591abe2
[1][callback_work] work_type = loop_guided | endpoint = begin | parallel_data->value = 666000005 (0x55b5b7030f60) | task_data->value = 555000011 (0x55b5b7039780) | count = 100 | codeptr_ra = 0x55b5b591abbf
[1][callback_work] work_type = loop_guided | endpoint = end | parallel_data->value = 666000005 (0x55b5b7030f60) | task_data->value = 555000011 (0x55b5b7039780) | count = 0 | codeptr_ra = 0x55b5b591abe2
[0][callback_work] work_type = loop_static | endpoint = begin | parallel_data->value = 666000006 (0x55b5b7030f60) | task_data->value = 555000012 (0x55b5b7039640) | count = 100 | codeptr_ra = 0x55b5b591a9ef
[0][callback_work] work_type = loop_static | endpoint = end | parallel_data->value = 666000006 (0x55b5b7030f60) | task_data->value = 555000012 (0x55b5b7039640) | count = 0 | codeptr_ra = 0x55b5b591aa12
[1][callback_work] work_type = loop_static | endpoint = begin | parallel_data->value = 666000006 (0x55b5b7030f60) | task_data->value = 555000013 (0x55b5b7039780) | count = 100 | codeptr_ra = 0x55b5b591a9ef
[1][callback_work] work_type = loop_static | endpoint = end | parallel_data->value = 666000006 (0x55b5b7030f60) | task_data->value = 555000013 (0x55b5b7039780) | count = 0 | codeptr_ra = 0x55b5b591aa12
```
This matches the information obtained with a C / C++ source code.
Therefore, the warning can probably just be removed.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWk9z4rgS_zTi0gVlyzbYBw4hedSbqp2aOaTeHinZaoM2suSSZEi-_SvJEJLs7CYwhuxOagoG_Wn1r3_d6rYlZq1YK8Q5yRYkuxuxzm20md9vngyOSs2f5gtWPYBQsHGutSS5IXRJ6HIt3KYrJ5VuCF1KuT18jVuj_8DKEboU1nZoCV1OkyJKCb2FL4TOtggGW20ccnAb5sBtEL61qL5-h3utpYUvyqGpWYUgmlZig8oxJ7TySvz22_--Qs2EtOA0OMOUrdEEGVLrFtxTi76HKWDOsWrjV9Fa-tXXYivUGrSST8BAikZ4HVijO-VA1yBUrU0TlpqQ6I5EN_3njQOrG4RWC-WgRLdDVGHJZyABKjDFT7dS20lJ6LKYpbTwWjLYMaO8ojtmgXGOHGptYCmZWgM-tlJUwsknv8YLJck02v8LP799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