Writing fields with layer information makes snappyHexMesh crash in motorbike tutorial (reopen)
I've just tried to test the issue reported in #1420 (closed) with the v1912 and it's still there:
Writing fields with layer information: nSurfaceLayers : actual number of layers thickness : overall layer thickness [0] #0 [1] #0 [2] #0 [3] #0 [4] #0 [5] #0 Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&) at at ??:?
Link issues together to show that they're related. Learn more.
Activity
- Riccardo Rossi changed the description
changed the description
- Author
I guess this should be classified as a bug and fixed if replicated on your side.
- Maintainer
Is this the incompressible simpleFoam motorBike tutorial? What is your architecture?
- Maintainer
I've just run develop (which should be similar to v1912 for snappyHexMesh) and see no problems:
Build : 97ff8fee20-20200311 OPENFOAM=2002 patch=200129 Arch : "LSB;label=32;scalar=64" Exec : snappyHexMesh -parallel -decomposeParDict system/decomposeParDict.6 -overwrite
Writing fields with layer information: nSurfaceLayers : actual number of layers thickness : overall layer thickness thicknessFraction : overall layer thickness (fraction of desired thickness)
Can you
- run with FOAM_SIGFPE=false to make sure it doesn't crash
- run with 'writeFormat ascii'
- check afterwards which of the three fields has NaNs in it.
- Author
This is the system architecture
Build : _f3950763fe-20191219 OPENFOAM=1912 Arch : "LSB;label=32;scalar=64" Exec : snappyHexMesh -parallel -decomposeParDict system/decomposeParDict.6 -overwrite
Edited by Riccardo Rossi - Author
Using
FOAM_SIGFPE=false
with'writeFormat ascii
I get:Writing 27863 added cells to cellSet addedCells Writing 0 faces inside added layer to faceSet layerFaces Writing fields with layer information: nSurfaceLayers : actual number of layers thickness : overall layer thickness =================================================================================== = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = PID 59575 RUNNING AT r032c02s02 = EXIT CODE: 8 = CLEANING UP REMAINING PROCESSES = YOU CAN IGNORE THE BELOW CLEANUP MESSAGES =================================================================================== Intel(R) MPI Library troubleshooting guide: https://software.intel.com/node/561764 ===================================================================================
Edited by Riccardo Rossi - Author
Using
FOAM_SIGFPE=false
with'writeFormat ascii
I get:Writing fields with layer information: nSurfaceLayers : actual number of layers thickness : overall layer thickness [0] [1] #0 [2] #0 [3] #0 [4] #0 [5] #0 #0 Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&) at ??:? [0] #1 Foam::sigFpe::sigHandler(int) at ??:? [0] #2 ? at ??:? [0] #3 Foam::snappyLayerDriver::writeLayerData(Foam::fvMesh const&, Foam::List<int> const&, Foam::List<int> const&, Foam::Field<double> const&, Foam::Field<double> const&) const in /lib64/libc.so.6 [0] #4 Foam::snappyLayerDriver::addLayers(Foam::layerParameters const&, Foam::dictionary const&, Foam::List<int> const&, int, Foam::decompositionMethod&, Foam::fvMeshDistribute&) at ??:? [0] #5 Foam::snappyLayerDriver::doLayers(Foam::dictionary const&, Foam::dictionary const&, Foam::layerParameters const&, Foam::meshRefinement::FaceMergeType, bool, Foam::decompositionMethod&, Foam::fvMeshDistribute&) at ??:?
Note that I've copied last error messages coming from processor0 only for sake of space.
- Maintainer
If still seems to be using floating-point exceptions. Are you running with
export FOAM_SIGFPE=false
?
- The issue seems might come from the division
patchReal[i]/patchWanted[i]
(is in two places). This is protected with
patchWanted[i] > VSMALL
what happens if you replace that VSMALL with ROOTVSMALL (1e-150) or even SMALL (1e-15)?
- Author
I have edited the
Allrun
script as follows for testing:export FOAM_SIGFPE=true/false runParallel $decompDict snappyHexMesh -overwrite
Do I need to recompile
snappyHexMesh
to changeVSMALL
or can I set it somewhere/somehow?Edited by Riccardo Rossi - Maintainer
We're still trying to figure out why it crashes for you and not for others.
- you'll have change snappyLayerDriver.C and recompile & rerun
- can you post your complete log file? Just trying to make sure that sigFpe (floating point error trapping) is switched off
- Author
I've just tested the v2006 and the bug is still there.
- Maintainer
Can you post your log file?
- Author
- Maintainer
Can you run with
unset FOAM_SETNAN unset FOAM_SIGFPE
? I did notice some problem in that they actually need to be unset and not set to e.g.
false
. - Author
Is it sufficient to do it in the terminal where I'll be issuing snappyHexMesh?
- Maintainer
sure
- Author
Just tried adding
unset FOAM_SETNAN unset FOAM_SIGFPE
in the ''Allrun'' script and I get the same error.
getting the same issue at the snappyHexMesh step.
Writing 27781 added cells to cellSet addedCells Writing 0 faces inside added layer to faceSet layerFaces Writing fields with layer information: nSurfaceLayers : actual number of layers thickness : overall layer thickness [node1:2199184:0:2199184] Caught signal 8 (Floating point exception: floating-point invalid operation) [node1:2199182:0:2199182] Caught signal 8 (Floating point exception: floating-point invalid operation) [node1:2199181:0:2199181] Caught signal 8 (Floating point exception: floating-point invalid operation) [node1:2199180:0:2199180] Caught signal 8 (Floating point exception: floating-point invalid operation) [node1:2199183:0:2199183] Caught signal 8 (Floating point exception: floating-point invalid operation) ==== backtrace (tid:2199182) ==== 0 0x00000000000532f9 ucs_debug_print_backtrace() ???:0 1 0x0000000000037790 .annobin_sigaction.c() sigaction.c:0 2 0x000000000007d62f Foam::snappyLayerDriver::writeLayerData() ???:0 3 0x000000000006e467 Foam::snappyLayerDriver::addLayers() ???:0 4 0x00000000000687df Foam::snappyLayerDriver::doLayers() ???:0 5 0x000000000041851b main() ???:0 6 0x00000000000236a3 __libc_start_main() ???:0 7 0x00000000004150ae _start() ???:0 ================================= ==== backtrace (tid:2199181) ==== 0 0x00000000000532f9 ucs_debug_print_backtrace() ???:0 1 0x0000000000037790 .annobin_sigaction.c() sigaction.c:0 2 0x000000000007d653 Foam::snappyLayerDriver::writeLayerData() ???:0 3 0x000000000006e467 Foam::snappyLayerDriver::addLayers() ???:0 4 0x00000000000687df Foam::snappyLayerDriver::doLayers() ???:0 5 0x000000000041851b main() ???:0 6 0x00000000000236a3 __libc_start_main() ???:0 7 0x00000000004150ae _start() ???:0 ================================= ==== backtrace (tid:2199180) ==== 0 0x00000000000532f9 ucs_debug_print_backtrace() ???:0 1 0x0000000000037790 .annobin_sigaction.c() sigaction.c:0 2 0x000000000007d62f Foam::snappyLayerDriver::writeLayerData() ???:0 3 0x000000000006e467 Foam::snappyLayerDriver::addLayers() ???:0 4 0x00000000000687df Foam::snappyLayerDriver::doLayers() ???:0 5 0x000000000041851b main() ???:0 6 0x00000000000236a3 __libc_start_main() ???:0 7 0x00000000004150ae _start() ???:0 ================================= ==== backtrace (tid:2199184) ==== 0 0x00000000000532f9 ucs_debug_print_backtrace() ???:0 1 0x0000000000037790 .annobin_sigaction.c() sigaction.c:0 2 0x000000000007d62f Foam::snappyLayerDriver::writeLayerData() ???:0 3 0x000000000006e467 Foam::snappyLayerDriver::addLayers() ???:0 4 0x00000000000687df Foam::snappyLayerDriver::doLayers() ???:0 5 0x000000000041851b main() ???:0 6 0x00000000000236a3 __libc_start_main() ???:0 7 0x00000000004150ae _start() ???:0 ================================= ==== backtrace (tid:2199183) ==== 0 0x00000000000532f9 ucs_debug_print_backtrace() ???:0 1 0x0000000000037790 .annobin_sigaction.c() sigaction.c:0 2 0x000000000007d62f Foam::snappyLayerDriver::writeLayerData() ???:0 3 0x000000000006e467 Foam::snappyLayerDriver::addLayers() ???:0 4 0x00000000000687df Foam::snappyLayerDriver::doLayers() ???:0 5 0x000000000041851b main() ???:0 6 0x00000000000236a3 __libc_start_main() ???:0 7 0x00000000004150ae _start() ???:0 ================================= =================================================================================== = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = RANK 0 PID 2199180 RUNNING AT node1 = KILLED BY SIGNAL: 8 (Floating point exception) ===================================================================================
WM_PRECISION_OPTION was set to SP, and FOAM_SIGFPE was set to blank during compilation. compiler is intel 2019 and -march=core-avx2 was the compiler flag. OS- CentOS 8
could you please suggest the changes in the snappyLayerDriver.C file which could fix this issue?
Edited by puneet singh- Maintainer
Can you confirm you don't see
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
in the log file?
- You could check for any division inside writeLayerData, e.g.
pfld[i] = patchReal[i]/patchWanted[i];
Maybe patchWanted is larger than VSMALL but still too small to divide against.
- Mark OLESEN mentioned in commit 23e27b17fe5968863cae14ca15d12c1d860c29f2
mentioned in commit 23e27b17fe5968863cae14ca15d12c1d860c29f2
- Mark OLESEN mentioned in commit 08588134
mentioned in commit 08588134
- Mark OLESEN mentioned in commit 0c891547
mentioned in commit 0c891547