- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lenovo T570, Ubuntu 18.04.4, icpc (ICC) 2021.1 Beta 20200602
Given the following example code:
#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 follows:
icpc -std=c++17 -O3 -o bug1 bug1.cpp -qnextgen -fiopenmp -fopenmp-targets=spir64
Commenting out any of the pragma lines containing "parallel" and the code will hang when executed. The non-"parallel" pragmas work correctly. The problem seems to be omp_get_num_threads(). If you remove that from the print statement then all the pragma lines result in execution that works.
I'm new to this offloading part of OpenMP but seems to me it should work properly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Craig,
This thread is a duplicate of https://community.intel.com/t5/Intel-oneAPI-HPC-Toolkit/OpenMP-offload-hangs-if-omp-get-num-threads-used-in-target-quot/m-p/1189420#M6891.
Since there is no problem with teams both the threads raised by you are dealing with the same issue.
We are closing this thread. Please follow the above thread for the solution.
Regards
Prasanth
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Craig,
This thread is a duplicate of https://community.intel.com/t5/Intel-oneAPI-HPC-Toolkit/OpenMP-offload-hangs-if-omp-get-num-threads-used-in-target-quot/m-p/1189420#M6891.
Since there is no problem with teams both the threads raised by you are dealing with the same issue.
We are closing this thread. Please follow the above thread for the solution.
Regards
Prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry the duplicate happened when the new system was flagging everything as SPAM. I was trying to get around the filter then someone "released" all the various attempts.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page