Skip to content

Conversation

@hforbert
Copy link
Contributor

No description provided.

TYPE(mp_comm_type) :: new_comm
TYPE(section_vals_type), POINTER :: helium_section, input_worm
TYPE(cp_logger_type), POINTER :: logger, tmplogger
TYPE(mp_para_env_type), POINTER :: new_comm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you make this communicator a pointer? In your case you know that all pointers point to the same object. The others are just mere copies. I also do not see when you deallocate the pointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I make that a pointer, because cp_logger_create needs a pointer and I cannot make it a target since it's part of a structure which I didn't want to make a target. I didn't deallocate because I wrongly assumed %free is enough :)
But I agree the pointers are a mess here and also the parallization (helium assumes only one rank per environment
and doesn't use mpi, which clashes with the regular nnp (hence I had to create a logger with a single rank, so nnp is happy).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. No, %free just frees the data of the object but it cannot free the pointer (or the object itself). And I mixed up mp_para_env_type and mp_comm_type. Then, it is ok by design.

@hforbert hforbert merged commit 715739a into cp2k:master Oct 17, 2023
@hforbert hforbert deleted the helium_nnp branch October 17, 2023 14:55
mtaillefumier pushed a commit to mtaillefumier/cp2k that referenced this pull request Oct 20, 2023
Helium-Solute NNP for interaction [cschran/lduran/hforbert]
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.

3 participants