Skip to content

sharedfp/sm: close the named semaphore #4352

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

Merged
merged 1 commit into from
Oct 19, 2017

Conversation

edgargabriel
Copy link
Member

in case a named semaphore is used, it is necessary to close the semaphore to remove
all sm segments. sem_unlink just removes the name references once all proceeses have closed
the sem.

Fixes issue: #4336

Signed-off-by: Edgar Gabriel [email protected]

@edgargabriel
Copy link
Member Author

edgargabriel commented Oct 17, 2017

I can confirm that using this patch a test open/closing an MPI File 2048 times finishes correctly without error messages on MacOS (which is not the case without this patch).

@@ -231,6 +231,10 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,

comm->c_coll->coll_barrier (comm, comm->c_coll->coll_barrier_module );

#if defined(HAVE_SEM_OPEN)
sem_unlink ( sm_data->sem_name);
Copy link
Contributor

Choose a reason for hiding this comment

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

should this only be invoked on (per node ?) rank zero ? that is likely harmless, but this should be invoked only once per node.

in case a named semaphore is used, it is necessary to close the semaphore to remove
all sm segments. sem_unlink just removes the name references once all proceeses have closed
the sem.

Fixes issue: open-mpi#4336

Signed-off-by: Edgar Gabriel <[email protected]>

sharedfp/sm: unlink only needs to be called by one process

Signed-off-by: Edgar Gabriel <[email protected]>
@edgargabriel
Copy link
Member Author

@ggouaillardet , thank you, I fixed this. Can you please review again?

@ggouaillardet
Copy link
Contributor

looks good to me, thanks !
something looks busted with the github review process, so i am now merging this PR.

@ggouaillardet ggouaillardet merged commit 9771c57 into open-mpi:master Oct 19, 2017
@edgargabriel
Copy link
Member Author

@ggouaillardet thank you. I created to pull requests of this patch for 3.0.1 and 3.1, if necessary, we can also create a patch for the 2.1.x.

@edgargabriel edgargabriel deleted the pr/sem_close_fix branch March 21, 2018 19:40
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