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

Receive status #7

Closed
VictorEijkhout opened this issue Apr 1, 2020 · 1 comment
Closed

Receive status #7

VictorEijkhout opened this issue Apr 1, 2020 · 1 comment

Comments

@VictorEijkhout
Copy link

VictorEijkhout commented Apr 1, 2020

I notice that your recv calls returns a status object that gets created with a reinterpret_cast of the MPI_Status. Fine. But I usually specify MPI_STATUS_IGNORE. In MPL that would be dropping the status object and never assigning it? But does that lead to a memory leak?

(This is the first time I'm looking at MPL and its source so I maybe overlooking something.)

@rabauke
Copy link
Owner

rabauke commented Apr 2, 2020

No there is no memory leak. The recv function creates a local status object which is automatically clean-up by the compiler when leaving the function. Note that reinterpret_cast does not create a new object.

reinterpret_cast<MPI_Status *>(&s)

Means, take the address of s (which is of type mpl::status) and interpret this address as a pointer to MPI_Status.

@rabauke rabauke closed this as completed Apr 2, 2020
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

No branches or pull requests

2 participants