@@ -5011,7 +5011,7 @@ void CConfig::SetMarkers(unsigned short val_software) {
50115011
50125012#ifdef HAVE_MPI
50135013 if (val_software != SU2_MSH)
5014- SU2_MPI::Comm_size (MPI_COMM_WORLD , &size);
5014+ SU2_MPI::Comm_size (SU2_MPI::GetComm () , &size);
50155015#endif
50165016
50175017 /* --- Compute the total number of markers in the config file ---*/
@@ -9334,8 +9334,8 @@ void CConfig::SetProfilingCSV(void) {
93349334 int rank = MASTER_NODE;
93359335 int size = SINGLE_NODE;
93369336#ifdef HAVE_MPI
9337- SU2_MPI::Comm_rank (MPI_COMM_WORLD , &rank);
9338- SU2_MPI::Comm_size (MPI_COMM_WORLD , &size);
9337+ SU2_MPI::Comm_rank (SU2_MPI::GetComm () , &rank);
9338+ SU2_MPI::Comm_size (SU2_MPI::GetComm () , &size);
93399339#endif
93409340
93419341 /* --- Each rank has the same stack trace, so the they have the same
@@ -9419,11 +9419,11 @@ void CConfig::SetProfilingCSV(void) {
94199419 }
94209420
94219421#ifdef HAVE_MPI
9422- MPI_Reduce (n_calls, n_calls_red, map_size, MPI_INT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD );
9423- MPI_Reduce (l_tot, l_tot_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD );
9424- MPI_Reduce (l_avg, l_avg_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD );
9425- MPI_Reduce (l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD );
9426- MPI_Reduce (l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD );
9422+ MPI_Reduce (n_calls, n_calls_red, map_size, MPI_INT, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm () );
9423+ MPI_Reduce (l_tot, l_tot_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm () );
9424+ MPI_Reduce (l_avg, l_avg_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm () );
9425+ MPI_Reduce (l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm () );
9426+ MPI_Reduce (l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm () );
94279427#else
94289428 memcpy (n_calls_red, n_calls, map_size*sizeof (int ));
94299429 memcpy (l_tot_red, l_tot, map_size*sizeof (double ));
@@ -9557,8 +9557,8 @@ void CConfig::GEMMProfilingCSV(void) {
95579557 /* Parallel executable. The profiling data must be sent to the master node.
95589558 First determine the rank and size. */
95599559 int size;
9560- SU2_MPI::Comm_rank (MPI_COMM_WORLD , &rank);
9561- SU2_MPI::Comm_size (MPI_COMM_WORLD , &size);
9560+ SU2_MPI::Comm_rank (SU2_MPI::GetComm () , &rank);
9561+ SU2_MPI::Comm_size (SU2_MPI::GetComm () , &size);
95629562
95639563 /* Check for the master node. */
95649564 if (rank == MASTER_NODE) {
@@ -9569,7 +9569,7 @@ void CConfig::GEMMProfilingCSV(void) {
95699569 /* Block until a message from this processor arrives. Determine
95709570 the number of entries in the receive buffers. */
95719571 SU2_MPI::Status status;
9572- SU2_MPI::Probe (proc, 0 , MPI_COMM_WORLD , &status);
9572+ SU2_MPI::Probe (proc, 0 , SU2_MPI::GetComm () , &status);
95739573
95749574 int nEntries;
95759575 SU2_MPI::Get_count (&status, MPI_LONG, &nEntries);
@@ -9583,15 +9583,15 @@ void CConfig::GEMMProfilingCSV(void) {
95839583 vector<long > recvBufMNK (3 *nEntries);
95849584
95859585 SU2_MPI::Recv (recvBufNCalls.data (), recvBufNCalls.size (),
9586- MPI_LONG, proc, 0 , MPI_COMM_WORLD , &status);
9586+ MPI_LONG, proc, 0 , SU2_MPI::GetComm () , &status);
95879587 SU2_MPI::Recv (recvBufTotTime.data (), recvBufTotTime.size (),
9588- MPI_DOUBLE, proc, 1 , MPI_COMM_WORLD , &status);
9588+ MPI_DOUBLE, proc, 1 , SU2_MPI::GetComm () , &status);
95899589 SU2_MPI::Recv (recvBufMinTime.data (), recvBufMinTime.size (),
9590- MPI_DOUBLE, proc, 2 , MPI_COMM_WORLD , &status);
9590+ MPI_DOUBLE, proc, 2 , SU2_MPI::GetComm () , &status);
95919591 SU2_MPI::Recv (recvBufMaxTime.data (), recvBufMaxTime.size (),
9592- MPI_DOUBLE, proc, 3 , MPI_COMM_WORLD , &status);
9592+ MPI_DOUBLE, proc, 3 , SU2_MPI::GetComm () , &status);
95939593 SU2_MPI::Recv (recvBufMNK.data (), recvBufMNK.size (),
9594- MPI_LONG, proc, 4 , MPI_COMM_WORLD , &status);
9594+ MPI_LONG, proc, 4 , SU2_MPI::GetComm () , &status);
95959595
95969596 /* Loop over the number of entries. */
95979597 for (int i=0 ; i<nEntries; ++i) {
@@ -9640,15 +9640,15 @@ void CConfig::GEMMProfilingCSV(void) {
96409640
96419641 /* Send the data to the master node using blocking sends. */
96429642 SU2_MPI::Send (GEMM_Profile_NCalls.data (), GEMM_Profile_NCalls.size (),
9643- MPI_LONG, MASTER_NODE, 0 , MPI_COMM_WORLD );
9643+ MPI_LONG, MASTER_NODE, 0 , SU2_MPI::GetComm () );
96449644 SU2_MPI::Send (GEMM_Profile_TotTime.data (), GEMM_Profile_TotTime.size (),
9645- MPI_DOUBLE, MASTER_NODE, 1 , MPI_COMM_WORLD );
9645+ MPI_DOUBLE, MASTER_NODE, 1 , SU2_MPI::GetComm () );
96469646 SU2_MPI::Send (GEMM_Profile_MinTime.data (), GEMM_Profile_MinTime.size (),
9647- MPI_DOUBLE, MASTER_NODE, 2 , MPI_COMM_WORLD );
9647+ MPI_DOUBLE, MASTER_NODE, 2 , SU2_MPI::GetComm () );
96489648 SU2_MPI::Send (GEMM_Profile_MaxTime.data (), GEMM_Profile_MaxTime.size (),
9649- MPI_DOUBLE, MASTER_NODE, 3 , MPI_COMM_WORLD );
9649+ MPI_DOUBLE, MASTER_NODE, 3 , SU2_MPI::GetComm () );
96509650 SU2_MPI::Send (sendBufMNK.data (), sendBufMNK.size (),
9651- MPI_LONG, MASTER_NODE, 4 , MPI_COMM_WORLD );
9651+ MPI_LONG, MASTER_NODE, 4 , SU2_MPI::GetComm () );
96529652 }
96539653
96549654#endif
0 commit comments