Merge branch release-2019
[alexxy/gromacs.git] / src / gromacs / mdrun / md.cpp
index a49a15df53a4246970f4f4a00e542f1c9a7cedbe..7da1d2e46bf8176fb3a516ef755c00629ab87d99 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -192,7 +192,6 @@ void gmx::Integrator::do_md()
     real                    saved_conserved_quantity = 0;
     real                    last_ekin                = 0;
     t_extmass               MassQ;
-    int                   **trotter_seq;
     char                    sbuf[STEPSTRSIZE], sbuf2[STEPSTRSIZE];
 
     /* PME load balancing data for GPU kernels */
@@ -535,7 +534,7 @@ void gmx::Integrator::do_md()
 
     /* need to make an initiation call to get the Trotter variables set, as well as other constants for non-trotter
        temperature control */
-    trotter_seq = init_npt_vars(ir, state, &MassQ, bTrotter);
+    auto trotter_seq = init_npt_vars(ir, state, &MassQ, bTrotter);
 
     if (MASTER(cr))
     {
@@ -1526,6 +1525,15 @@ void gmx::Integrator::do_md()
     walltime_accounting_set_nsteps_done(walltime_accounting, step_rel);
 
     destroy_enerdata(enerd);
+
     sfree(enerd);
+
+    global_stat_destroy(gstat);
+
+    /* Clean up topology. top->atomtypes has an allocated pointer if no domain decomposition*/
+    if (!DOMAINDECOMP(cr))
+    {
+        done_atomtypes(&top->atomtypes);
+    }
     sfree(top);
 }