[Openmp-dev] Runtime aborts when OMP_THREAD_LIMIT is set and "target teams" construct is used

Simone Atzeni via Openmp-dev openmp-dev at lists.llvm.org
Tue Aug 6 13:02:18 PDT 2019


Submitted a bug here: https://bugs.llvm.org/show_bug.cgi?id=42906

Thanks!
Simone

From: Alexey Bataev <a.bataev at outlook.com>
Sent: Tuesday, August 6, 2019 12:02 PM
To: Simone Atzeni <satzeni at nvidia.com>; openmp-dev at lists.llvm.org
Subject: Re: [Openmp-dev] Runtime aborts when OMP_THREAD_LIMIT is set and "target teams" construct is used


No need to use -fopenmp-targets to reproduce the bug.
$ clang -fopenmp test.c

$ OMP_THREAD_LIMIT=8 ./a.out

OMP: Warning #96: Cannot form a team with 192 threads, using 8 instead.
OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set).
Assertion failure at kmp_runtime.cpp(2434): other_threads[i].
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2434).
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
[1]    148631 abort      OMP_THREAD_LIMIT=8 ./a.out

This is definitely a bug in OpenMP runtime. Better to submit a bug.

-------------

Best regards,

Alexey Bataev
06.08.2019 14:53, Simone Atzeni via Openmp-dev пишет:
Hi,

I have this program:

#define N 100

int main()
{
    int x[N], y[N];

    for (int i = 0; i < N; i++) {
        y[i] = 1;
        x[i] = 1;
    }

#pragma omp target teams distribute parallel for
    for (int i = 0; i < N; i++){
        y[i] += x[i];
    }
}

Compile and run in this way:

$ clang -fopenmp -fopenmp-targets=x86_64-unknown-linux-gnu test.c -lomptarget
$ OMP_THREAD_LIMIT=8 OMP_TARGET_OFFLOAD=DISABLED ./a.out
OMP: Warning #96: Cannot form a team with 80 threads, using 8 instead.
OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set).
Segmentation fault (core dumped)

I get the warning, but why does the runtime aborts?
Is this situation described in the Spec? I could not find anything specific.

I am using Clang/LLVM/OpenMP 8.0.1.

Thanks.
Simone

________________________________
This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
________________________________



_______________________________________________

Openmp-dev mailing list

Openmp-dev at lists.llvm.org<mailto:Openmp-dev at lists.llvm.org>

https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190806/e8dbcedc/attachment.html>


More information about the Openmp-dev mailing list