From 85d826e59a5160991aadfed11e378c36ad7300a6 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 21 Apr 2020 09:28:16 +0200 Subject: [PATCH] Fix warnings with clang 9 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 | 10 ++++++---- src/gromacs/nbnxm/pairlist.cpp | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gromacs/fileio/checkpoint.cpp b/src/gromacs/fileio/checkpoint.cpp index 2e7fb7338d..dba51ec23a 100644 --- a/src/gromacs/fileio/checkpoint.cpp +++ b/src/gromacs/fileio/checkpoint.cpp @@ -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; diff --git a/src/gromacs/nbnxm/pairlist.cpp b/src/gromacs/nbnxm/pairlist.cpp index b76ad3e9a7..66ec8689d9 100644 --- a/src/gromacs/nbnxm/pairlist.cpp +++ b/src/gromacs/nbnxm/pairlist.cpp @@ -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 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) -- 2.22.0