Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
7568 Discussions

ICC 19.0.4.243 ICC report disagrees with OpenMP specifications on Lenovo Legion Y7000 16 Gb ram i7 8th gen, ubuntu 18.04.

souza_diniz_mendonca
101 Views

Hi there,

 

I am using ICC to parallelize the following program:

#include <stdio.h>
#include <stdlib.h>

void foo(int *vector, int length) {
  int i = 0;
  for (i=0; i<length; i++)
    vector= i;
}

I am using the following command line:

icc -qopenmp -par-threshold0 -no-vec -fno-inline -parallel -qopt-report-phase=all -qopt-report=5 -std=c99 -lrt -c

Given these flags, the compiler generates the following report:

LOOP BEGIN at test.c(6,3)
   remark #17109: LOOP WAS AUTO-PARALLELIZED
   remark #17101: parallel loop shared={ .2 } private={ } firstprivate={ length vector i } lastprivate={ } firstlastprivate={ } reduction={ }
   remark #15540: loop was not vectorized: auto-vectorization is disabled with -no-vec flag
   remark #25439: unrolled with remainder by 2
LOOP END

I am expecting something like the report below:

LOOP BEGIN at test.c(6,3)
   remark #17109: LOOP WAS AUTO-PARALLELIZED
   remark #17101: parallel loop shared={ } private={ i } firstprivate={ } lastprivate={ } firstlastprivate={ } reduction={ }
   remark #15540: loop was not vectorized: auto-vectorization is disabled with -no-vec flag
   remark #25439: unrolled with remainder by 2
LOOP END

It seems to me that the ICC's report disagrees with OpenMP specifications. However, the output for this function is correct. The pointer “ vector ” is assigned as firstprivate, but it is a pointer. The variable “ i ” does not need to copy the initial value, so it can be private and the variable" length " does not need to be firstprivate.

0 Kudos
0 Replies
Reply