interIsoFoam runs into an endless loop
Hello,
when testing interIsofoam i found a parameter set for which it runs in an endless loop. I made same flags to find out where this happens and it is in the file plicRDF.c at line 470 in the while loop starting which while (resIter.found()).
I uploaded a case file with an allrun script to reproduce the error. In my case it got stuck at the time 0.609626.
Best
Michael
Link issues together to show that they're related. Learn more.
Activity
- Maintainer
@Henning86 (44a84d47), any particular suggestion (if possible)? (or would you prefer us to take a stab at it?)
Many thanks both.
Will look into it
Edited by Henning Scheufler@HappyKiter i cannot reproduce the error on commit 9b0f1b67 on the develop branch
What version are you using?
- Author
I used 2012
I cannot reproduce it on ubuntu 18.04.
my g++ --version:
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Could you provide:
- Operating system
- Hardware info
- Compiler
- Please register or sign in to reply
- Author
I've downloaded the latest dev version. Once it's compiled I'll test the tutorial on this version and see if I get the same error as in v2012
- Author
System: Kernel: 4.12.14-lp151.28.87-default x86_64 bits: 64 Desktop: Gnome 3.26.2 Distro: openSUSE Leap 15.1
gcc version 7.5.0 (SUSE Linux)
- Author
What kind of hardware information do you require? The output of lscpu is:
` Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 48 bits physical, 48 bits virtual CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: AuthenticAMD CPU family: 21 Model: 112 Model name: AMD E2-9010 RADEON R2, 4 COMPUTE CORES 2C+2G Stepping: 0 CPU MHz: 2000.000 CPU max MHz: 2000.0000 CPU min MHz: 1200.0000 BogoMIPS: 3992.18 Virtualization: AMD-V L1d cache: 32K L1i cache: 64K L2 cache: 1024K NUMA node0 CPU(s): 0,1 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm perfctr_core perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov
`
- Author
I tried with the newest dev verion and the issue is still there. The latest output of the log is:
--> FOAM Warning : From void Foam::cutFaceAdvect::cutPoints(Foam::label, Foam::scalar, Foam::DynamicList<Foam::Vector >&) in file cellCuts/cutFace/cutFaceAdvect.C at line 928 cutPoints = 3((0.0045956218192765 0.00020064918188055 0.018) (0.0045956218192765 0.00020064918188055 0.0182) (0.0047954314635929 0.00020937305935361 0.018)) for pts = 4((0.0045956218192765 0.00020064918188055 0.018) (0.0045956218192765 0.00020064918188055 0.0182) (0.0047954314635929 0.00020937305935361 0.0182) (0.0047954314635929 0.00020937305935361 0.018)), f - f0 = 4(9254 9356 9357 9255) and f0 = 0 --> FOAM Warning : From void Foam::cutFaceAdvect::cutPoints(Foam::label, Foam::scalar, Foam::DynamicList<Foam::Vector >&) in file cellCuts/cutFace/cutFaceAdvect.C at line 928 cutPoints = 3((0.0043958121749602 -0.00019192530440748 0.0182) (0.0045956218192765 -0.00020064918188055 0.0182) (0.0043958121749602 -0.00019192530440748 0.0184)) for pts = 4((0.0043958121749602 -0.00019192530440748 0.0182) (0.0045956218192765 -0.00020064918188055 0.0182) (0.0045956218192765 -0.00020064918188055 0.0184) (0.0043958121749602 -0.00019192530440748 0.0184)), f - f0 = 4(9304 9305 9407 9406) and f0 = 0 --> FOAM Warning : From void Foam::cutFaceAdvect::cutPoints(Foam::label, Foam::scalar, Foam::DynamicList<Foam::Vector >&) in file cellCuts/cutFace/cutFaceAdvect.C at line 928 cutPoints = 3((0.0023977157317965 -0.00010468652967681 0.0194) (0.0025975253761128 -0.00011341040714987 0.0194) (0.0023977157317965 -0.00010468652967681 0.0196)) for pts = 4((0.0023977157317965 -0.00010468652967681 0.0194) (0.0025975253761128 -0.00011341040714987 0.0194) (0.0025975253761128 -0.00011341040714987 0.0196) (0.0023977157317965 -0.00010468652967681 0.0196)), f - f0 = 4(9906 9907 10009 10008) and f0 = 0
Maybe this is of some help
- Contributor
@Henning86 @kuti : The "f0 = 0" means that isoAdvector it is trying to calculate the 0-contour isoface on a face (which it should never do). It is presumably doing this for a face surrounded by cells with alpha = 0, so the contour catches all the 4 face points and therefore cannot decide how to cut the face (this is only unambiguous when there are two cut points along the perimeter of a face). Focus from here should have been on finding out why isoAdvector is used on such a face rather than trying to solve the subsequent problems in the bounding step.
I could not reproduce the results on another machine but i'm looking into.
- Maintainer
let me try with osuse as well.
- Maintainer
for the following configurations, the attached mwe has been successfully completed (although
setAlphaField
returns a Fatal Error [cannot find file 0/alpha.air]).base0 = base base1 = develop api = 2012 patch = 210210 HEAD = 9b0f1b67df version = com compiler = Gcc (system) = gcc (SUSE Linux) 7.4.1 20190905 [gcc-7-branch revision 275407] mpi = SYSTEMOPENMPI = mpirun (Open MPI) 1.10.7.0.5e373bf1fd OS = openSUSE Leap 15.1 opts = linux64GccDPInt32Opt
base0 = base base1 = develop api = 2012 patch = 210210 HEAD = 9b0f1b67df version = com compiler = Clang (system) = clang version 9.0.1 mpi = SYSTEMOPENMPI = mpirun (Open MPI) 1.10.7.0.5e373bf1fd OS = openSUSE Leap 15.1 opts = linux64ClangDPInt32Opt
Having said that, @Henning86, is there any chance for us to avoid any infinite-loop pitfalls in the
while
loop in question? To my understanding, there is no break mechanism thereat if things go awry.Edited by Kutalmış Berçin That is should be possible.
My approach would be to get rid of the loop to see if this really is the problem and if it is the case i would refactor the residual part of plicRDF to improve readability and performance (maps are quite slow).
- Author
I've just downloaded clang (clang version 7.0.1 (tags/RELEASE_701/final 349238). I'm currently compiling the dev version with this compiler. Let's see if I get it compiled and if this is successful i can reproduce the error again
- Author
By the way I noticed that in file $FOAM_SRC/transportModels/geometricVoF/surfaceIterators/surfaceIteratorIso.C line 85
there is another while statement:
while (L2 - L1 > 1)
I'm not familiar with the code, but there may be also in this loop be a potential infinite loop. I'm I wrong?
Edited by Michael Alletto isoAdvectionTemplates.C plicRDF.C
Could you apply the patch or replace the isoAdvectionTemplates.C and plicRDF.C in your installation?
I think there are two options where the code might fail in:
- boundFlux
- while (resIter.found())
i replaced the while loop in plicRDF and added a counter to boundFlux so we are able to test where the error is.
Does the error occur if you use the isoAlpha reconstructionScheme?
- Author
ok with this files the simulation runs til the end.
Super thanks
The problem seems to be the while (resIter.found()).
I will rewrite that part
Could you test this implementation and see if the infinite loop is still fixed?
- Author
Hei hei. I got the following compilation error:
reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C:236:10: error: ‘normalRes’ was not declared in this scope List& normalResidual ^~~~~~~~~ reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C:236:10: note: suggested alternative: ‘normal’ List& normalResidual ^~~~~~~~~ normal reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C:236:19: error: template argument 1 is invalid List& normalResidual
are some files missing?
Version below is tested and produces exactly the same results as before but without the while loop
Edited by Henning Scheufler