Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
24 Views

compilation errors

 

Using icc v 15.0.1, I get the errors listed below when compiling the following nested for loops. gcc does not complain. What flags

should be used to "ignore" the errors, or recommend changes to the sources?

 

:

:

#pragma omp parallel for
  for ( size_t K = 0; K < Nseg; ++K ) {
#pragma omp parallel for
    for ( size_t X = 0; X < numDet; ++X ) {
#pragma omp parallel for
      for ( size_t n = 0; n < intN; ++n ) {

:

:

Compile time errors are as follows:

 foo.c(100): error: "K" can only appear on one data scope attribute clause inan OpenMP pragma (except firstprivate and lastprivate)
  #pragma omp parallel for
  ^

foo.c(100): error: "X" can only appear on one data scope attribute clause in an OpenMP pragma (except firstprivate and lastprivate)
  #pragma omp parallel for
  ^compilation aborted for foo.c (code 2)

thanks!

 

0 Kudos
1 Reply
Highlighted
24 Views

What your program is directing the compiler and OpenMP runtime to do is:

a) break the iteration space (0,Nseg] into available number of logical processor number (or less) pieces and allocate each piece to each thread. Note this is the outer for loop.

b) For each thread, and provided nested parallelism is enabled, break the iteration space (0,numDet] into available number of logical processor number (or less) pieces and allocate each piece to each thread. Note, this is the middle loop *** for each thread of the outer loop. IOW, if nested parallelism is enabled, this will require nThreads * nThreads number of threads. Additionally, the error message relates to the outer scoped K not being declared firstprivate.

c) Fore each thread * thread, and provided nested parallelism is enabled, break the iteration space (0,intN] into available number of logical processor number (or less) pieces and allocate each piece to each thread of each thread. Note, this is the middle loop *** for each thread of the outer loop * each thread of the middle loop. IOW, if nested parallelism is enabled, this will require nThreads * nThreads * nThreads number of threads. Additionally, the error message relates to the outer scoped K and middle scoped X not being declared firstprivate.

Jim Dempsey

0 Kudos