Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adios_comm: close the engine in dtor #13

Merged
merged 2 commits into from
Jul 6, 2022
Merged

adios_comm: close the engine in dtor #13

merged 2 commits into from
Jul 6, 2022

Conversation

cwsmith
Copy link
Contributor

@cwsmith cwsmith commented Jul 5, 2022

The ADIOS2 Engine objects need to have Close() called by the user (see my mistake here ornladios/ADIOS2#3269 (comment)).

This PR adds a destructor for the AdiosComm class to close the engine. Following the rule of 5, I explicitly marked the copy/move assignment/constructors as delete as I currently only want users to call CreateAdiosComm(...) and not manipulate individual comm objects.

@jacobmerson Do you see a problem here? Is there a reason to allow AdiosComm object copy/move?

@cwsmith cwsmith requested a review from jacobmerson July 5, 2022 17:58
@cwsmith cwsmith added bug Something isn't working adios2 labels Jul 5, 2022
@jacobmerson
Copy link
Collaborator

I'm not sure I understand the rational to delete the copy/move constructor/assignment. Is the underlying engine type not copy/movable?

For instance I was moving adios comm out of the comm pair.

@cwsmith
Copy link
Contributor Author

cwsmith commented Jul 6, 2022

Discussion offline concluded that we don't know if we can safely copy/move the ADIOS2 Engine and IO objects. This is based on the use of factory methods in the API (i.e., IO::Open to create an Engine, and ADIOS::DeclareIO to create an IO) and the comment in the adios2 docs regarding ownership of IO and Engine objects by the ADIOS instance (https://adios2.readthedocs.io/en/latest/api_full/api_full.html#adios2-components-classes).

Future work may enable/implement these but we currently don't have a need for them.

@cwsmith cwsmith merged commit f833441 into main Jul 6, 2022
@cwsmith cwsmith deleted the cws/closeEngine branch July 8, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adios2 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants