Wflow.jl icon indicating copy to clipboard operation
Wflow.jl copied to clipboard

Wflow_sbm run fails with local inertial routing (virtual machine)

Open verseve opened this issue 1 year ago • 1 comments

Wflow version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have checked that this bug exists on the latest version of Wflow.

Reproducible Example

Run a wflow_sbm model with local inertial routing on a virtual machine.

Current behaviour

The following error is thrown:

┌ Error: Wflow simulation failed │ exception = │ TaskFailedException │
│ nested task error: InexactError: Int64(NaN) │ Stacktrace: │ [1] Int64 │ @ .\float.jl:788 [inlined] │ [2] unsatzone_flow_layer(usd::Float64, kv_z::Float64, l_sat::Float64, c::Float64)

and we have seen this before when NaN values occur (for example because of missing values).

Desired behaviour

The wflow_sbm runs only fail on a virtual machine. It seems related to the use of LoopVectorization (with Wflow v0.6.3 wflow_sbm runs fine).

Additional Context

No response

verseve avatar Feb 14 '24 12:02 verseve

The internal time step of the local inertial model (stable_timestep(sw::ShallowWaterRiver{T}) and stable_timestep(sw::ShallowWaterLand{T})) can get zero when LoopVectorization is applied (@tturbo) to the for loop of these functions. When reservoirs or lakes are included (division by internal time step of zero), the model run fails. The local inertial solution itself does not fail with a zero time step, but results for overland flow (river flow keeps q) are affected.

This issue occurs on a virtual machine, Windows 10 Enterprise, with Intel(R) Xeon(R) Gold 6144 CPU (2 processors), Julia v1.9.4, running with 4 threads.

verseve avatar Feb 28 '24 08:02 verseve