Combine single_PAO_to_grid and single_PAO_to_grad#251
Conversation
|
I don't see any noticeable performance impact of passing the subroutine as an argument instead of selecting it with an |
src/PAO_grid_transform_module.f90
Outdated
| contains | ||
|
|
||
| !!****f* PAO_grid_transform_module/single_PAO_to_grid * | ||
| !!****f* PAO_grid_transform_module/single_PAO_to_any * |
There was a problem hiding this comment.
The name here isn't really quite right, but I can't think of an alternative! The previous names (single_PAO_to_grid and single_PAO_to_grad) but also misleading (the second should have been single_PAO_grad_to_grid).
I wonder if single_PAO_to_grid would be better though it might confusing historically
There was a problem hiding this comment.
I don't understand the algorithm well enough to give the subroutine a descriptive name, so I'm really waiting for your input here 😅 If you think single_PAO_to_grid is good, let me know.
There was a problem hiding this comment.
Possibly single_PAO_or_grad_PAO_to_grid which is at least descriptive! I don't think that we need the single part, so maybe PAO_or_grad_PAO_to_grid. @tsuyoshi38 and @ayakon do you have any thoughts?
There was a problem hiding this comment.
PAO_or_grad_PAO_to_grid sounds reasonable to me. (I would like to remove _ between grad and PAO, like PAO_or_gradPAO_to_grid
There was a problem hiding this comment.
Technically this should be "any subroutine that satisfies the evaluate interface to grid" but I suppose we can name it after the current implementations. Would transform_to_grid be too generic? When you call the subroutine you'll see what you are transforming from the arguments, for example
call transform_to_grid(tmp_fn, pao_elem_derivative_2, dir1)
There was a problem hiding this comment.
I think that would risk confusion as this routine is specifically for PAOs and their derivatives (there are other functions transformed to the grid). I've taken what @tsuyoshi38 and I agreed (PAO_or_gradPAO_to_grid) and pushed it.
There was a problem hiding this comment.
Ok. Ready to merge then?
ilectra
left a comment
There was a problem hiding this comment.
Only minor aesthetic comments
Thanks! All done now |
Changes wherever routine is called; now more descriptive subroutine name
Closes #244
I've merged the two identical subroutines into
PAO_or_gradPAO_to_grid. The subroutine called in the inner loop is passed in as a procedure argument through an interface. As a side effect I had to always passdirectioninto both subroutines to make them conform to the same interface, inevaluate_paoit's just a dummy argument that does nothing. I've updated all calls toPAO_or_gradPAO_to_grid,evaluate_paoandpao_elem_derivative_2and added a bit of explanation in comments.Very open to a more descriptive names for the subroutine and the interface
Gets rid of OpenMP overheads in
single_PAO_to_gradwe were seeing earlierPreviously:
This PR: