MeteoSwiss-APN / dawn

Compiler toolchain to enable generation of high-level DSLs for geophysical fluid dynamics models
MIT License
28 stars 30 forks source link

Possible inconsistency in LiteralAccessIDToNameMap_ for dycore's advection_pptp.cpp #210

Open Stagno opened 5 years ago

Stagno commented 5 years ago

When code generating (for gridtools) source https://github.com/MeteoSwiss-APN/clang-gridtools/blob/master/src/dycore/advection_pptp.cpp with -freport-accesses flag, this assertion fails:

ACCESSES: line 291: Assertion failed: `AccessIDToNameMap_.count(AccessID)' 
Function: 'std::__cxx11::string dawn::iir::StencilFunctionInstantiation::getFieldNameFromAccessID(int) const'
Location: /home/giacomo/dawn/src/dawn/IIR/StencilFunctionInstantiation.cpp:300
/usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x2a)[0x7f72805580ea]
/usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x56)[0x7f7280556366]
/usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1(+0x81c49b)[0x7f728055649b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f727f30b890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f727e9a5e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f727e9a7801]
/home/giacomo/gtclang/bundle/install/bin/gtclang(+0x11900ae)[0x56496f6a90ae]
/home/giacomo/gtclang/bundle/install/bin/gtclang(+0x11900c4)[0x56496f6a90c4]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZNK4dawn3iir28StencilFunctionInstantiation24getFieldNameFromAccessIDB5cxx11Ei+0x16f)[0x56496f82d6af]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZNK4dawn3iir28StencilFunctionInstantiation19getNameFromAccessIDB5cxx11Ei+0xa5)[0x56496f82d795]
/home/giacomo/gtclang/bundle/install/bin/gtclang(+0x12ca8e8)[0x56496f7e38e8]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZNK4dawn3iir8Accesses14reportAccessesB5cxx11EPKNS0_28StencilFunctionInstantiationE+0x3e)[0x56496f7e3f5e]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZNK4dawn3iir20StencilInstantiation14reportAccessesEv+0x166)[0x56496f83ca06]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN4dawn16OptimizerContext14fillIIRFromSIRESt10shared_ptrINS_3iir20StencilInstantiationEES1_INS_3sir7StencilEES1_INS_3SIREE+0xc9a)[0x56496f6ba85a]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN4dawn16OptimizerContextC1ERNS_17DiagnosticsEngineERNS_7OptionsERKSt10shared_ptrINS_3SIREE+0x3b9)[0x56496f6bd959]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN4dawn12DawnCompiler12runOptimizerERKSt10shared_ptrINS_3SIREE+0x354)[0x56496f6af8b4]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN4dawn12DawnCompiler7compileERKSt10shared_ptrINS_3SIREE+0x6c)[0x56496f6b104c]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN7gtclang18GTClangASTConsumer21HandleTranslationUnitERN5clang10ASTContextE+0x9ff)[0x56496e93c98f]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN5clang8ParseASTERNS_4SemaEbb+0x31a)[0x56496f59767a]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN5clang14FrontendAction7ExecuteEv+0xb6)[0x56496ed85246]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x18c)[0x56496ed4e7fc]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_ZN7gtclang6Driver3runERKN4llvm15SmallVectorImplIPKcEE+0x522)[0x56496e928742]
/home/giacomo/gtclang/bundle/install/bin/gtclang(main+0x7d)[0x56496e9266dd]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f727e988b97]
/home/giacomo/gtclang/bundle/install/bin/gtclang(_start+0x2a)[0x56496e927caa]
lukasm91 commented 5 years ago

@Stagno Did you verify if this is fixed? If yes, please close the issue.

Stagno commented 5 years ago

Not fixed, still asserting but different assert:

ACCESSES: line 291:  R:vminus1:<0,0,0,0,0,0> R:data:<-3,3,-3,3,0,0> R:eddlat:<0,0,0,0,0,0> R:u:<0,0,0,0,0,0> R:uminus1:<0,0,0,0,0,0> R:eddlon:<0,0,0,0,0,0> R:v:<0,0,0,0,0,0>

ACCESSES: line 281: W:__local_adv_center_1626:<0,0,0,0,0,0> R:vel_center:<0,0,0,0,0,0> R:data:<-3,3,0,0,0,0>

ACCESSES: line 282: W:__local_adv_minus1_1750:<0,0,0,0,0,0> R:vel_minus1:<0,0,0,0,0,0> R:data:<-3,3,0,0,0,0>

ACCESSES: line 283:  R:__local_adv_minus1_1750:<0,0,0,0,0,0> R:0.5:<0,0,0,0,0,0> R:__local_adv_center_1626:<0,0,0,0,0,0>

ACCESSES: line 273:  R:vel:<0,0,0,0,0,0> R:data:<-3,3,0,0,0,0>

ACCESSES: line 253: W:__local_cf_1723:<0,0,0,0,0,0> R:20:<0,0,0,0,0,0> R:1:<0,0,0,0,0,0> R:2:<0,0,0,0,0,0> R:1:<0,0,0,0,0,0> R:3:<0,0,0,0,0,0> R:30:<0,0,0,0,0,0> R:1:<0,0,0,0,0,0> R:1:<0,0,0,0,0,0> R:4:<0,0,0,0,0,0> R:1:<0,0,0,0,0,0> R:1:<0,0,0,0,0,0>

ACCESSES: line 256: W:__local_result_1735:<0,0,0,0,0,0> R:0:<0,0,0,0,0,0>

ACCESSES: line 259: Assertion failed: `it != LiteralAccessIDToNameMap_.end()' Invalid Literal
Function: 'const string& dawn::iir::StencilFunctionInstantiation::getNameFromLiteralAccessID(int) const'
Location: /home/giacomo/dawn/dawn/src/dawn/IIR/StencilFunctionInstantiation.cpp:281
/usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x2a)[0x7fd1420530ea]
/usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x56)[0x7fd142051366]
/usr/lib/llvm-6.0/lib/libLLVM-6.0.so.1(+0x81c49b)[0x7fd14205149b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fd140e06890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7fd1404a0e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7fd1404a2801]
gtclang(+0x11928e4)[0x55e10765a8e4]
gtclang(+0x1192919)[0x55e10765a919]
gtclang(_ZNK4dawn3iir28StencilFunctionInstantiation26getNameFromLiteralAccessIDB5cxx11Ei+0x8b)[0x55e1077fb36b]
gtclang(_ZNK4dawn3iir28StencilFunctionInstantiation19getNameFromAccessIDB5cxx11Ei+0x92)[0x55e1077fb5c2]
gtclang(+0x12f39c8)[0x55e1077bb9c8]
gtclang(_ZNK4dawn3iir8Accesses14reportAccessesB5cxx11EPKNS0_28StencilFunctionInstantiationE+0x3e)[0x55e1077bc04e]
gtclang(_ZNK4dawn3iir20StencilInstantiation14reportAccessesEv+0x117)[0x55e107807f27]
gtclang(_ZN4dawn16OptimizerContext14fillIIRFromSIRESt10shared_ptrINS_3iir20StencilInstantiationEES1_INS_3sir7StencilEES1_INS_3SIREE+0x1088)[0x55e107686388]
gtclang(_ZN4dawn16OptimizerContext7fillIIREv+0x6d1)[0x55e107687cd1]
gtclang(_ZN4dawn12DawnCompiler12runOptimizerERKSt10shared_ptrINS_3SIREE+0xc15)[0x55e10767a865]
gtclang(_ZN4dawn12DawnCompiler7compileERKSt10shared_ptrINS_3SIREE+0x6b)[0x55e10767c43b]
gtclang(_ZN7gtclang18GTClangASTConsumer21HandleTranslationUnitERN5clang10ASTContextE+0xc4b)[0x55e1068f30bb]
gtclang(_ZN5clang8ParseASTERNS_4SemaEbb+0x31a)[0x55e107548e6a]
gtclang(_ZN5clang14FrontendAction7ExecuteEv+0xb6)[0x55e106d36a36]
gtclang(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x18c)[0x55e106cfffec]
gtclang(_ZN7gtclang6Driver3runERKN4llvm15SmallVectorImplIPKcEE+0x54b)[0x55e1068de51b]
gtclang(main+0x7b)[0x55e1068dc4fb]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fd140483b97]
gtclang(_start+0x2a)[0x55e1068ddbea]
mroethlin commented 5 years ago

this still fails with a stack trace, 06.11.2019, mast at 03778b49d7fbec23e2ecc9d7cab30fa79af09ec5