Allow SWIFT snapshots to be reused as ICs explicitly#73
Allow SWIFT snapshots to be reused as ICs explicitly#73Francyrad wants to merge 1 commit intoSWIFTSIM:masterfrom
Conversation
|
The reason for keeping IC and snapshot naming conventions separate was intentional to prevent mistakes when using them interchangeably. While this aliasing is a nice feature, if implemented, it should almost certainly be hidden behind a Additionally, for what it is worth, I do not like the duplication of the restart flag. That will only ever lead to confusion in my opinion. |
I can make further changes to implement your very fair requests |
8a16f51 to
433e744
Compare
|
Thanks, that makes sense. I have updated the PR to keep snapshot/IC naming separate by default. Snapshot field aliases are now only accepted when I also removed the parameter-file restart flag from the PR; restart remains controlled by the existing command-line option. |
|
Thanks for contributing to the project and suggesting this. My concern with this is that it's a dangerous option. And that's also the reason we have not implemented it in the first place. Restarting from a snapshot always leads to time integration mistake. But, in most applications for cosmology and galaxy formation it's much worse than that as many of the fields will not be re-read and initialised properly. There is a lot of scheme-dependent re-initialisation of internal fields that would have to happen and we'd need to give them sensible values. I think that providing the option as coded here then gives a false sense of security and that the code will run as expected. Which it will not, except in some limited cases. |
|
It's as Matthieu says, restarting from a snapshot can lead to a plethora of problems if not done extremely carefully. For example, running a simulation without restarting from a snapshot will almost invariably lead to (somewhat) different results than running a simulation without restarting using snapshots as ICs due to the time integration errors Matthieu mentioned. If, however, you're absolutely certain you know what you're doing, then there is a python script in the repository which will convert a snapshot into an IC file: https://github.com/SWIFTSIM/SWIFT/blame/master/tools/convert_snapshot_to_ICs.py |
Summary
InitialConditions:accept_snapshotis enabled.accept_snapshotis disabled.Validation
make -j20with the local Intel oneAPI/OpenMPI build.InitialConditions:accept_snapshot.InitialConditions:accept_snapshot: 1is set.