Swarm.advection calls estimate_dt(V_fn) before stepping. On a rank with no local particles the evaluated velocity has shape (0, 1, dim) and
vel = vel.reshape(vel.shape[0], -1)
raises ValueError: cannot reshape array of size 0 into shape (0,newaxis) (numpy cannot infer -1 for a zero-size array). Any parallel run whose swarm is empty on some rank at some step dies there: measured with passive tracers released at the inlet of the DFG cylinder benchmark on four ranks (all ranks but the inlet's are empty at the first step), ~/+Simulations/navier_stokes_supg/cylinder/runs/dfg_supg_r40_C1_tracers.log.
Fix on feature/navier-stokes-supg: give reshape the explicit trailing size, vel.reshape(vel.shape[0], vel.shape[1] * vel.shape[2]). A second, separate point for the same routine: max_magvel is rank-local (the .max() of the local particles, and the empty-rank except returns None), so with step_limit=True the substep count can differ between ranks and the advection's collectives would mismatch; the default step_limit=False does not reach it.
Underworld development team with AI support from Claude Code
Swarm.advectioncallsestimate_dt(V_fn)before stepping. On a rank with no local particles the evaluated velocity has shape (0, 1, dim) andraises
ValueError: cannot reshape array of size 0 into shape (0,newaxis)(numpy cannot infer -1 for a zero-size array). Any parallel run whose swarm is empty on some rank at some step dies there: measured with passive tracers released at the inlet of the DFG cylinder benchmark on four ranks (all ranks but the inlet's are empty at the first step),~/+Simulations/navier_stokes_supg/cylinder/runs/dfg_supg_r40_C1_tracers.log.Fix on feature/navier-stokes-supg: give reshape the explicit trailing size,
vel.reshape(vel.shape[0], vel.shape[1] * vel.shape[2]). A second, separate point for the same routine:max_magvelis rank-local (the.max()of the local particles, and the empty-rankexceptreturns None), so withstep_limit=Truethe substep count can differ between ranks and the advection's collectives would mismatch; the defaultstep_limit=Falsedoes not reach it.Underworld development team with AI support from Claude Code