Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7724 Discussions

Internel error when compiling openmp code using if clause

Ping1
Beginner
146 Views
Hi,

I am trying to use the IF clause with parallel region. I encountered an intermal error when the condition is compound. Please see the the example below. My intel compiler is version 11.1.073. Please help.


-bash-3.2$ icc -c test.c -openmp
(0): internal error: 0_3018

compilation aborted for test.c (code 4)


============== test.c ======================

#include

int main(void){
int x, y;
int i, sum;

x=100;
y=100;

#pragma intel omp parallel if (x>10 && y>10) private(i, sum)
{
for (i=0; i<10000; i++){
sum+=i;
}
}


0 Kudos
2 Replies
TimP
Black Belt
146 Views
I do remember submitting a similar bug report back then. It seems to be corrected in the current intel64 compiler (I added a closing })
I think you should use
icc -openmp -c test.c
and
#include
...
#pragma omp paralllel.....
{
#pragma omp for reduction(+:sum)
for(...){
...
{
{

although there's no dependency on omp.h here.

Even if the internal error were provoked by questionable syntax, it was still a compiler bug, as you supposed.
What I'm referring to as questionable is your code apparently requesting each thread to perform the entire for loop, in case that's not what you intended, then effectively discarding all the results at the end of the parallel (so the compiler might well try to treat it as dead code).
Kittur_G_Intel
Employee
146 Views
Hi,

Yes, this bug has been fixed in the latest release. Please download the release from the Intel Registration Center at: https://registrationcenter.intel.com/RegCenter/Please note also that the release after 11.1 is now called Intel C++ Composer XE (formerly Intel C++ Compiler Professional Edition), and Composer XE includes the Compiler (12.1 version) along with MKL, IPP libraries etc.

Regards,
Kittur
Reply