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

Fix recv count and initialize all variables #642

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/caliper/aggregate_over_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ void pack_and_send(int dest, CaliperMetadataAccessInterface& db, Aggregator& agg

size_t receive_and_merge_nodes(int source, CaliperMetadataDB& db, IdMap& idmap, MPI_Comm comm)
{
unsigned count;
unsigned count = 0;

MPI_Recv(&count, 1, MPI_UNSIGNED, source, 1, comm, MPI_STATUS_IGNORE);

MPI_Status status;
int size;
int size = 0;

MPI_Probe(source, 2, comm, &status);
MPI_Get_count(&status, MPI_BYTE, &size);
Expand All @@ -110,12 +110,12 @@ size_t receive_and_merge_snapshots(
MPI_Comm comm
)
{
unsigned count;
unsigned count = 0;

MPI_Recv(&count, 3, MPI_UNSIGNED, source, 3, comm, MPI_STATUS_IGNORE);
MPI_Recv(&count, 1, MPI_UNSIGNED, source, 3, comm, MPI_STATUS_IGNORE);

MPI_Status status;
int size;
int size = 0;

MPI_Probe(source, 4, comm, &status);
MPI_Get_count(&status, MPI_BYTE, &size);
Expand Down Expand Up @@ -161,8 +161,8 @@ namespace cali

void aggregate_over_mpi(CaliperMetadataDB& metadb, Aggregator& aggr, MPI_Comm comm)
{
int commsize;
int rank;
int commsize = 1;
int rank = 0;

MPI_Comm_size(comm, &commsize);
MPI_Comm_rank(comm, &rank);
Expand Down