Skip to content

Conversation

@chrisahart
Copy link
Contributor

Fix for segmentation fault when performing CDFT-MD with many constraints, as reported by Leili Rassouli on the CP2K Google Groups
https://groups.google.com/g/cp2k/c/jaQdteFzSDc/m/trqpsgv9CQAJ

@schulkov
Copy link
Contributor

schulkov commented Oct 9, 2024

Thank you for fixing this issue.

As hw_rho_total component of cdft_group_type derived type is used exclusively within hirshfeld_constraint_low() subroutine, would it be better to simplify the code a little further by removing hw_rho_total from cdft_group_type and declaring it as a local variable?

It should get rid of the magic index in the expression cdft_control%group(1)%hw_rho_total at least.

@chrisahart
Copy link
Contributor Author

Thanks for the helpful suggestion Sergey.

I've now moved hw_rho_total from cdft_group_type to cdft_control_type, as the promolecular density is the same for all CDFT groups so it should not be stored per CDFT group.

hw_rho_total is also used in file qs_cdft_utils.F so keeping it in the CDFT control structure seems appropriate. If you would prefer it defined as a local variable and then passed to qs_cdft_utils.F I'm happy to do so

@schulkov schulkov merged commit 6c34c1c into cp2k:master Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants