Skip to content

Commit

Permalink
Debug mpi job diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcarbone committed Nov 22, 2023
1 parent 4c02654 commit 121a3a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


#define DEFAULT_TAG 0
#define JOB_DIAGNOSTICS_TAG 1
#define MASTER 0


Expand Down Expand Up @@ -157,7 +158,7 @@ void master(const size_t min_index_inclusive, const size_t max_index_exclusive)

// And finally we ask for the total number of tasks it had to compute
int tmp_n_jobs;
MPI_Recv(&tmp_n_jobs, 1, MPI_INT, MPI_ANY_SOURCE, DEFAULT_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Recv(&tmp_n_jobs, 1, MPI_INT, MPI_ANY_SOURCE, JOB_DIAGNOSTICS_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
jobs_finished_per_task.push_back(tmp_n_jobs);
}

Expand Down Expand Up @@ -193,7 +194,7 @@ void worker(const utils::SimulationParameters params)
{
// Now we can return some information back to the master process about
// how many jobs were completed.
MPI_Send(&total_jobs, 1, MPI_INT, 0, DEFAULT_TAG, MPI_COMM_WORLD);
MPI_Send(&total_jobs, 1, MPI_INT, 0, JOB_DIAGNOSTICS_TAG, MPI_COMM_WORLD);

// Finish signal received, break from the loop
return;
Expand Down

0 comments on commit 121a3a0

Please # to comment.