Merge "Merge branch 'release-5-0'"
authorRoland Schulz <roland@rschulz.eu>
Wed, 17 Dec 2014 09:06:07 +0000 (10:06 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 17 Dec 2014 09:06:08 +0000 (10:06 +0100)
36 files changed:
src/gromacs/correlationfunctions/expfit.c
src/gromacs/correlationfunctions/tests/expfit.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/essentialdynamics/edsam.c
src/gromacs/fileio/gmxfio_asc.c
src/gromacs/gmxana/edittop.c
src/gromacs/gmxana/geminate.c
src/gromacs/gmxana/gmx_anaeig.c
src/gromacs/gmxana/gmx_analyze.c
src/gromacs/gmxana/gmx_densmap.c
src/gromacs/gmxana/gmx_dos.c
src/gromacs/gmxana/gmx_dyndom.c
src/gromacs/gmxlib/cuda_tools/pmalloc_cuda.cu
src/gromacs/gmxlib/cuda_tools/pmalloc_cuda.h [moved from src/gromacs/legacyheaders/pmalloc_cuda.h with 100% similarity]
src/gromacs/gmxlib/gmx_detect_hardware.cpp
src/gromacs/gmxlib/gpu_utils/gpu_utils.cu
src/gromacs/gmxlib/gpu_utils/gpu_utils.h [moved from src/gromacs/legacyheaders/gpu_utils.h with 100% similarity]
src/gromacs/gmxpreprocess/calc_verletbuf.c
src/gromacs/gmxpreprocess/readir.c
src/gromacs/gmxpreprocess/tomorse.c
src/gromacs/gmxpreprocess/toppush.c
src/gromacs/legacyheaders/CMakeLists.txt
src/gromacs/math/utilities.h
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_256s.h
src/gromacs/topology/mtop_util.c
src/gromacs/trajectoryanalysis/modules/sasa.cpp
src/gromacs/trajectoryanalysis/modules/surfacearea.cpp
src/gromacs/trajectoryanalysis/tests/refdata/SasaModuleTest_BasicTest.xml
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithRectangularPBC.xml
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithTriclinicPBC.xml
src/gromacs/trajectoryanalysis/tests/surfacearea.cpp
src/programs/mdrun/runner.cpp
src/programs/view/xdlg.cpp
tests/CppCheck.cmake

index 704943c3279fa52f895754baaad13d1ba58fa101..490e0be4f83cbeb64aadb4fe524b27d17be8e630 100644 (file)
@@ -285,7 +285,7 @@ static double lmc_errest_3_parm(double x, const double *a)
 
     if (a[0] != 0)
     {
-        e1 = exp(-x/a[0]) - 1;
+        e1 = gmx_expm1(-x/a[0]);
     }
     else
     {
@@ -293,7 +293,7 @@ static double lmc_errest_3_parm(double x, const double *a)
     }
     if (a[2] != 0)
     {
-        e2 = exp(-x/a[2]) - 1;
+        e2 = gmx_expm1(-x/a[2]);
     }
     else
     {
index 4da434691d742c07ec1c3189ec1aaf6ea7198f0e..356919269726a6f5ac3de9f77001e2878fa68e3c 100755 (executable)
@@ -144,6 +144,7 @@ class ExpfitTest : public ::testing::Test
 
 //static var
 int               ExpfitTest::nrLines_;
+//cppcheck-suppress arrayIndexOutOfBounds fixed in 1.68-dev
 std::vector<real> ExpfitTest::values_[expTestNrTypes];
 int               ExpfitTest::nrColumns_;
 std::vector<real> ExpfitTest::standardDev_;
index 4f2cf4a881297b5fa18c851f844964a21212c774..3ed2d3dc1a4f4d3fc8b7714063caf898205a5c09 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/pdbio.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 #include "gromacs/imd/imd.h"
 #include "gromacs/legacyheaders/chargegroup.h"
 #include "gromacs/legacyheaders/constr.h"
@@ -59,7 +60,6 @@
 #include "gromacs/legacyheaders/genborn.h"
 #include "gromacs/legacyheaders/gmx_ga2la.h"
 #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
-#include "gromacs/legacyheaders/gpu_utils.h"
 #include "gromacs/legacyheaders/mdatoms.h"
 #include "gromacs/legacyheaders/mdrun.h"
 #include "gromacs/legacyheaders/names.h"
index 299842d375fa77cef168fe00f15d24cc061120c4..5514403870b5a8fb29647276dbe46254230c55e2 100644 (file)
@@ -1793,7 +1793,6 @@ static int read_edi_file(const char *fn, t_edpar *edi, int nr_mdatoms)
         /* Keep the curr_edi pointer for the case that the next group is empty: */
         last_edi = curr_edi;
         /* Let's prepare to read in the next edi data set: */
-        /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
         curr_edi = edi_read;
     }
     if (edi_nr == 0)
index f819a8d7a0a25c2a6199ce73f4cffe80e0799680..a451b0c072b644d237b1284c8369de90c019505c 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "config.h"
 
+#include <assert.h>
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
@@ -361,6 +362,7 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
             }
             break;
         case eioNRVEC:
+            assert(item);
             for (i = 0; (i < nitem); i++)
             {
                 ptr = ((rvec *) item)[i];
@@ -368,10 +370,7 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
                 {
                     res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), "%lf\n",
                                  &x);
-                    if (item)
-                    {
-                        ptr[m] = x;
-                    }
+                    ptr[m] = x;
                 }
             }
             break;
index 3a5357c731391c6711b76f87aeb7a406f4a88088..0338366db0c28712d22cfa6e082b7ab043812287 100644 (file)
@@ -110,7 +110,6 @@ static void delete_from_interactions(t_idef *idef, int inr)
             idef->il[i].iatoms[j] = niatoms[j];
         }
         idef->il[i].nr = nnr;
-        /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
         sfree(niatoms);
     }
 }
index 2b8603dfe68e59f02168eec0086eaf6f975c277e..d06a4b41d8e91e8ffde3df410454fe98a4181083 100644 (file)
@@ -515,7 +515,7 @@ static double eq10v2(double theoryCt[], double time[], int manytimes,
 /* This returns the real-valued index(!) to an ACF, equidistant on a log scale. */
 static double getLogIndex(const int i, const t_gemParams *params)
 {
-    return (exp(((double)(i)) * params->logQuota) -1);
+    return gmx_expm1(((double)(i)) * params->logQuota);
 }
 
 extern t_gemParams *init_gemParams(const double sigma, const double D,
index 4a219adf2cc4247d90b625639a963f60656a30a9..d9ea3facf922cdeae384fefee38d1df19f4c348b 100644 (file)
@@ -76,7 +76,7 @@ static void calc_entropy_qh(FILE *fp, int n, real eigval[], real temp, int nskip
             lambda = eigval[i]*AMU;
             w      = sqrt(BOLTZMANN*temp/lambda)/NANO;
             hwkT   = (hbar*w)/(BOLTZMANN*temp);
-            dS     = (hwkT/(exp(hwkT) - 1) - log(1-exp(-hwkT)));
+            dS     = (hwkT/gmx_expm1(hwkT) - gmx_log1p(-exp(-hwkT)));
             S     += dS;
             if (debug)
             {
index 8d1eab6bee08e2ce8bb27576d8717a506d94a437..1c323e14b23d6bdc14879c6e80ad3ba907d8d05a 100644 (file)
@@ -89,7 +89,7 @@ static void power_fit(int n, int nset, real **val, real *t)
         fprintf(stdout, "First time is not larger than 0, using index number as time for power fit\n");
         for (i = 0; i < n; i++)
         {
-            x[i] = log(i+1);
+            x[i] = gmx_log1p(i);
         }
     }
 
index 03bc88dd11495173ec16d5a96cd86ae0aafab9bf..bf263eae7fa06d80a51309b9e342a59a985cef57 100644 (file)
@@ -246,7 +246,9 @@ int gmx_densmap(int argc, char *argv[])
     {
         n1      = (int)(2*amax/bin + 0.5);
         nradial = (int)(rmax/bin + 0.5);
+        /* cppcheck-suppress zerodiv fixed in 1.68-dev */
         invspa  = n1/(2*amax);
+        /* cppcheck-suppress zerodiv fixed in 1.68-dev */
         invspz  = nradial/rmax;
         if (bMirror)
         {
index 560ab280f550d58b14275e0c2a87c726f7b7fe2e..52a7d9d61ef50703e1d77167b23039cee49b8b36 100644 (file)
@@ -181,7 +181,7 @@ static real wSsolid(real nu, real beta)
     }
     else
     {
-        return bhn/(exp(bhn)-1) - log(1-exp(-bhn));
+        return bhn/gmx_expm1(bhn) - gmx_log1p(-exp(-bhn));
     }
 }
 
@@ -209,7 +209,7 @@ static real wEsolid(real nu, real beta)
     }
     else
     {
-        return bhn/2 + bhn/(exp(bhn)-1)-1;
+        return bhn/2 + bhn/gmx_expm1(bhn)-1;
     }
 }
 
index 5a727cb1c2317a7e5391eabde550148b8bd02964..63fb697756d84766509652fadefec326d89c0a35 100644 (file)
@@ -208,6 +208,11 @@ int gmx_dyndom(int argc, char *argv[])
         return 0;
     }
 
+    if (maxangle == 0)
+    {
+        gmx_fatal(FARGS, "maxangle not given");
+    }
+
     get_stx_coordnum (opt2fn("-f", NFILE, fnm), &natoms);
     init_t_atoms(&atoms, natoms, TRUE);
     snew(x, natoms);
index d0c684d4ae0ae29b44d0891e79f673fb23202d68..cfcc620c19372e0740893214cb81397ab7afdf6f 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "gmxpre.h"
 
-#include "gromacs/legacyheaders/pmalloc_cuda.h"
+#include "pmalloc_cuda.h"
 
 #include <stdlib.h>
 
index b2993963f1754c73cc990bfb6ff537bc2463473b..b3edc587ebe555ecb5474f760dd62562422fd44b 100644 (file)
@@ -56,9 +56,9 @@
 
 #include "thread_mpi/threads.h"
 
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/gmx_cpuid.h"
-#include "gromacs/legacyheaders/gpu_utils.h"
 #include "gromacs/legacyheaders/md_logging.h"
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/types/commrec.h"
index c3ae3ed15fbfe92fdba29002e8d73c5577efedb7..df477525c27c379c2cc6da02a21a8d1272559322 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "gmxpre.h"
 
-#include "gromacs/legacyheaders/gpu_utils.h"
+#include "gpu_utils.h"
 
 #include "config.h"
 
index 3ace4d48ab811bd135e36f95fc3ee50c2adb57c6..0116bfeb04215bd6b68169a60994786ce04059d3 100644 (file)
@@ -414,7 +414,6 @@ static void get_verlet_buffer_atomtypes(const gmx_mtop_t      *mtop,
             add_at(&att, &natt, &prop[a], nmol);
         }
 
-        /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
         sfree(vsite_m);
         sfree(prop);
     }
index ac169f0203d2786456b4b1ec60c4e1b811bcf640..6b4a6e8caf99c43e96b66fbfa3b93d05e48c10b9 100644 (file)
@@ -159,7 +159,7 @@ static void GetSimTemps(int ntemps, t_simtemp *simtemp, double *temperature_lamb
         }
         else if (simtemp->eSimTempScale == esimtempEXPONENTIAL)
         {
-            simtemp->temperatures[i] = simtemp->simtemp_low + (simtemp->simtemp_high-simtemp->simtemp_low)*((exp(temperature_lambdas[i])-1)/(exp(1.0)-1));
+            simtemp->temperatures[i] = simtemp->simtemp_low + (simtemp->simtemp_high-simtemp->simtemp_low)*(gmx_expm1(temperature_lambdas[i])/gmx_expm1(1.0));
         }
         else
         {
index f1781e90432994261ac8dde60a65d6f2711efe93..cd9b793b5fb3b2bc75cd9c8b049cc73668da52cd 100644 (file)
@@ -280,7 +280,6 @@ void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype_t atype)
                         last++;
                     }
                 }
-                /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
                 sfree(bRemoveHarm);
                 fprintf(stderr, "Converted %d out of %d %s to morse bonds for mol %d\n",
                         nrharm-last, nrharm, interaction_function[bb].name, i);
index 8272b7787ecf3f2dad111040e9d2ca76dca6b884..832a2a12037fdd70864944b4f56605199393e290 100644 (file)
@@ -485,6 +485,7 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
         gmx_fatal(FARGS, "Invalid particle type %s on line %s",
                   ptype, line);
     }
+    /* cppcheck-suppress arrayIndexOutOfBounds #6329 */
     pt = xl[j].ptype;
     if (debug)
     {
index f5737e0f02671a282b3dc0f27430898e28eef78b..bd32dda143b2e5e238876e737dad3ed37d4b8f39 100644 (file)
@@ -34,7 +34,7 @@
 
 # includes: Nothing to build, just installation
 file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
-list(REMOVE_ITEM HEADERS gmx_hash.h gmx_ga2la.h gpu_utils.h pmalloc_cuda.h)
+list(REMOVE_ITEM HEADERS gmx_hash.h gmx_ga2la.h)
 gmx_install_headers(${HEADERS})
 
 add_subdirectory(types)
index 2932220068bf53b5d43731c35882630a0f84d4ae..8647c00f80e33870fc4e302600b9b701436a4d7a 100644 (file)
@@ -98,6 +98,14 @@ float   gmx_erfcf(float x);
 #define gmx_erfc(x)  gmx_erfcf(x)
 #endif
 
+#if defined(_MSC_VER) && _MSC_VER < 1800
+#define gmx_expm1(x) (exp(x)-1)
+#define gmx_log1p(x) log(1+x)
+#else
+#define gmx_expm1 expm1
+#define gmx_log1p log1p
+#endif
+
 gmx_bool gmx_isfinite(real x);
 gmx_bool gmx_isnan(real x);
 
index d3bb4be6f68aca0d95ae4d5ef5fa0bf20c928510..bfcaacce9648d73b6b0b6f854a63629ba6ab22f4 100644 (file)
 
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/ewald/ewald.h"
+#include "gromacs/gmxlib/cuda_tools/pmalloc_cuda.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/force.h"
 #include "gromacs/legacyheaders/gmx_detect_hardware.h"
 #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
-#include "gromacs/legacyheaders/gpu_utils.h"
 #include "gromacs/legacyheaders/inputrec.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/md_logging.h"
@@ -57,7 +58,6 @@
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/nonbonded.h"
 #include "gromacs/legacyheaders/ns.h"
-#include "gromacs/legacyheaders/pmalloc_cuda.h"
 #include "gromacs/legacyheaders/qmmm.h"
 #include "gromacs/legacyheaders/tables.h"
 #include "gromacs/legacyheaders/txtdump.h"
index a6cf4b2d6bac5d7db17500ddf5824586e7d4eeb4..f1027b0344a164aded49e76cbba1edb5aa516907 100644 (file)
@@ -47,9 +47,9 @@
 #include <cuda_profiler_api.h>
 
 #include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/gmxlib/cuda_tools/pmalloc_cuda.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 #include "gromacs/legacyheaders/gmx_detect_hardware.h"
-#include "gromacs/legacyheaders/gpu_utils.h"
-#include "gromacs/legacyheaders/pmalloc_cuda.h"
 #include "gromacs/legacyheaders/tables.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/enums.h"
index 5caee76a48dfb1acbb151edbbb66ea58fd0471ee..52a081ae9bae6bb1199ba4246f9d36a08bdd8997 100644 (file)
@@ -312,6 +312,7 @@ gmx_load1_exclfilter(int e)
 static gmx_inline gmx_exclfilter gmx_simdcall
 gmx_load_exclusion_filter(const unsigned *i)
 {
+    /* cppcheck-suppress invalidPointerCast */
     return gmx_simd_load_r((real *) (i));
 }
 
index 19fd0927dcb472479cad967a581139c2ada0ad9d..24eb127af26c37942623e8894c977b917d2c1f5a 100644 (file)
@@ -411,9 +411,11 @@ void gmx_mtop_atominfo_global(const gmx_mtop_t *mtop, int atnr_global,
     {
         if (mb >= 0)
         {
+            /* cppcheck-suppress nullPointer #6330*/
             if (atoms->nres <= mtop->maxres_renum)
             {
                 /* Single residue molecule, keep counting */
+                /* cppcheck-suppress nullPointer #6330*/
                 maxresnr += mtop->molblock[mb].nmol*atoms->nres;
             }
         }
index 954ec8f79ac36d9e8d8599851787b295d1b30724..2fac12b748fec1e557cdef671e5eefd4671349ba 100644 (file)
@@ -434,8 +434,10 @@ Sasa::initOptions(Options *options, TrajectoryAnalysisSettings *settings)
         //"which can be used to restrain surface atoms.[PAR]",
 
         "With the [TT]-tv[tt] option the total volume and density of the",
-        "molecule can be computed.",
-        "Please consider whether the normal probe radius is appropriate",
+        "molecule can be computed. With [TT]-pbc[tt] (the default), you",
+        "must ensure that your molecule/surface group is not split across PBC.",
+        "Otherwise, you will get non-sensical results.",
+        "Please also consider whether the normal probe radius is appropriate",
         "in this case or whether you would rather use, e.g., 0. It is good",
         "to keep in mind that the results for volume and density are very",
         "approximate. For example, in ice Ih, one can easily fit water molecules in the",
index 5f333230e12e6a2e739529707699299ee5291972..d19897065512106c19bc05785537d76c31d06570 100644 (file)
@@ -655,7 +655,7 @@ nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
     Neighb     *wknb, *ctnb;
     int         iii1, iii2, iiat, lfnr = 0, i_at, j_at;
     real        dx, dy, dz, dd, ai, aisq, ajsq, aj, as, a;
-    real        xi, yi, zi, xs = 0., ys = 0., zs = 0.;
+    real        xi, yi, zi;
     real        dotarea, area, vol = 0.;
     real       *xus, *dots = NULL, *atom_area = NULL;
     int         nxbox, nybox, nzbox, nxy, nxyz;
@@ -729,6 +729,24 @@ nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
     }
     ra2max = 2*ra2max;
 
+    // Compute the center of the molecule for volume calculation.
+    // In principle, the center should not influence the results, but that is
+    // only true at the limit of infinite dot density, so this makes the
+    // results translation-invariant.
+    // With PBC, if the molecule is broken across the boundary, the computation
+    // is broken in other ways as well, so it does not need to be considered
+    // here.
+    real xs = 0.0, ys = 0.0, zs = 0.0;
+    for (i = 0; i < nat; ++i)
+    {
+        iat = index[i];
+        xs += coords[iat][XX];
+        ys += coords[iat][YY];
+        zs += coords[iat][ZZ];
+    }
+    xs /= nat;
+    ys /= nat;
+    zs /= nat;
     /* Added DvdS 2006-07-19 */
     /* Updated 2008-10-09 */
     if (box)
@@ -737,7 +755,7 @@ nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
         snew(x, nat);
         for (i = 0; (i < nat); i++)
         {
-            iat  = index[0];
+            iat = index[0];
             copy_rvec(coords[iat], x[i]);
         }
         put_atoms_in_triclinic_unitcell(ecenterTRIC, box, nat, x);
@@ -753,9 +771,9 @@ nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
     {
         /* dimensions of atomic set, cell edge is 2*ra_max */
         iat    = index[0];
-        xmin   = coords[iat][XX]; xmax = xmin; xs = xmin;
-        ymin   = coords[iat][YY]; ymax = ymin; ys = ymin;
-        zmin   = coords[iat][ZZ]; zmax = zmin; zs = zmin;
+        xmin   = coords[iat][XX]; xmax = xmin;
+        ymin   = coords[iat][YY]; ymax = ymin;
+        zmin   = coords[iat][ZZ]; zmax = zmin;
 
         for (iat_xx = 1; (iat_xx < nat); iat_xx++)
         {
@@ -764,11 +782,7 @@ nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
             xmin = std::min(xmin, *pco);     xmax = std::max(xmax, *pco);
             ymin = std::min(ymin, *(pco+1)); ymax = std::max(ymax, *(pco+1));
             zmin = std::min(zmin, *(pco+2)); zmax = std::max(zmax, *(pco+2));
-            xs   = xs+ *pco; ys = ys+ *(pco+1); zs = zs+ *(pco+2);
         }
-        xs = xs/ (real) nat;
-        ys = ys/ (real) nat;
-        zs = zs/ (real) nat;
         if (debug)
         {
             fprintf(debug, "nsc_dclm: n_dot=%5d ra2max=%9.3f %9.3f\n", n_dot, ra2max, dotarea);
index 91f830507db9aabbb6c68890f11ef68b0931ab8e..a26657b9e068debc59012c9ba93794074c445b68 100644 (file)
         <DataValues>
           <Int Name="Count">2</Int>
           <DataValue>
-            <Real Name="Value">2.7441690613360836</Real>
+            <Real Name="Value">2.5505606048765408</Real>
           </DataValue>
           <DataValue>
-            <Real Name="Value">698.86027894441133</Real>
+            <Real Name="Value">751.9095025655306</Real>
           </DataValue>
         </DataValues>
       </DataFrame>
index c30bb6403409100926e0120de3e20be406cfe52a..b54cf459ceed006219663533b420e93b1c6bdc73 100644 (file)
@@ -3,6 +3,7 @@
 <ReferenceData>
   <SASA Name="100Points">
     <Real Name="Area">1041.9522794772727</Real>
+    <Real Name="Volume">808.03995831604618</Real>
     <Sequence Name="AtomArea">
       <Int Name="Length">100</Int>
       <Real>0.95131516208197198</Real>
index c30bb6403409100926e0120de3e20be406cfe52a..b54cf459ceed006219663533b420e93b1c6bdc73 100644 (file)
@@ -3,6 +3,7 @@
 <ReferenceData>
   <SASA Name="100Points">
     <Real Name="Area">1041.9522794772727</Real>
+    <Real Name="Volume">808.03995831604618</Real>
     <Sequence Name="AtomArea">
       <Int Name="Length">100</Int>
       <Real>0.95131516208197198</Real>
index 8c3fc1745805e7d4745b215c1a1f006e1ebabd7d..8ca70e1747c1435d822f1bed5dc882853fed8d17 100644 (file)
@@ -353,8 +353,7 @@ TEST_F(SurfaceAreaTest, Computes100PointsWithRectangularPBC)
     box_[XX][XX] = 20.0;
     box_[YY][YY] = 20.0;
     box_[ZZ][ZZ] = 20.0;
-    // TODO: The volume computation with PBC is broken...
-    const int flags = FLAG_ATOM_AREA | FLAG_DOTS;
+    const int flags = FLAG_ATOM_AREA | FLAG_VOLUME | FLAG_DOTS;
     ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
     checkReference(&checker, "100Points", false);
 
@@ -388,8 +387,7 @@ TEST_F(SurfaceAreaTest, Computes100PointsWithTriclinicPBC)
     box_[ZZ][YY] = 10.0*sqrt(1.0/3.0);
     box_[ZZ][ZZ] = 20.0*sqrt(2.0/3.0);
 
-    // TODO: The volume computation with PBC is broken...
-    const int flags = FLAG_ATOM_AREA | FLAG_DOTS;
+    const int flags = FLAG_ATOM_AREA | FLAG_VOLUME | FLAG_DOTS;
     ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
     checkReference(&checker, "100Points", false);
 
index d64f980cd4c216bd6fc12a6715e3a0ffb49c22f0..3e2d005fed07037b757fe43ab394b35833542c2a 100644 (file)
@@ -94,7 +94,7 @@
 #include "corewrap.h"
 #endif
 
-#include "gromacs/legacyheaders/gpu_utils.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 
 typedef struct {
     gmx_integrator_t *func;
index 4c3d4375ac2cfa1a33d05f8bc9e5013f1815e65b..2719c42b80a95fef1b21a0f76e638639ca677f4a 100644 (file)
@@ -408,11 +408,14 @@ void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
         if (gmx_strcasecmp(buf, "nok") == 0)
         {
             /* An error occurred */
-            for (i = 0; (i < nlines); i++)
+            if (lines)
             {
-                sfree(lines[i]);
+                for (i = 0; (i < nlines); i++)
+                {
+                    sfree(lines[i]);
+                }
+                sfree(lines);
             }
-            sfree(lines);
             NoHelp(dlg);
             return;
         }
index 0f7917271f307c9a936f1804ca503c7a4f5c0a55..767631b715c3e360b91918ef250fdc461eb3240f 100644 (file)
@@ -86,9 +86,9 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         --suppress=unusedStructMember
         --suppress=invalidscanf
         --suppress=sizeofCalculation
+        --suppress=invalidscanf_libc
         --suppress=missingInclude:src/programs/mdrun/gmx_gpu_utils/gmx_gpu_utils.cu
         --suppress=*:src/external/Random123-1.08/include/Random123/features/compilerfeatures.h
-        --suppress=assignIfError:src/gromacs/mdlib/nbnxn_atomdata.c #Ticket 5695
         --suppress=invalidPointerCast:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
         --suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
         --suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh
@@ -97,10 +97,9 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         -D__cplusplus
         --suppress=variableScope
         --suppress=unnecessaryForwardDeclaration
-        --suppress=invalidscanf:src/gromacs/fileio/matio.cpp
-        --suppress=invalidscanf:src/gromacs/fileio/xvgr.cpp
-        --suppress=invalidscanf:src/gromacs/topology/index.cpp
-        --suppress=invalidscanf:src/gromacs/gmxpreprocess/pdb2top.cpp
+        --suppress=memsetClassFloat  #we assume IEEE754
+        --suppress=invalidscanf_libc #seems only important for security on non-std libc
+        --suppress=invalidscanf      #same as last (style and portability checker have the same warning)
         --suppress=passedByValue:src/gromacs/simd/tests/*
         )