devito icon indicating copy to clipboard operation
devito copied to clipboard

TTI compilation error on KNL with gcc

Open georgebisbas opened this issue 3 years ago • 2 comments

TODO: Need to add MFE... (sth with nested-par/gcc)

Nested-parallelism OpenMP loops are not digested by GCC on KNLs. ()

To reproduce with (gcc (GCC) 9.1.0)

DEVITO_LOGGING=DEBUG DEVITO_PLATFORM=knl DEVITO_LANGUAGE=openmp DEVITO_ARCH=gcc python examples/seismic/tti/tti_example.py -d 128 128 128 --tn 128

    #pragma omp for collapse(2) schedule(dynamic,1)
    for (int x0_blk0 = x_m; x0_blk0 <= x_M; x0_blk0 += x0_blk0_size)
    {
      for (int y0_blk0 = y_m; y0_blk0 <= y_M; y0_blk0 += y0_blk0_size)
      {
        #pragma omp parallel for collapse(2) schedule(dynamic,1) num_threads(nthreads_nested)
        for (int x = x0_blk0 - 1, xs = 0; x <= x0_blk0 + x0_blk0_size - 1; x += 1, xs += 1)
        {
          for (int y = y0_blk0 - 1, ys = 0; y <= y0_blk0 + y0_blk0_size - 1; y += 1, ys += 1)
          {
            #pragma omp simd aligned(u,v:64)
            for (int z = z_m - 1; z <= z_M; z += 1)
gcc -O3 -g -fPIC -Wall -std=c99 -march=native -Wno-unused-result -Wno-unused-variable -Wno-unused-but-set-variable -ffast-math -shared -fopenmp /dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.c -lm -o /dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.so
/dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.c: In function ‘ForwardTTI’:
/dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.c:110:45: error: expected iteration declaration or initialization before ‘x’
  110 |           for (int x = x0_blk0 - 1, xs = 0; x <= MIN(x_M, x0_blk0 + x0_blk0_size - 1); x += 1, xs += 1)
      |                                             ^
/dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.c:112:47: error: expected iteration declaration or initialization before ‘y’
  112 |             for (int y = y0_blk0 - 1, ys = 0; y <= MIN(y_M, y0_blk0 + y0_blk0_size - 1); y += 1, ys += 1)
      |                                               ^
/dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.c:125:41: error: expected iteration declaration or initialization before ‘x’
  125 |           for (int x = x0_blk0, xs = 0; x <= MIN(x_M, x0_blk0 + x0_blk0_size - 1); x += 1, xs += 1)
      |                                         ^
/dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.c:127:43: error: expected iteration declaration or initialization before ‘y’
  127 |             for (int y = y0_blk0, ys = 0; y <= MIN(y_M, y0_blk0 + y0_blk0_size - 1); y += 1, ys += 1)
      |                                           ^
FAILED compiler invocation:gcc -O3 -g -fPIC -Wall -std=c99 -march=native -Wno-unused-result -Wno-unused-variable -Wno-unused-but-set-variable -ffast-math -shared -fopenmp /dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.c -lm -o /dev/shm/devito-jitcache-uid2615/ed6647d9fa8c31a5c8e6ffc29bf47be8582ba628.so

georgebisbas avatar May 31 '21 15:05 georgebisbas

This is not from master, so I don't see how it would be an issue

FabioLuporini avatar Jun 07 '21 07:06 FabioLuporini

Oops, what did I do, I pasted wrong error log. It is from master though. Will edit the post above, sorry!

georgebisbas avatar Jun 07 '21 07:06 georgebisbas