CFD-GO / TCLB

TCLB - Templated MPI+CUDA/CPU Lattice Boltzmann code
https://tclb.io
GNU General Public License v3.0
180 stars 71 forks source link

"Solve" with 0 Iterations does not execute properly #404

Open shkodm opened 2 years ago

shkodm commented 2 years ago

When running some automatically generated from Rtemplate case files I frequently have something like <Solve Iterations="0"/>. This is fine, sometimes I really want to have it. My expectations for this kind of XML element is that it would simply not be executed. (Solving 0 iterations = not solving at all)

What actually happens is probably numerical overflow (I guess) and TCLB is stuck in the infinite loop, burning computational time.

  5 [  ]    ---- : Setting action Solve at 0.000000 iterations
  4 [  ]    ---- : Setting callback Failcheck at 100.000000 iterations
  3 [  ]    ---- : Adding Failcheck to the solver hands
  2 [  ]    ---- : Setting callback Log at 0.000000 iterations
  1 Initializing washburn_semi_2d_low_dr_var_mob/d3q27_pf_velocity/washburn_law_mu_star_1rho_star_1La_1res_1Viscosity_h005CA_60tauUpdate4mobility01_Log_P00_00000000.csv
188 [  ]    ---- :     -1.8 MLBUps     -1.83 GB/s [                   =]
llaniewski commented 2 years ago

I think the problem lays here: https://github.com/CFD-GO/TCLB/blob/develop/src/Handlers/vHandler.h#L81 I think if should return 0 if everyIter is zero or below. @shkodm can you change it and test?