cosmodesi / pyrecon

package for BAO reconstruction
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Better use of fftw wisdom for standalone runs #5

Open seshnadathur opened 2 years ago

seshnadathur commented 2 years ago

There should be some way to provide a path to a file containing a pre-created FFTW wisdom in the config file when running the standalone code. As currently written, it cannot be provided under either the alogrithm or mesh blocks as both lead to unrecognised keyword errors during initialisations. This negatively impacts the speed of FFT reconstruction when running the standalone code.

In addition, there should be a functionality provided to write the wisdom file created during a run to file – I think this could be simply by writing to a file called something like wisdom.<nmesh>.<nthreads>.npy in the run directory by default, maybe based on a user-provided save_wisdom option in the config if necessary.

Finally, it would make sense for the code to check for the existence of this default wisdom file in the run directory, and to use it even if no wisdom is provided by the user.

adematti commented 2 years ago

Yes, makes sense. (I was not expecting this script to be very much used in practice :)). So maybe we can have an option 'wisdom_fn' in input (to provide the path to the wisdom) and output sections (to provide the path where to save wisdom, optionally). Would you like to submit a PR for this as well? (I'm trying to focus on some other code this week; if you don't have time, I may do it this weekend)

adematti commented 2 years ago

@seshnadathur commit 262d90b8bb524d0676074a58c7a9ee195233b414, based on your PR #11 should address this issue.