Merge "Merge release-5-0 into master"
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 4 Sep 2014 14:48:14 +0000 (16:48 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 4 Sep 2014 14:48:15 +0000 (16:48 +0200)
1  2 
src/gromacs/CMakeLists.txt
src/gromacs/mdlib/domdec.c
src/gromacs/mdlib/minimize.c
src/gromacs/mdlib/sim_util.c
src/programs/mdrun/md.cpp

index e34f0166f8f7202d9604680be77d73aa4b4f38f2,8be67f17ba7fc4dcbb35ccaf87821c26a562eaaa..0f8cc721cdfc39d40fa18bd5d89b9d74e9e52f62
@@@ -59,11 -59,6 +59,6 @@@ if(GMX_USE_TNG
          include_directories(${TNG_IO_INCLUDE_DIRS})
      endif()
      if(NOT GMX_EXTERNAL_TNG)
-         # TNG wants zlib if it is available
-         find_package(ZLIB QUIET)
-         include(gmxTestZLib)
-         gmx_test_zlib(HAVE_ZLIB)
          include(${CMAKE_SOURCE_DIR}/src/external/tng_io/BuildTNG.cmake)
          tng_get_source_list(TNG_SOURCES TNG_IO_DEFINITIONS)
          list(APPEND LIBGROMACS_SOURCES ${TNG_SOURCES})
@@@ -82,7 -77,6 +77,7 @@@ endif(
  add_subdirectory(gmxlib)
  add_subdirectory(mdlib)
  add_subdirectory(gmxpreprocess)
 +add_subdirectory(bonded)
  add_subdirectory(commandline)
  add_subdirectory(fft)
  add_subdirectory(linearalgebra)
@@@ -147,7 -141,7 +142,7 @@@ list(APPEND LIBGROMACS_SOURCES ${GENERA
  # apply gcc 4.4.x bug workaround
  if(GMX_USE_GCC44_BUG_WORKAROUND)
     include(gmxGCC44O3BugWorkaround)
 -   gmx_apply_gcc44_bug_workaround("gmxlib/bondfree.c")
 +   gmx_apply_gcc44_bug_workaround("bonded/bonded.cpp")
     gmx_apply_gcc44_bug_workaround("mdlib/force.c")
     gmx_apply_gcc44_bug_workaround("mdlib/constr.c")
  endif()
index ff729dc0177ec79163792c682627261b989bd64b,05ecc86c0c3e526e441e96e8c5c1805001839607..08a80c667231018b85667760266a525cc1a58a2b
@@@ -44,7 -44,6 +44,7 @@@
  #include <stdlib.h>
  #include <assert.h>
  
 +#include "gromacs/bonded/bonded.h"
  #include "gromacs/legacyheaders/typedefs.h"
  #include "gromacs/legacyheaders/network.h"
  #include "gromacs/math/vec.h"
@@@ -64,7 -63,7 +64,7 @@@
  #include "gromacs/legacyheaders/gmx_ga2la.h"
  #include "gromacs/legacyheaders/macros.h"
  #include "nbnxn_search.h"
 -#include "gromacs/legacyheaders/bondf.h"
 +#include "gromacs/legacyheaders/bonded-threading.h"
  #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
  #include "gromacs/legacyheaders/gpu_utils.h"
  
@@@ -9754,7 -9753,8 +9754,8 @@@ void dd_partition_system(FIL
      if (vsite != NULL)
      {
          /* Now we have updated mdatoms, we can do the last vsite bookkeeping */
-         split_vsites_over_threads(top_local->idef.il, mdatoms, FALSE, vsite);
+         split_vsites_over_threads(top_local->idef.il, top_local->idef.iparams,
+                                   mdatoms, FALSE, vsite);
      }
  
      if (shellfc)
index 5eb03f0c2360cbb0076277f57f76bff3d5c36566,baba60f8c389adcd27218999faa438d0295844e6..00ebe44ee04fea0610379397400e26edb0ab2774
@@@ -63,7 -63,7 +63,7 @@@
  #include "gromacs/legacyheaders/ns.h"
  #include "gromacs/topology/mtop_util.h"
  #include "gromacs/legacyheaders/pme.h"
 -#include "gromacs/legacyheaders/bondf.h"
 +#include "gromacs/legacyheaders/bonded-threading.h"
  #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
  #include "gromacs/legacyheaders/md_logging.h"
  
@@@ -312,7 -312,8 +312,8 @@@ void init_em(FILE *fplog, const char *t
               gmx_vsite_t *vsite, gmx_constr_t constr,
               int nfile, const t_filenm fnm[],
               gmx_mdoutf_t *outf, t_mdebin **mdebin,
-              int imdport, unsigned long gmx_unused Flags)
+              int imdport, unsigned long gmx_unused Flags,
+              gmx_wallcycle_t wcycle)
  {
      int  i;
      real dvdl_constr;
          *gstat = global_stat_init(ir);
      }
  
-     *outf = init_mdoutf(fplog, nfile, fnm, 0, cr, ir, top_global, NULL);
+     *outf = init_mdoutf(fplog, nfile, fnm, 0, cr, ir, top_global, NULL, wcycle);
  
      snew(*enerd, 1);
      init_enerdata(top_global->groups.grps[egcENER].nr, ir->fepvals->n_lambda,
@@@ -998,7 -999,7 +999,7 @@@ double do_cg(FILE *fplog, t_commrec *cr
      init_em(fplog, CG, cr, inputrec,
              state_global, top_global, s_min, &top, &f, &f_global,
              nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-             nfile, fnm, &outf, &mdebin, imdport, Flags);
+             nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
  
      /* Print to log file */
      print_em_start(fplog, cr, walltime_accounting, wcycle, CG);
@@@ -1670,7 -1671,7 +1671,7 @@@ double do_lbfgs(FILE *fplog, t_commrec 
      init_em(fplog, LBFGS, cr, inputrec,
              state, top_global, &ems, &top, &f, &f_global,
              nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-             nfile, fnm, &outf, &mdebin, imdport, Flags);
+             nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
      /* Do_lbfgs is not completely updated like do_steep and do_cg,
       * so we free some memory again.
       */
@@@ -2414,7 -2415,7 +2415,7 @@@ double do_steep(FILE *fplog, t_commrec 
      init_em(fplog, SD, cr, inputrec,
              state_global, top_global, s_try, &top, &f, &f_global,
              nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-             nfile, fnm, &outf, &mdebin, imdport, Flags);
+             nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
  
      /* Print to log file  */
      print_em_start(fplog, cr, walltime_accounting, wcycle, SD);
@@@ -2666,7 -2667,7 +2667,7 @@@ double do_nm(FILE *fplog, t_commrec *cr
              state_global, top_global, state_work, &top,
              &f, &f_global,
              nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-             nfile, fnm, &outf, NULL, imdport, Flags);
+             nfile, fnm, &outf, NULL, imdport, Flags, wcycle);
  
      natoms = top_global->natoms;
      snew(fneg, natoms);
index c7dc5d22b13752836f093f3e89918f9419cab51e,f71408148cd10583600324b841a378614a7f9998..30de5e9b37bce73f8682210399bd5c5978d24572
@@@ -60,6 -60,7 +60,6 @@@
  #include "gromacs/math/units.h"
  #include "gromacs/legacyheaders/mdatoms.h"
  #include "gromacs/legacyheaders/force.h"
 -#include "gromacs/legacyheaders/bondf.h"
  #include "gromacs/legacyheaders/pme.h"
  #include "gromacs/legacyheaders/disre.h"
  #include "gromacs/legacyheaders/orires.h"
@@@ -79,7 -80,6 +79,7 @@@
  #include "../gmxlib/nonbonded/nb_kernel.h"
  #include "../gmxlib/nonbonded/nb_free_energy.h"
  
 +#include "gromacs/bonded/bonded.h"
  #include "gromacs/legacyheaders/types/commrec.h"
  #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h"
  #include "gromacs/pbcutil/ishift.h"
@@@ -1335,7 -1335,7 +1335,7 @@@ void do_force_cutsVERLET(FILE *fplog, t
      do_force_lowlevel(fr, inputrec, &(top->idef),
                        cr, nrnb, wcycle, mdatoms,
                        x, hist, f, bSepLRF ? fr->f_twin : f, enerd, fcd, top, fr->born,
 -                      &(top->atomtypes), bBornRadii, box,
 +                      bBornRadii, box,
                        inputrec->fepvals, lambda, graph, &(top->excls), fr->mu_tot,
                        flags, &cycles_pme);
  
@@@ -1884,7 -1884,7 +1884,7 @@@ void do_force_cutsGROUP(FILE *fplog, t_
      do_force_lowlevel(fr, inputrec, &(top->idef),
                        cr, nrnb, wcycle, mdatoms,
                        x, hist, f, bSepLRF ? fr->f_twin : f, enerd, fcd, top, fr->born,
 -                      &(top->atomtypes), bBornRadii, box,
 +                      bBornRadii, box,
                        inputrec->fepvals, lambda,
                        graph, &(top->excls), fr->mu_tot,
                        flags,
@@@ -2812,7 -2812,8 +2812,8 @@@ void init_md(FILE *fplog
               int nfile, const t_filenm fnm[],
               gmx_mdoutf_t *outf, t_mdebin **mdebin,
               tensor force_vir, tensor shake_vir, rvec mu_tot,
-              gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags)
+              gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags,
+              gmx_wallcycle_t wcycle)
  {
      int  i, j, n;
      real tmpt, mod;
  
      if (nfile != -1)
      {
-         *outf = init_mdoutf(fplog, nfile, fnm, Flags, cr, ir, mtop, oenv);
+         *outf = init_mdoutf(fplog, nfile, fnm, Flags, cr, ir, mtop, oenv, wcycle);
  
          *mdebin = init_mdebin((Flags & MD_APPENDFILES) ? NULL : mdoutf_get_fp_ene(*outf),
                                mtop, ir, mdoutf_get_fp_dhdl(*outf));
index 8c994cb7c2952490fc0a8529a01b7e7026e54b6b,db1a5affaa364a60fd2902a26809e8de916bf6d8..d738e7521f5bc6f68672abb296df1a5cd8971444
@@@ -74,7 -74,7 +74,7 @@@
  #include "gromacs/legacyheaders/txtdump.h"
  #include "gromacs/utility/cstringutil.h"
  #include "pme_loadbal.h"
 -#include "gromacs/legacyheaders/bondf.h"
 +#include "gromacs/legacyheaders/bonded-threading.h"
  #include "membed.h"
  #include "gromacs/legacyheaders/types/nlistheuristics.h"
  #include "gromacs/legacyheaders/types/iteratedconstraints.h"
@@@ -291,7 -291,7 +291,7 @@@ double do_md(FILE *fplog, t_commrec *cr
              &(state_global->fep_state), lam0,
              nrnb, top_global, &upd,
              nfile, fnm, &outf, &mdebin,
-             force_vir, shake_vir, mu_tot, &bSimAnn, &vcm, Flags);
+             force_vir, shake_vir, mu_tot, &bSimAnn, &vcm, Flags, wcycle);
  
      clear_mat(total_vir);
      clear_mat(pres);
          do_md_trajectory_writing(fplog, cr, nfile, fnm, step, step_rel, t,
                                   ir, state, state_global, top_global, fr,
                                   outf, mdebin, ekind, f, f_global,
-                                  wcycle, &nchkpt,
+                                  &nchkpt,
                                   bCPT, bRerunMD, bLastStep, (Flags & MD_CONFOUT),
                                   bSumEkinhOld);
          /* Check if IMD step and do IMD communication, if bIMD is TRUE. */
      /* End of main MD loop */
      debug_gmx();
  
+     /* Closing TNG files can include compressing data. Therefore it is good to do that
+      * before stopping the time measurements. */
+     mdoutf_tng_close(outf);
      /* Stop measuring walltime */
      walltime_accounting_end(walltime_accounting);