SimVascular / svSolver

Separate repository for svSolver
16 stars 23 forks source link

Max. number of time steps ignored when restarting #88

Closed mrp089 closed 4 years ago

mrp089 commented 4 years ago

When restarting, svsolver runs indefinitely and ignores the maximum number of time steps.

mrp089 commented 4 years ago

Figured it out... The time step number in the solver input file doesn't represent the total number of time steps but the number of additional time steps.

Example: A solver input file specifies 100 time steps

Number of Timesteps: 100

If the simulation stops at time step 50 (in numstart.dat) and is restarted with the same input file, the simulation runs for another 100 time steps until it reaches 150 total time steps.

I find this behavior counter-intuitive. On a cluster, simulations are terminated frequently (e.g. when hitting the wall time) and resubmitted automatically by the workload manager. Here, I would have to somehow modify the solver input file after each restart. Otherwise, the simulation will not stop at the max. number of time steps.

@ktbolt @osmsc Is there a reason for this behavior? If not, I'll change the meaning of Number of Timesteps in the input file to represent the total number of time steps.

ktbolt commented 4 years ago

@mrp089 This also confused me the first time I ran a solver job!

I'm not sure what the reason is for this behavior. I hesitate to change the solver behavior though since it has worked like this from the beginning. It seems like it would not be a problem but you never know what users are doing. Maybe ask lab members? People doing optimization and uncertainty quantification might be using this feature.

A possible solution is to add a Total Number of Timesteps parameter which if set then the value in numstart.dat is interpreted differently.

mrp089 commented 4 years ago

Since we don't know who might be using this behavior as a feature, we agreed on not making any changes to svSolver.

To change the behavior, both occurrences of istep in solver_subroutines.f need to be changed to lstep.