- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ICC 13.0, MSVC 2010
When I disable OpenMP support of ICC, it is displaying bunch of warnings in build log like:
[bash]c:\path/to/file.h(439): warning #161: unrecognized #pragma #pragma omp sections ^[/bash] this warning is abusing me.
I have many OMP pragma's in the code, and when I do benchmarks without OpenMP support versus with OpenMP support, I might miss some IMPORTANT warning hidden somewhere in thousands of these warnings.
I don't want to pass to compiler "/Qwd161" do disable warning about invalid pragma's, since I am afraid of typo in other pragma's, so I would expect warning in this case as non-false positive.
Any objections? This is just a suggestion. TIA!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you don't like that idea for some reason you can try doing something like this:
[cpp]#ifdef _OPENMP #define OMP(x) omp x #else #define OMP(x) message("") #endif [/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you don't like that idea for some reason you can try doing something like this:
- #ifdef_OPENMP
- #defineOMP(x)ompx
- #else
- #defineOMP(x)message("")
- #endif
Ugly hack with preprocessor is rather a workaround then a serious solution, and it has adverse side effect of printing many empty lines into build log.
I don't want to switch it to serial code, because I'm afraid run-time linking OMP .dll might cause overhead, compared to completely turned off the OMP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By sequential I meant in MSVS "Generate Sequential Code (/Qopenmp_stubs)", is this what you meant by "stubs" ? I don't care much about start-up time, but I am afraid of (possibly) creating unused thread by OpenMP library by using this option, which could affect running performance (I don't mind about start-up performance).
But some switch would be really sexy. Just like "ignore '#pragma omp' at all when OMP is not understood/turned on", w/o a warning, so I will need not to use switch to ignore warning, nor use preprocessor hacks, nor using "sequential OMP".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You mean when OpenMP support is disabled, it should generate for "#pragma omp ..." special warning (not one like in current implementation "unrecognised pragma"), but special warning like "OMP is disabled, ignoring #pragma omp" with its separate warning number? So one could easily disable only OMP warnings, but not ALL #pragma warnings? If so, I like the idea to have separate warning number for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you disable warning you may forget to re-enable OpenMP later. I really don't see a need for special treatment here.
Finally, instead of using message("") like in my example you can use any other NOP construct that won't generate any code or add any empty lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Igor Levicki wrote:Greetings, which NOP pragma construct you would suggest? Because even "#pragma ivdep" is causing warning/remark message (since it is not in the front of a loop). I have came thru ICC documentation and maybe I am blind, but I don't see NOP pragma generating ***NONE*** output in the build log. And yes, switching OMP to generate serial code is remedy... but I guess it is just another JMP instruction into OpenMP DLL exported procedures table (or maybe followed by CALL instruction @ Windows) which could waste performance due to instruction cache flush. CALL maybe don't flush cache in all cases, but I guess JMP (as it is implemented on Windows) does indeed in any case (at least L1 cache ; maybe not L2 one).
As I said (and Tim confirmed), switching to serial OpenMP code will solve your problem.
If you disable warning you may forget to re-enable OpenMP later. I really don't see a need for special treatment here.
Finally, instead of using message("") like in my example you can use any other NOP construct that won't generate any code or add any empty lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Brandon Hewitt (Intel) wrote:Greetings, this I would very appreciate. Thank you.
Unfortunately there isn't currently a clean way to do this, but I like the idea, so I've submitted a feature request to our front end team to create a different warning to explicitly diagnose unrecognized OpenMP pragmas separately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Marián "VooDooMan" Meravý wrote:Or maybe some specific pragmas, like: #pragma warning( push ) # pragma warning( disable: <specific_number_of_ICC_warning/remark> ) // code #pragma warning( pop ) that I can use in the front of all header files, i.e. in the main, first *.h file of includes (in this case without "push" like -> ) #ifdef DISABLE_OMP_THINGIE_ETC # pragma warning( disable: <specific_number_of_ICC_warning/remark> ) #endif
Quote:
Brandon Hewitt (Intel)wrote:Unfortunately there isn't currently a clean way to do this, but I like the idea, so I've submitted a feature request to our front end team to create a different warning to explicitly diagnose unrecognized OpenMP pragmas separately.
Greetings,
this I would very appreciate.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Marián,
In version 14.0 of the compiler (available in Intel(R) C++ Composer XE 2013 SP1), we now have OpenMP* pragmas under their own warning number, like so:
$ icc -c test.cpp
test.cpp(2): warning #3180: unrecognized OpenMP #pragma
#pragma omp parallel for
^
test.cpp(8): warning #161: unrecognized #pragma
#pragma blh
^
So now you can use -diag-disable 3180 to disable these OpenMP*-specific pragmas. Let me know if that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it is impractical to always changes more than 1 option (enable/disable OMP) in MSVC IDE, when I am transitioning between various configuration profiles, when I am experimenting in regard of best CPU utilisation in the project.
My wish is to file a feature request.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Marián "VooDooMan" Meravý wrote:
Quote:
Brandon Hewitt (Intel)wrote:Unfortunately there isn't currently a clean way to do this, but I like the idea, so I've submitted a feature request to our front end team to create a different warning to explicitly diagnose unrecognized OpenMP pragmas separately.
Greetings, this I would very appreciate. Thank you.
Ouch, this thread is so old that I forgot in my previous post about above quote. I am sorry for that. Thanks again!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page