pynbody / genetIC

The GM initial conditions generator
GNU General Public License v3.0
21 stars 8 forks source link

Which commands should be executed when setting up an input mapper? #73

Closed Martin-Rey closed 3 years ago

Martin-Rey commented 4 years ago

Hi all,

I have been setting up initial conditions with respect to previously defined grid structures, using the set_input_mapper command.

Previously, this operation used to be very fast, as the DummyICGenerator would skip all costly commands to just figure out the grid and ID structure.

However, my reference parameter file is fairly complex, calling calculate, apply_modifications and clear_modifications. These functions actually get executed, triggering the draw of the random field and applying modifications to it. It makes the execution of set_input_mapper almost as long as generating the first ICs.

These commands are not overridden by the dummy IC generator, which triggers this behaviour: https://github.com/ucl-cosmoparticles/genetIC/blob/53f63ba47f3b6c3044a508db99f01c8168b7f08b/genetIC/src/dummyic.hpp#L60-L93

Is there a use-case in which it is useful to executecalculate, apply_modifications, or even initialise the random draw, when using the dummy IC generator? Has this behaviour been changed in recent iterations of the code or has it never been noticed?

It feels to me like these operations should be overridden as empty functions in the dummy IC generator, but I want to make sure I am not missing something.

Martin

apontzen commented 4 years ago

Hi Martin, I agree that these should not be called.

apontzen commented 3 years ago

Thanks for the fix - I guess this issue can now be closed?

Martin-Rey commented 3 years ago

Agreed, this is now fixed by #77. We just have to remember to add the corresponding override to DummyICGenerator when someone codes a new user-level feature that shouldn't be executed in mapper_relative_to.