Merge 'origin/release-2019' into release-2020
authorPaul Bauer <paul.bauer.q@gmail.com>
Wed, 20 Nov 2019 17:34:52 +0000 (18:34 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 20 Nov 2019 17:34:52 +0000 (18:34 +0100)
Resolved Conflicts:
docs/release-notes/2019/2019.5.rst
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/fileio/groio.cpp

Change-Id: Icd9d3bfee7a2ba524057791f4ee0fcf8db13797f

1  2 
cmake/gmxCFlags.cmake
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/fileio/groio.cpp

index 75e2176868547874645753821d01955aed7b3e2b,5dd6d3cd988eda981f798435fd04a60005c37b70..a7a68a617cb06d72e97057b2146d38aa5d884c54
@@@ -402,29 -328,22 +402,48 @@@ GMX_TEST_CFLAG(CFLAGS_WARN "/W3;/wd161;
              if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0") #LLVM BUG #21629
                  GMX_TEST_CXXFLAG(CXXFLAGS_WARN_NO_BRACES "-Wno-missing-braces" GMXC_CXXFLAGS)
              endif()
 -            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
 -            GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-prototypes" GMXC_CXXFLAGS)
 +            GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra;-Wno-missing-field-initializers;-Wpointer-arith;-Wmissing-prototypes" GMXC_CXXFLAGS)
              GMX_TEST_CXXFLAG(CXXFLAGS_DEPRECATED "-Wdeprecated" GMXC_CXXFLAGS)
 +            # Functions placed in headers for inlining are not always
 +            # used in every translation unit that includes the files,
 +            # so we must disable the warning that there are such
 +            # functions that are unused.
 +            GMX_TEST_CXXFLAG(CXXFLAGS_NO_UNUSED_FUNCTION "-Wno-unused-function" GMXC_CXXFLAGS)
 +        endif()
 +        if(NOT GMX_OPENMP)
 +            GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
 +        endif()
 +    endif()
 +
 +    # Apple bastardized version of Clang
 +    if(${CMAKE_C_COMPILER_ID} MATCHES "AppleClang")
 +        if(${CMAKE_C_COMPILER_VERSION} VERSION_GREATER 11.0)
 +            # Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
 +            # that checks stack alignment by default, but their own C library
 +            # does not align the stack properly. Embarrassing, Apple...
 +            GMX_TEST_CFLAG(CFLAG_NO_STACK_CHECK "-fno-stack-check" GMXC_CFLAGS)
 +        endif()
 +    endif()
 +
++    if(${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang")
++        if(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 11.0)
++            # Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
++            # that checks stack alignment by default, but their own C library
++            # does not align the stack properly. Embarrassing, Apple...
++            GMX_TEST_CXXFLAG(CXXFLAG_NO_STACK_CHECK "-fno-stack-check" GMXC_CXXFLAGS)
+         endif()
+     endif()
+     # Apple bastardized version of Clang
+     if(${CMAKE_C_COMPILER_ID} MATCHES "AppleClang")
+         if(${CMAKE_C_COMPILER_VERSION} VERSION_GREATER 11.0)
+             # Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
+             # that checks stack alignment by default, but their own C library
+             # does not align the stack properly. Embarrassing, Apple...
+             GMX_TEST_CFLAG(CFLAG_NO_STACK_CHECK "-fno-stack-check" GMXC_CFLAGS)
+         endif()
+     endif()
      if(${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang")
          if(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 11.0)
              # Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
index a426057672412d998d381857af8bc72548bc408e,2bb331549f3a7e846259541e5a815b0ed483976a..6e28cad22c6e52fd7adcfc8c8eaf08dd5383f02b
@@@ -1909,51 -2324,66 +1909,51 @@@ t_blocka* makeBondedLinks(const gmx_mto
          int mol;
          for (mol = 0; mol < (mtop->bIntermolecularInteractions ? molb.nmol : 1); mol++)
          {
 -            for (int cg = 0; cg < cgs.nr; cg++)
 +            for (int a = 0; a < molt.atoms.nr; a++)
              {
 -                int cg_gl            = cg_offset + cg;
 -                link->index[cg_gl+1] = link->index[cg_gl];
 -                for (int a = cgs.index[cg]; a < cgs.index[cg + 1]; a++)
 +                int cg_gl              = cg_offset + a;
 +                link->index[cg_gl + 1] = link->index[cg_gl];
 +                int i                  = ril.index[a];
 +                while (i < ril.index[a + 1])
                  {
 -                    int i = ril.index[a];
 -                    while (i < ril.index[a+1])
 +                    int ftype = ril.il[i++];
 +                    int nral  = NRAL(ftype);
 +                    /* Skip the ifunc index */
 +                    i++;
 +                    for (int j = 0; j < nral; j++)
                      {
 -                        int ftype = ril.il[i++];
 -                        int nral  = NRAL(ftype);
 -                        /* Skip the ifunc index */
 -                        i++;
 -                        for (int j = 0; j < nral; j++)
 +                        int aj = ril.il[i + j];
 +                        if (aj != a)
                          {
 -                            int aj = ril.il[i + j];
 -                            if (a2c[aj] != cg)
 -                            {
 -                                check_link(link, cg_gl, cg_offset+a2c[aj]);
 -                            }
 -                        }
 -                        i += nral_rt(ftype);
 -                    }
 -                    if (bExclRequired)
 -                    {
 -                        /* Exclusions always go both ways */
 -                        for (int j = excls.index[a]; j < excls.index[a + 1]; j++)
 -                        {
 -                            int aj = excls.a[j];
 -                            if (a2c[aj] != cg)
 -                            {
 -                                check_link(link, cg_gl, cg_offset+a2c[aj]);
 -                            }
 +                            check_link(link, cg_gl, cg_offset + aj);
                          }
                      }
 +                    i += nral_rt(ftype);
 +                }
  
 -                    if (mtop->bIntermolecularInteractions)
 +                if (mtop->bIntermolecularInteractions)
 +                {
-                     int i = ril_intermol.index[a];
-                     while (i < ril_intermol.index[a + 1])
++                    int i = ril_intermol.index[cg_gl];
++                    while (i < ril_intermol.index[cg_gl + 1])
                      {
 -                        int i = ril_intermol.index[cg_gl];
 -                        while (i < ril_intermol.index[cg_gl + 1])
 +                        int ftype = ril_intermol.il[i++];
 +                        int nral  = NRAL(ftype);
 +                        /* Skip the ifunc index */
 +                        i++;
 +                        for (int j = 0; j < nral; j++)
                          {
 -                            int ftype = ril_intermol.il[i++];
 -                            int nral  = NRAL(ftype);
 -                            /* Skip the ifunc index */
 -                            i++;
 -                            for (int j = 0; j < nral; j++)
 -                            {
 -                                /* Here we assume we have no charge groups;
 -                                 * this has been checked above.
 -                                 */
 -                                int aj = ril_intermol.il[i + j];
 -                                check_link(link, cg_gl, aj);
 -                            }
 -                            i += nral_rt(ftype);
 +                            /* Here we assume we have no charge groups;
 +                             * this has been checked above.
 +                             */
 +                            int aj = ril_intermol.il[i + j];
 +                            check_link(link, cg_gl, aj);
                          }
 +                        i += nral_rt(ftype);
                      }
                  }
 -                if (link->index[cg_gl+1] - link->index[cg_gl] > 0)
 +                if (link->index[cg_gl + 1] - link->index[cg_gl] > 0)
                  {
 -                    SET_CGINFO_BOND_INTER(cgi_mb->cginfo[cg]);
 +                    SET_CGINFO_BOND_INTER(cgi_mb->cginfo[a]);
                      ncgi++;
                  }
              }
index 1ad96c29baa5b6e8680330207b2313977a8053cd,fcfb82e57529dd15f194a1e378f1668b3a7319bc..6f3756d30a50313c3d75268f1188a95d4761a899
@@@ -442,20 -431,23 +442,20 @@@ static const char* get_hconf_format(boo
      {
          return "%8.3f%8.3f%8.3f\n";
      }
 -
  }
  
 -static void write_hconf_box(FILE *out, const matrix box)
 +static void write_hconf_box(FILEout, const matrix box)
  {
 -    if ((box[XX][YY] != 0.0f) || (box[XX][ZZ] != 0.0f) || (box[YY][XX] != 0.0f) || (box[YY][ZZ] != 0.0f) ||
 -        (box[ZZ][XX] != 0.0f) || (box[ZZ][YY] != 0.0f))
 +    if ((box[XX][YY] != 0.0F) || (box[XX][ZZ] != 0.0F) || (box[YY][XX] != 0.0F)
 +        || (box[YY][ZZ] != 0.0F) || (box[ZZ][XX] != 0.0F) || (box[ZZ][YY] != 0.0F))
      {
-         fprintf(out, "%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n", box[XX][XX],
 -        fprintf(out, "%10.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f\n",
 -                box[XX][XX], box[YY][YY], box[ZZ][ZZ],
 -                box[XX][YY], box[XX][ZZ], box[YY][XX],
 -                box[YY][ZZ], box[ZZ][XX], box[ZZ][YY]);
++        fprintf(out, "%10.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f\n", box[XX][XX],
 +                box[YY][YY], box[ZZ][ZZ], box[XX][YY], box[XX][ZZ], box[YY][XX], box[YY][ZZ],
 +                box[ZZ][XX], box[ZZ][YY]);
      }
      else
      {
-         fprintf(out, "%10.5f%10.5f%10.5f\n", box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
 -        fprintf(out, "%10.5f %9.5f %9.5f\n",
 -                box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
++        fprintf(out, "%10.5f %9.5f %9.5f\n", box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
      }
  }