Merge release-5-0 into master
authorRoland Schulz <roland@utk.edu>
Wed, 10 Sep 2014 04:16:09 +0000 (00:16 -0400)
committerRoland Schulz <roland@utk.edu>
Wed, 10 Sep 2014 04:20:34 +0000 (00:20 -0400)
Conflicts:
CMakeLists.txt
only version changes not needed in master
src/gromacs/utility/gmxassert.h
better fix already in master

Change-Id: I8af70d807972758149e9f69b420d528269e9bebd

1  2 
src/gromacs/gmxpreprocess/readir.c
src/gromacs/mdlib/domdec.c

index b12714eb7882944edea49bf1147aa936431f0430,763b6d8e5da1001ebcde6dc9a9b4af91f2971788..b86bbef806e7f0a6317fe8900035573c4612b2d3
   * To help us fund GROMACS development, we humbly ask that you cite
   * the research papers on the package. Check out http://www.gromacs.org.
   */
 -#ifdef HAVE_CONFIG_H
 -#include <config.h>
 -#endif
 +#include "gmxpre.h"
  
  #include <ctype.h>
 -#include <stdlib.h>
  #include <limits.h>
 -#include "sysstuff.h"
 -#include "gromacs/utility/smalloc.h"
 -#include "typedefs.h"
 -#include "physics.h"
 -#include "names.h"
 -#include "gmx_fatal.h"
 -#include "macros.h"
 -#include "index.h"
 -#include "symtab.h"
 +#include <stdlib.h>
 +
 +#include "gromacs/legacyheaders/typedefs.h"
 +#include "gromacs/math/units.h"
 +#include "gromacs/legacyheaders/names.h"
 +#include "gromacs/legacyheaders/macros.h"
 +#include "gromacs/topology/index.h"
  #include "gromacs/utility/cstringutil.h"
 -#include "readinp.h"
 -#include "warninp.h"
 +#include "gromacs/legacyheaders/readinp.h"
 +#include "gromacs/legacyheaders/warninp.h"
  #include "readir.h"
  #include "toputil.h"
 -#include "index.h"
 -#include "network.h"
 -#include "vec.h"
 -#include "pbc.h"
 -#include "mtop_util.h"
 -#include "chargegroup.h"
 -#include "inputrec.h"
 +#include "gromacs/legacyheaders/network.h"
 +#include "gromacs/math/vec.h"
 +#include "gromacs/pbcutil/pbc.h"
 +#include "gromacs/topology/mtop_util.h"
 +#include "gromacs/legacyheaders/chargegroup.h"
 +#include "gromacs/legacyheaders/inputrec.h"
  #include "calc_verletbuf.h"
  
 +#include "gromacs/topology/block.h"
 +#include "gromacs/topology/symtab.h"
 +#include "gromacs/utility/fatalerror.h"
 +#include "gromacs/utility/smalloc.h"
 +
  #define MAXPTR 254
  #define NOGID  255
  
@@@ -369,6 -370,11 +369,11 @@@ void check_ir(const char *mdparin, t_in
              warning_error(wi, warn_buf);
          }
  
+         if (ir->implicit_solvent != eisNO)
+         {
+             warning_error(wi, "Implicit solvent is not (yet) supported with the with Verlet lists.");
+         }
          if (ir->nstlist <= 0)
          {
              warning_error(wi, "With Verlet lists nstlist should be larger than 0");
@@@ -1330,11 -1336,9 +1335,9 @@@ nd %s"
      /* IMPLICIT SOLVENT */
      if (ir->coulombtype == eelGB_NOTUSED)
      {
-         ir->coulombtype      = eelCUT;
-         ir->implicit_solvent = eisGBSA;
-         fprintf(stderr, "Note: Old option for generalized born electrostatics given:\n"
-                 "Changing coulombtype from \"generalized-born\" to \"cut-off\" and instead\n"
-                 "setting implicit-solvent value to \"GBSA\" in input section.\n");
+         sprintf(warn_buf, "Invalid option %s for coulombtype",
+                 eel_names[ir->coulombtype]);
+         warning_error(wi, warn_buf);
      }
  
      if (ir->sa_algorithm == esaSTILL)
@@@ -1422,7 -1426,7 +1425,7 @@@ int str_nelem(const char *str, int maxp
      int   np = 0;
      char *copy0, *copy;
  
 -    copy0 = strdup(str);
 +    copy0 = gmx_strdup(str);
      copy  = copy0;
      ltrim(copy);
      while (*copy != '\0')
@@@ -1677,7 -1681,7 +1680,7 @@@ static void do_wall_params(t_inputrec *
          }
          for (i = 0; i < ir->nwall; i++)
          {
 -            opts->wall_atomtype[i] = strdup(names[i]);
 +            opts->wall_atomtype[i] = gmx_strdup(names[i]);
          }
  
          if (ir->wall_type == ewt93 || ir->wall_type == ewt104)
@@@ -2340,7 -2344,7 +2343,7 @@@ void get_ir(const char *mdparin, const 
      {
          if (ir->efep != efepNO)
          {
 -            opts->couple_moltype = strdup(is->couple_moltype);
 +            opts->couple_moltype = gmx_strdup(is->couple_moltype);
              if (opts->couple_lam0 == opts->couple_lam1)
              {
                  warning(wi, "The lambda=0 and lambda=1 states for coupling are identical");
@@@ -2932,7 -2936,7 +2935,7 @@@ static void decode_cos(char *s, t_cosin
      double  a, phi;
      int     i;
  
 -    t = strdup(s);
 +    t = gmx_strdup(s);
      trim(t);
  
      cosine->n   = 0;
@@@ -3113,7 -3117,7 +3116,7 @@@ static void make_swap_groups
  
  void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames)
  {
 -    int      ig = -1, i;
 +    int      ig, i;
  
  
      ig            = search_string(IMDgname, grps->nr, gnames);
index 08a80c667231018b85667760266a525cc1a58a2b,2d2ffb0fd5f374367f2c0b18117d552d9406f658..27d2bcb14a76e8191b4341857b80396afae1c51e
@@@ -33,9 -33,9 +33,9 @@@
   * the research papers on the package. Check out http://www.gromacs.org.
   */
  
 -#ifdef HAVE_CONFIG_H
 -#include <config.h>
 -#endif
 +#include "gmxpre.h"
 +
 +#include "config.h"
  
  #include <stdio.h>
  #include <time.h>
  #include <stdlib.h>
  #include <assert.h>
  
 -#include "typedefs.h"
 -#include "gromacs/utility/smalloc.h"
 -#include "gmx_fatal.h"
 -#include "gmx_fatal_collective.h"
 -#include "vec.h"
 -#include "domdec.h"
 -#include "domdec_network.h"
 -#include "nrnb.h"
 -#include "pbc.h"
 -#include "chargegroup.h"
 -#include "constr.h"
 -#include "mdatoms.h"
 -#include "names.h"
 -#include "force.h"
 -#include "pme.h"
 -#include "mdrun.h"
 -#include "nsgrid.h"
 -#include "shellfc.h"
 -#include "mtop_util.h"
 -#include "gmx_ga2la.h"
 -#include "macros.h"
 +#include "gromacs/bonded/bonded.h"
 +#include "gromacs/legacyheaders/typedefs.h"
 +#include "gromacs/legacyheaders/network.h"
 +#include "gromacs/math/vec.h"
 +#include "gromacs/legacyheaders/domdec.h"
 +#include "gromacs/legacyheaders/domdec_network.h"
 +#include "gromacs/legacyheaders/nrnb.h"
 +#include "gromacs/legacyheaders/chargegroup.h"
 +#include "gromacs/legacyheaders/constr.h"
 +#include "gromacs/legacyheaders/mdatoms.h"
 +#include "gromacs/legacyheaders/names.h"
 +#include "gromacs/legacyheaders/force.h"
 +#include "gromacs/legacyheaders/pme.h"
 +#include "gromacs/legacyheaders/mdrun.h"
 +#include "gromacs/legacyheaders/nsgrid.h"
 +#include "gromacs/legacyheaders/shellfc.h"
 +#include "gromacs/topology/mtop_util.h"
 +#include "gromacs/legacyheaders/gmx_ga2la.h"
 +#include "gromacs/legacyheaders/macros.h"
  #include "nbnxn_search.h"
 -#include "bondf.h"
 -#include "gmx_omp_nthreads.h"
 -#include "gpu_utils.h"
 +#include "gromacs/legacyheaders/bonded-threading.h"
 +#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
 +#include "gromacs/legacyheaders/gpu_utils.h"
  
 -#include "gromacs/fileio/futil.h"
 +#include "gromacs/utility/futil.h"
  #include "gromacs/fileio/gmxfio.h"
  #include "gromacs/fileio/pdbio.h"
 +#include "gromacs/imd/imd.h"
 +#include "gromacs/mdlib/nb_verlet.h"
 +#include "gromacs/pbcutil/ishift.h"
 +#include "gromacs/pbcutil/pbc.h"
 +#include "gromacs/pulling/pull.h"
 +#include "gromacs/pulling/pull_rotation.h"
 +#include "gromacs/swap/swapcoords.h"
  #include "gromacs/timing/wallcycle.h"
 +#include "gromacs/utility/basenetwork.h"
 +#include "gromacs/utility/fatalerror.h"
  #include "gromacs/utility/gmxmpi.h"
 -#include "gromacs/swap/swapcoords.h"
  #include "gromacs/utility/qsort_threadsafe.h"
 -#include "gromacs/pulling/pull.h"
 -#include "gromacs/pulling/pull_rotation.h"
 -#include "gromacs/imd/imd.h"
 +#include "gromacs/utility/smalloc.h"
  
  #define DDRANK(dd, rank)    (rank)
  #define DDMASTERRANK(dd)   (dd->masterrank)
@@@ -1324,7 -1320,6 +1324,6 @@@ static void dd_collect_cg(gmx_domdec_t 
  {
      gmx_domdec_master_t *ma = NULL;
      int                  buf2[2], *ibuf, i, ncg_home = 0, *cg = NULL, nat_home = 0;
-     t_block             *cgs_gl;
  
      if (state_local->ddp_count == dd->comm->master_cg_ddp_count)
      {
  
      if (state_local->ddp_count == dd->ddp_count)
      {
+         /* The local state and DD are in sync, use the DD indices */
          ncg_home = dd->ncg_home;
          cg       = dd->index_gl;
          nat_home = dd->nat_home;
      }
      else if (state_local->ddp_count_cg_gl == state_local->ddp_count)
      {
+         /* The DD is out of sync with the local state, but we have stored
+          * the cg indices with the local state, so we can use those.
+          */
+         t_block *cgs_gl;
          cgs_gl = &dd->comm->cgs_gl;
  
          ncg_home = state_local->ncg_gl;
          gmx_incons("Attempted to collect a vector for a state for which the charge group distribution is unknown");
      }
  
-     buf2[0] = dd->ncg_home;
-     buf2[1] = dd->nat_home;
+     buf2[0] = ncg_home;
+     buf2[1] = nat_home;
      if (DDMASTER(dd))
      {
          ma   = dd->ma;
  
      /* Collect the charge group indices on the master */
      dd_gatherv(dd,
-                dd->ncg_home*sizeof(int), dd->index_gl,
+                ncg_home*sizeof(int), cg,
                 DDMASTER(dd) ? ma->ibuf : NULL,
                 DDMASTER(dd) ? ma->ibuf+dd->nnodes : NULL,
                 DDMASTER(dd) ? ma->cg : NULL);
@@@ -1943,7 -1944,7 +1948,7 @@@ static void write_dd_grid_pdb(const cha
          snew(grid_r, 2*dd->nnodes);
      }
  
 -    dd_gather(dd, 2*sizeof(rvec), grid_s[0], DDMASTER(dd) ? grid_r[0] : NULL);
 +    dd_gather(dd, 2*sizeof(rvec), grid_s, DDMASTER(dd) ? grid_r : NULL);
  
      if (DDMASTER(dd))
      {