Fix MPI build
authorArtem Zhmurov <zhmurov@gmail.com>
Thu, 11 Feb 2021 11:19:52 +0000 (11:19 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Thu, 11 Feb 2021 11:19:52 +0000 (11:19 +0000)
In the change that made clang-tidy-11 happy for domdec
(0af8a86a3c9556b2dc8fbd4c9f2a430c5cd58982) the MPI_Comm
were set to nullptr, although they are not pointers.

src/gromacs/domdec/domdec.cpp

index 32f3f988252c460602b082c8055ab9cf14761f03..0a055d6a5494e658faf0289528b0714c0b219df0 100644 (file)
@@ -1009,7 +1009,7 @@ void dd_cycles_add(const gmx_domdec_t* dd, float cycles, int ddCycl)
 #if GMX_MPI
 static void make_load_communicator(gmx_domdec_t* dd, int dim_ind, ivec loc)
 {
-    MPI_Comm c_row = nullptr;
+    MPI_Comm c_row = MPI_COMM_NULL;
     ivec     loc_c;
     bool     bPartOfGroup = false;
 
@@ -1065,7 +1065,7 @@ static void make_load_communicator(gmx_domdec_t* dd, int dim_ind, ivec loc)
 void dd_setup_dlb_resource_sharing(const t_commrec* cr, int gpu_id)
 {
 #if GMX_MPI
-    MPI_Comm mpi_comm_pp_physicalnode = nullptr;
+    MPI_Comm mpi_comm_pp_physicalnode = MPI_COMM_NULL;
 
     if (!thisRankHasDuty(cr, DUTY_PP) || gpu_id < 0)
     {
@@ -1299,7 +1299,7 @@ static void make_pp_communicator(const gmx::MDLogger& mdlog,
         {
             periods[i] = TRUE;
         }
-        MPI_Comm comm_cart = nullptr;
+        MPI_Comm comm_cart = MPI_COMM_NULL;
         MPI_Cart_create(cr->mpi_comm_mygroup, DIM, dd->numCells, periods, static_cast<int>(reorder), &comm_cart);
         /* We overwrite the old communicator with the new cartesian one */
         cr->mpi_comm_mygroup = comm_cart;
@@ -1492,7 +1492,7 @@ static CartesianRankSetup split_communicator(const gmx::MDLogger& mdlog,
         {
             periods[i] = TRUE;
         }
-        MPI_Comm comm_cart = nullptr;
+        MPI_Comm comm_cart = MPI_COMM_NULL;
         MPI_Cart_create(cr->mpi_comm_mysim, DIM, cartSetup.ntot, periods, static_cast<int>(reorder), &comm_cart);
         MPI_Comm_rank(comm_cart, &rank);
         if (MASTER(cr) && rank != 0)