Skip to content

Commit

Permalink
append_cell_attributes: ensure only I/O ranks participate in toplevel
Browse files Browse the repository at this point in the history
creation
  • Loading branch information
iraikov committed Dec 11, 2024
1 parent a91f0b2 commit 3db40e9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cell/cell_attributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,8 @@ namespace neuroh5
MPI_Comm_split(comm,color,rank,&io_comm);
MPI_Comm_set_errhandler(io_comm, MPI_ERRORS_RETURN);

if (access( file_name.c_str(), F_OK ) != 0)
if (is_io_rank) {
if (access( file_name.c_str(), F_OK ) != 0)
{
vector <string> groups;
groups.push_back (hdf5::POPULATIONS);
Expand All @@ -1857,8 +1858,9 @@ namespace neuroh5
{
status = 0;
}
throw_assert(status == 0,
"append_cell_attribute_maps: unable to create toplevel groups in file");
throw_assert(status == 0,
"append_cell_attribute_maps: unable to create toplevel groups in file");
}

throw_assert(MPI_Barrier(comm) == MPI_SUCCESS, "error in MPI_Barrier");

Expand Down

0 comments on commit 3db40e9

Please sign in to comment.