Compiling Serpent 2.1.31 with OpenMP: issue with gcc 9

Compiler issues (Intel compiler, mpicc, etc.), data libraries and everything needed to get Serpent running is discussed here
Post Reply
paulromano
Posts: 2
Joined: Tue May 21, 2013 2:16 am
Security question 1: No
Security question 2: 92

Compiling Serpent 2.1.31 with OpenMP: issue with gcc 9

Post by paulromano » Mon Nov 11, 2019 7:19 pm

Trying to compile Serpent 2.1.31 with gcc 9.2 produces the following:

Code: Select all

gcc -O3 -ffast-math -Wall -ansi -Wunused -DOPEN_MP -fopenmp -pedantic -c collectfet.c
collectfet.c: In function ‘CollectFET’:
collectfet.c:60:9: error: ‘coef2’ not specified in enclosing ‘parallel’
   60 | #pragma omp parallel for collapse(3) default(none) \
      |         ^~~
collectfet.c:60:9: error: enclosing ‘parallel’
collectfet.c:60:9: error: ‘coef1’ not specified in enclosing ‘parallel’
collectfet.c:60:9: error: enclosing ‘parallel’
collectfet.c:60:9: error: ‘coef0’ not specified in enclosing ‘parallel’
collectfet.c:60:9: error: enclosing ‘parallel’
collectfet.c:68:15: error: ‘params’ not specified in enclosing ‘parallel’
   68 |     coefIdx = FETIdx(params, n2, n1, n0);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~
collectfet.c:60:9: error: enclosing ‘parallel’
   60 | #pragma omp parallel for collapse(3) default(none) \
      |         ^~~
collectfet.c:78:25: error: ‘scorePtr’ not specified in enclosing ‘parallel’
   78 |       bufPtr = scorePtr + coefOffset*BUF_BLOCK_SIZE;
      |                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
collectfet.c:60:9: error: enclosing ‘parallel’
   60 | #pragma omp parallel for collapse(3) default(none) \
      |         ^~~
collectfet.c:93:23: error: ‘totalCoefficients’ not specified in enclosing ‘parallel’
   93 |       if (coefIdx + 1 == totalCoefficients)
      |           ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
collectfet.c:60:9: error: enclosing ‘parallel’
   60 | #pragma omp parallel for collapse(3) default(none) \
      |         ^~~
collectfet.c:70:27: error: ‘totalLayers’ not specified in enclosing ‘parallel’
   70 |     for (layer = 0; layer < totalLayers; ++layer)
      |                     ~~~~~~^~~~~~~~~~~~~
collectfet.c:60:9: error: enclosing ‘parallel’
   60 | #pragma omp parallel for collapse(3) default(none) \
      |         ^~~
It looks like this is related to some changes in how data sharing is treated with gcc 9, where they've defaulted to OpenMP 4 behavior rather than OpenMP 3.1. Not sure what the right fix is but I figured I would report this so that others may address it.

Ville Valtavirta
Posts: 450
Joined: Fri Sep 07, 2012 1:43 pm
Security question 1: No
Security question 2: 92

Re: Compiling Serpent 2.1.31 with OpenMP: issue with gcc 9

Post by Ville Valtavirta » Wed Nov 13, 2019 12:56 pm

Thank you Paul for reporting this,

it seems a quick fix for this is to move from default(none) on line 60 of the file to default(shared).

I'll have to test the change once I get my hands on gcc 9.

-Ville

Post Reply