Skip to content

Commit

Permalink
Merge pull request #774 from MFraters/fix_mpi_unsigned_int_warning
Browse files Browse the repository at this point in the history
Fix MPI variable in utilities.cc from int to unsigned int.
  • Loading branch information
MFraters authored Dec 11, 2024
2 parents c5a3880 + f18fbc1 commit 89c1811
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/world_builder/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ namespace WorldBuilder
if (!filestream)
{
// broadcast failure state, then throw
const int ierr = MPI_Bcast(&invalid_file_size, 1, MPI_UNSIGNED, 0, comm);
const int ierr = MPI_Bcast(&invalid_file_size, 1, MPI_INT, 0, comm);
WBAssertThrow (ierr,
std::string("Could not open file <") + filename + ">.");
}
Expand All @@ -1210,7 +1210,7 @@ namespace WorldBuilder
catch (const std::ios::failure &)
{
// broadcast failure state, then throw
const int ierr = MPI_Bcast(&invalid_file_size, 1, MPI_UNSIGNED, 0, comm);
const int ierr = MPI_Bcast(&invalid_file_size, 1, MPI_INT, 0, comm);
WBAssertThrow(ierr == 0, "MPI_Bcast failed.");
WBAssertThrow (false,
std::string("Could not read file content from <") + filename + ">.");
Expand All @@ -1222,7 +1222,7 @@ namespace WorldBuilder
filesize = static_cast<int>(data_string.size());

// Distribute data_size and data across processes
int ierr = MPI_Bcast(&filesize, 1, MPI_UNSIGNED, 0, comm);
int ierr = MPI_Bcast(&filesize, 1, MPI_INT, 0, comm);
WBAssertThrow(ierr == 0, "MPI_Bcast failed.");

// Receive and store data
Expand All @@ -1237,7 +1237,7 @@ namespace WorldBuilder
{
// Prepare for receiving data
int filesize = 0;
int ierr = MPI_Bcast(&filesize, 1, MPI_UNSIGNED, 0, comm);
int ierr = MPI_Bcast(&filesize, 1, MPI_INT, 0, comm);
WBAssertThrow(ierr == 0, "MPI_Bcast failed.");
WBAssertThrow(filesize != -1,
std::string("Could not open file <") + filename + ">.");
Expand Down

0 comments on commit 89c1811

Please sign in to comment.