Fix warnings with clang 9
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 21 Apr 2020 07:28:16 +0000 (09:28 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 21 Apr 2020 07:29:30 +0000 (09:29 +0200)
Use of GMX_USE_SIMD_KERNELS left some code declared and unused,
which is now fixed.

Printf formats for int64_t are not very portable, so used the
traditional string work around again.

src/gromacs/fileio/checkpoint.cpp
src/gromacs/nbnxm/pairlist.cpp

index 2e7fb7338d14ca7a0e67b72a7064b026f3690f8a..dba51ec23a469687df87f44bd5b32a6dfed530f8 100644 (file)
@@ -2849,17 +2849,19 @@ void load_checkpoint(const char*                   fn,
         // -nsteps to circumvent this condition.
         if (ir->nsteps + ir->init_step < headerContents.step)
         {
-            std::string message = gmx::formatString("The input requested %ld steps, ", ir->nsteps);
+            char        buf[STEPSTRSIZE];
+            std::string message =
+                    gmx::formatString("The input requested %s steps, ", gmx_step_str(ir->nsteps, buf));
             if (ir->init_step > 0)
             {
-                message += gmx::formatString("starting from step %ld, ", ir->init_step);
+                message += gmx::formatString("starting from step %s, ", gmx_step_str(ir->init_step, buf));
             }
             message += gmx::formatString(
                     "however the checkpoint "
-                    "file has already reached step %ld. The simulation will not "
+                    "file has already reached step %s. The simulation will not "
                     "proceed, because either your simulation is already complete, "
                     "or your combination of input files don't match.",
-                    headerContents.step);
+                    gmx_step_str(headerContents.step, buf));
             gmx_fatal(FARGS, "%s", message.c_str());
         }
         ir->nsteps += ir->init_step - headerContents.step;
index b76ad3e9a75a5537ef9a3870ab286fda58ff2329..66ec8689d9b98c0ed8bba0d16f9aabbb664753b9 100644 (file)
@@ -101,7 +101,7 @@ enum class NbnxnLayout
     Gpu8x8x8   // i-cluster size 8, j-cluster size 8 + super-clustering
 };
 
-#if GMX_SIMD
+#if defined(GMX_NBNXN_SIMD_4XN) || defined(GMX_NBNXN_SIMD_2XNN)
 /* Returns the j-cluster size */
 template<NbnxnLayout layout>
 static constexpr int jClusterSize()
@@ -214,7 +214,7 @@ static inline int xIndexFromCj(int cj)
         return cj * STRIDE_P8;
     }
 }
-#endif // GMX_SIMD
+#endif // defined(GMX_NBNXN_SIMD_4XN) || defined(GMX_NBNXN_SIMD_2XNN)
 
 
 void nbnxn_init_pairlist_fep(t_nblist* nl)