Interpolation routines and iterative cycle #96
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear Nakib,
I've changed the interpolation routine within the computation of the phonon drag contribution, so that the corners and the weights are precomputed, which prevents successive recomputation for the same point (misc.f90: precompute_interpolation_corners_and_weights). Moreover, I've removed the LAPACK algorithm and worked out the successive linear interpolations as well as allowed for N simultaneous interpolations, so the precomputed weights and corners ids can be used (misc.f90: interpolate_using_precomputed). In this last, there is the caveat of an array slicing when calling interpolate_using_precomputed, as I am calling it with response_ph(:, s, :); and might be not the best slicing especially if computed in each successive call. How is the memory here for non-toy problem in this point of the code? because it might be worth trying a reorder moving bands to first index.
I did a fast test on toy problem with Si (input.nml), with old (old.log) and the new version (new.log); and I've found a speed-up of 1.85 in the whole execution time of the code and 7 in the coupled iterative part of the code. My guess it is that as the number of calls to the interpolation routine increases, it becomes much worthier to precompute the corners-id and the weights.
I see that the interpolation routine is used for 4ph, do you feel worth moving those also to that scheme?
Best regards,
Martí