@@ -4953,10 +4953,7 @@ void CConfig::SetMarkers(unsigned short val_software) {
49534953 iMarker_Turbomachinery, iMarker_MixingPlaneInterface;
49544954
49554955 int size = SINGLE_NODE;
4956-
4957- #ifdef HAVE_MPI
4958- SU2_MPI::Comm_size (MPI_COMM_WORLD, &size);
4959- #endif
4956+ SU2_MPI::Comm_size (SU2_MPI::GetComm (), &size);
49604957
49614958 /* --- Compute the total number of markers in the config file ---*/
49624959
@@ -9214,8 +9211,8 @@ void CConfig::SetProfilingCSV(void) {
92149211 int rank = MASTER_NODE;
92159212 int size = SINGLE_NODE;
92169213#ifdef HAVE_MPI
9217- SU2_MPI::Comm_rank (MPI_COMM_WORLD , &rank);
9218- SU2_MPI::Comm_size (MPI_COMM_WORLD , &size);
9214+ SU2_MPI::Comm_rank (SU2_MPI::GetComm () , &rank);
9215+ SU2_MPI::Comm_size (SU2_MPI::GetComm () , &size);
92199216#endif
92209217
92219218 /* --- Each rank has the same stack trace, so the they have the same
@@ -9299,11 +9296,11 @@ void CConfig::SetProfilingCSV(void) {
92999296 }
93009297
93019298#ifdef HAVE_MPI
9302- MPI_Reduce (n_calls, n_calls_red, map_size, MPI_INT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD );
9303- MPI_Reduce (l_tot, l_tot_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD );
9304- MPI_Reduce (l_avg, l_avg_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD );
9305- MPI_Reduce (l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, MPI_COMM_WORLD );
9306- MPI_Reduce (l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, MPI_COMM_WORLD );
9299+ MPI_Reduce (n_calls, n_calls_red, map_size, MPI_INT, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm () );
9300+ MPI_Reduce (l_tot, l_tot_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm () );
9301+ MPI_Reduce (l_avg, l_avg_red, map_size, MPI_DOUBLE, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm () );
9302+ MPI_Reduce (l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm () );
9303+ MPI_Reduce (l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm () );
93079304#else
93089305 memcpy (n_calls_red, n_calls, map_size*sizeof (int ));
93099306 memcpy (l_tot_red, l_tot, map_size*sizeof (double ));
@@ -9437,8 +9434,8 @@ void CConfig::GEMMProfilingCSV(void) {
94379434 /* Parallel executable. The profiling data must be sent to the master node.
94389435 First determine the rank and size. */
94399436 int size;
9440- SU2_MPI::Comm_rank (MPI_COMM_WORLD , &rank);
9441- SU2_MPI::Comm_size (MPI_COMM_WORLD , &size);
9437+ SU2_MPI::Comm_rank (SU2_MPI::GetComm () , &rank);
9438+ SU2_MPI::Comm_size (SU2_MPI::GetComm () , &size);
94429439
94439440 /* Check for the master node. */
94449441 if (rank == MASTER_NODE) {
@@ -9449,7 +9446,7 @@ void CConfig::GEMMProfilingCSV(void) {
94499446 /* Block until a message from this processor arrives. Determine
94509447 the number of entries in the receive buffers. */
94519448 SU2_MPI::Status status;
9452- SU2_MPI::Probe (proc, 0 , MPI_COMM_WORLD , &status);
9449+ SU2_MPI::Probe (proc, 0 , SU2_MPI::GetComm () , &status);
94539450
94549451 int nEntries;
94559452 SU2_MPI::Get_count (&status, MPI_LONG, &nEntries);
@@ -9463,15 +9460,15 @@ void CConfig::GEMMProfilingCSV(void) {
94639460 vector<long > recvBufMNK (3 *nEntries);
94649461
94659462 SU2_MPI::Recv (recvBufNCalls.data (), recvBufNCalls.size (),
9466- MPI_LONG, proc, 0 , MPI_COMM_WORLD , &status);
9463+ MPI_LONG, proc, 0 , SU2_MPI::GetComm () , &status);
94679464 SU2_MPI::Recv (recvBufTotTime.data (), recvBufTotTime.size (),
9468- MPI_DOUBLE, proc, 1 , MPI_COMM_WORLD , &status);
9465+ MPI_DOUBLE, proc, 1 , SU2_MPI::GetComm () , &status);
94699466 SU2_MPI::Recv (recvBufMinTime.data (), recvBufMinTime.size (),
9470- MPI_DOUBLE, proc, 2 , MPI_COMM_WORLD , &status);
9467+ MPI_DOUBLE, proc, 2 , SU2_MPI::GetComm () , &status);
94719468 SU2_MPI::Recv (recvBufMaxTime.data (), recvBufMaxTime.size (),
9472- MPI_DOUBLE, proc, 3 , MPI_COMM_WORLD , &status);
9469+ MPI_DOUBLE, proc, 3 , SU2_MPI::GetComm () , &status);
94739470 SU2_MPI::Recv (recvBufMNK.data (), recvBufMNK.size (),
9474- MPI_LONG, proc, 4 , MPI_COMM_WORLD , &status);
9471+ MPI_LONG, proc, 4 , SU2_MPI::GetComm () , &status);
94759472
94769473 /* Loop over the number of entries. */
94779474 for (int i=0 ; i<nEntries; ++i) {
@@ -9520,15 +9517,15 @@ void CConfig::GEMMProfilingCSV(void) {
95209517
95219518 /* Send the data to the master node using blocking sends. */
95229519 SU2_MPI::Send (GEMM_Profile_NCalls.data (), GEMM_Profile_NCalls.size (),
9523- MPI_LONG, MASTER_NODE, 0 , MPI_COMM_WORLD );
9520+ MPI_LONG, MASTER_NODE, 0 , SU2_MPI::GetComm () );
95249521 SU2_MPI::Send (GEMM_Profile_TotTime.data (), GEMM_Profile_TotTime.size (),
9525- MPI_DOUBLE, MASTER_NODE, 1 , MPI_COMM_WORLD );
9522+ MPI_DOUBLE, MASTER_NODE, 1 , SU2_MPI::GetComm () );
95269523 SU2_MPI::Send (GEMM_Profile_MinTime.data (), GEMM_Profile_MinTime.size (),
9527- MPI_DOUBLE, MASTER_NODE, 2 , MPI_COMM_WORLD );
9524+ MPI_DOUBLE, MASTER_NODE, 2 , SU2_MPI::GetComm () );
95289525 SU2_MPI::Send (GEMM_Profile_MaxTime.data (), GEMM_Profile_MaxTime.size (),
9529- MPI_DOUBLE, MASTER_NODE, 3 , MPI_COMM_WORLD );
9526+ MPI_DOUBLE, MASTER_NODE, 3 , SU2_MPI::GetComm () );
95309527 SU2_MPI::Send (sendBufMNK.data (), sendBufMNK.size (),
9531- MPI_LONG, MASTER_NODE, 4 , MPI_COMM_WORLD );
9528+ MPI_LONG, MASTER_NODE, 4 , SU2_MPI::GetComm () );
95329529 }
95339530
95349531#endif
0 commit comments