FluidityProject / fluidity

Fluidity
http://fluidity-project.org
Other
367 stars 115 forks source link

lagrangian detector checkpointing #128

Open drhodrid opened 8 years ago

drhodrid commented 8 years ago

Hi all,

Another issue has cropped up in relation to lagrangian detector IO.

In the lagrangian-detector-issues branch, I have added a test named "lagrangian_detector_checkpoint_newarray". This test picks up from a precomputed checkpoint, with one lagrangian detector array (Steve). The checkpointed .flml has been modified, with an additional lagrangian detector array (Bob) added, which is initialized via python (so one detector array should pick up from the checkpoint - Steve -, whilst the other should not -Bob).

The simulation fails at line 1624 of file Diagnostic_variables.F90:

(unit = 11, file = 'lagrangian_detectors_1_checkpoint_det.groups') Fortran runtime error: End of file

Despite specifying that detector array Bob should be initialized via python, fluidity is trying to initialize it from a checkpoint.

From looking at the code, it seems that the detector IO routines cannot accommodate both checkpointed and initialized detector arrays simultaneously. Indeed, if there is one checkpointed detector array, the assumption is that that is true for all, which will not necessarily be the case.

Was there a reason that this was setup like this or is it a bug?

Best wishes,

Rhodri

stephankramer commented 8 years ago

Well they either didn't consider this case or couldn't be bothered to do it. It seems to set a global from_checkpoint logical for which it even looks under static_detectors and detector array for checkpoint_from_file which doesn't even exist under these options. So I suspect checkpointing also doesn't work in combination with static detectors or a (static) detector array. I'm going to mark it wishlist for now though as this clearly has never worked and I'm a little unclear how much work it would be (feel free to have a go).

drhodrid commented 6 years ago

Assigning this to Chris so that he can take a look. Perhaps already resolved in previous merge?

Cmath2 commented 6 years ago

This issue is resolved for particles, but currently not for detectors.

Particles are initialised per group array, so hitting a "from_checkpoint" option will only initialise an individual group from the checkpoint file.

Detector arrays are all initialised at once, so if a single array has a "from_checkpoint" option, the code will attempt to initialise all arrays from a checkpoint file.

This shouldn't be too hard to fix, I'll discuss with @drhodrid whether it's worth doing considering particles essentially make detectors obsolete.

drhodrid commented 5 years ago

https://github.com/FluidityProject/fluidity/pull/230... This should be addressed soon through particles.