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

Deadlock in H5FD__mpio_open due to bad MPI_File_get_size #118

Closed
adammoody opened this issue Nov 24, 2020 · 0 comments · Fixed by #1183
Closed

Deadlock in H5FD__mpio_open due to bad MPI_File_get_size #118

adammoody opened this issue Nov 24, 2020 · 0 comments · Fixed by #1183
Assignees

Comments

@adammoody
Copy link

While debugging another issue unrelated to HDF5, I think I tripped up a deadlock condition. In my test, it seems the MPI_File_get_size call returns an error here:

hdf5/src/H5FDmpio.c

Lines 828 to 832 in c56464f

/* Only processor p0 will get the filesize and broadcast it. */
if (mpi_rank == 0) {
if (MPI_SUCCESS != (mpi_code = MPI_File_get_size(fh, &size)))
HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mpi_code)
} /* end if */

That causes rank 0 to jump to the bottom of the function to close the file, which is a collective:

hdf5/src/H5FDmpio.c

Lines 858 to 861 in c56464f

done:
if (ret_value == NULL) {
if (file_opened)
MPI_File_close(&fh);

While other ranks are stuck in a different collective here:

if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, comm)))

Also, I noticed that there may be other patterns like this while grepping the file to look for this location, like maybe:

hdf5/src/H5FDmpio.c

Lines 1223 to 1229 in c56464f

/* Read on rank 0 Bcast to other ranks */
if (file->mpi_rank == 0)
if (MPI_SUCCESS !=
(mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code)
if (MPI_SUCCESS != (mpi_code = MPI_Bcast(buf, size_i, buf_type, 0, file->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code)

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 a pull request may close this issue.

2 participants