- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lenovo T570, Ubuntu 18.04.4, l_BaseKit_b_2021.1.7.1506_offline l_HPCKit_b_2021.1.7.1465_offline
Given the following source:
#include <omp.h>
#include <cstdio>
int
main(int argc, char *argv[])
{
printf("Devices= %d\n", omp_get_num_devices());
printf("Initial device %d (is initial %c)\n", omp_get_initial_device(), omp_is_initial_device()?'Y':'N');
printf("Default device %d\n", omp_get_default_device());
//#pragma omp target parallel
//#pragma omp target parallel for
//#pragma omp target teams
//#pragma omp target teams distribute
//#pragma omp target teams distribute parallel for
for (int i=0; i<8; i++)
{
printf( "%d Team %d of %d, Thread %d of %d\n", i,
omp_get_team_num(), omp_get_num_teams(),
omp_get_thread_num(), omp_get_num_threads());
}
}
Compiled as:
icpc -std=c++17 -O3 -o bug1 bug1.cpp -qnextgen -fiopenmp -fopenmp-targets=spir64
If you individually comment out the various pragma lines you'll find that the ones containing "parallel" all result in the executable hanging. Non-"parallel" work find. The culprit seems to be the omp_get_num_threads() call. If that is removed from the print statement all the pragmas then work properly.
I'm new to the offloading part of OpenMP but it's not obvious to me why this should be a problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We tried the same code that you have provided and we are also getting the same error, try saving the values into say array instead of printing and print it after target section and check if you are getting the same error.
We will also try to debug it more and will reach to you. Thanks for reporting the issue.
Warm Regards,
Abhishek
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've since noticed that if you change "omp_get_num_threads()" to "1*omp_get_num_threads()" then the code will not hang. So, maybe that will help diagnose the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We tried the same code that you have provided and we are also getting the same error, try saving the values into say array instead of printing and print it after target section and check if you are getting the same error.
We will also try to debug it more and will reach to you. Thanks for reporting the issue.
Warm Regards,
Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I've got enough work-arounds to keep me working, but it seems like a bug so I just want to make sure someone looks into it and (if necessary) fixes it in a future release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your reply. I have tried this scenario and I came to know that this is might be the bug with the device printf.
Thanks for reporting this issue, We are escalating this thread to the concerned team for reporting it as a bug.
Warm Regards,
Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Appears fixed as of Beta08
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page