Community
cancel
Showing results for 
Search instead for 
Did you mean: 
wspear
Beginner
256 Views

Support for ompt_callback_master removed / _OPENMP macro incorrect?

I'm using the intel compilers that came with the latest hpc oneapi package:

$ icpc --version
icpc (ICC) 2021.1 Beta 20201112

I'm trying to compile some code that uses ompt_callback_master which I understand has been deprecated as of OpenMP 5.1 to be replaced with ompt_callback_masked, but this is the first time I've encountered a compiler for which ompt_callback_master is undefined. If I replace it with ompt_callback_masked it works. In theory I can just check the OPENMP version tag with a macro and use masked instead of master for later versions. However when I check this compiler's _OPENMP macro I get:

$ icpc -fopenmp -dM -E - < /dev/null | grep OPENMP
#define _OPENMP 201611

That seems way too early to have entirely removed ompt_callback_master even if it is deprecated so I wonder if either support for ompt_callback_master was removed prematurely or the _OPENMP define hasn't been updated or possibly both.

0 Kudos
6 Replies
Gopika_Intel
Moderator
226 Views

Hi,


Thank you for posting in Intel C++ Compiler forum. We're trying it from our end. We'll get back to you with an answer.


Regards

Gopika


Gopika_Intel
Moderator
217 Views

Hi,


Could you please provide us with the reproducer code so that we can try it from our end.


Regards

Gopika


wspear
Beginner
212 Views

#include <omp-tools.h>
#include <iostream>

int main() {
    std::cout << ompt_callback_masked << "\n";
    std::cout << ompt_callback_master << "\n";
    return 0;
}

 Call it ompt_callback_test.cpp and build like:

icpc -qopenmp ./ompt_callback_test.cpp

With the version of icpc I have here this will fail like:

./ompt_callback_test.cpp(8): error: identifier "ompt_callback_master" is undefined
std::cout << ompt_callback_master << "\n";

But if you comment out the line to print master, it will print masked without trouble.

In theory if OpenMP 5.1 or earlier is being supported  master should still be defined as shown here: https://www.openmp.org/spec-html/5.1/openmpsu210.html

Or _OPENMP should give a result indicating a later version (unless there is a different way to determine the OMPT support level I am not aware of).

Gopika_Intel
Moderator
190 Views

Hi,

 

Thank you for providing us with the reproducer code. We were able to reproduce the issue. We are discussing it with the internal team and we’ll get back to you with an answer.

 

Regards

Gopika


Gopika_Intel
Moderator
186 Views

Hi,

 

We are forwarding this case to the internal team who can help you out.

 

Regards

Gopika


Khalik_K_Intel
Employee
79 Views

Hello,

Thank you for posting in Intel C++ Compiler forum.


Officially supported versions of openMP for Intel C/C++ compilers are:

  • OpenMP 4.5 and subset of OpenMP 5.0 in C/C++/Fortran compiler classic 2021.1
  • OpenMP 4.5 and subset of OpenMP 5.1 supported in oneAPI DPC+/C+ compiler 2021.1 under -fiopenmp -fopenmp-targets=spir64

(https://www.openmp.org/resources/openmp-compilers-tools/)

So, the officially supported version of openMP is openMP 4.5. Therefore, the _OPENMP macro is correct.

Regarding removal of ompt_callback_master: I have discussed it with openMP experts and, as a result, reported this issue to a development team to fix it.

In the meantime, you can use ompt_callback_masked instead or you can set ompt_callback_master yourself inside the code by:

int ompt_callback_master = 21;

or

int ompt_callback_master = ompt_callback_masked;


Regards,

Khalik.