RRZE-HPC / kerncraft

Loop Kernel Analysis and Performance Modeling Toolkit
GNU Affero General Public License v3.0
86 stars 24 forks source link

LC analysis fails due to order of indices (?) #72

Closed sguera closed 6 years ago

sguera commented 6 years ago

When running:

kerncraft -p LC stencil.c -m Intel_Xeon_CPU_X5650_2.67GHz_mod.yml  -D M 1224 -D N 1224

I get:

kerncraft                                    
stencil.c -m Intel_Xeon_CPU_X5650_2.67GHz_mod.yml
-D M 1224 -D N 1224
-------------------------------------- LC --------------------------------------
Traceback (most recent call last):
  File "/home/hpc/ihpc/ihpc07/miniconda2/envs/myenv/bin/kerncraft", line 11, in <module>
    load_entry_point('kerncraft==0.6.0', 'console_scripts', 'kerncraft')()
  File "/home/hpc/ihpc/ihpc07/miniconda2/envs/myenv/lib/python3.5/site-packages/kerncraft/kerncraft.py", line 284, in main
    run(parser, args)
  File "/home/hpc/ihpc/ihpc07/miniconda2/envs/myenv/lib/python3.5/site-packages/kerncraft/kerncraft.py", line 250, in run
    model.analyze()
  File "/home/hpc/ihpc/ihpc07/miniconda2/envs/myenv/lib/python3.5/site-packages/kerncraft/models/layer_condition.py", line 201, in analyze
    raise ValueError("Can not apply layer condition, order of indices in array "
ValueError: Can not apply layer condition, order of indices in array does not follow order of loop indices. Single-dimension is currently not supported.

Content of stencil.c:

double a[M][N];
double b[M][N];
double W[M][N][2];

for(int j=1; j < M-1; j++){
for(int i=1; i < N-1; i++){
b[j][i] = W[j][i][0] * a[j][i]
+ W[j][i][1] * ((a[j][i-1] + a[j][i+1]) + (a[j-1][i] + a[j+1][i]))
;
}
}
cod3monk commented 6 years ago

That error message is correct since you are using a strided access in W[j][i][1], which are not supported with the layer condition model.