Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / mdlib / init.c
index a769362b1f467c0f868bc1192a656e69e1e19761..6b44531834f143945dda4ed1544fd67d3cda085f 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) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
  * 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 <stdio.h>
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/fileio/tpxio.h"
-#include "smalloc.h"
-#include "vec.h"
-#include "main.h"
-#include "mvdata.h"
-#include "gmx_fatal.h"
-#include "symtab.h"
-#include "txtdump.h"
-#include "mdatoms.h"
-#include "mdrun.h"
-#include "names.h"
-#include "calcgrid.h"
-#include "gmx_random.h"
-#include "update.h"
-#include "mdebin.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/mvdata.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/mdebin.h"
 
 #define BUFSIZE 256
 
 #define NOT_FINISHED(l1, l2) \
     printf("not finished yet: lines %d .. %d in %s\n", l1, l2, __FILE__)
 
-void set_state_entries(t_state *state, const t_inputrec *ir, int nnodes)
+void set_state_entries(t_state *state, const t_inputrec *ir)
 {
     int nnhpres;
 
@@ -109,31 +103,6 @@ void set_state_entries(t_state *state, const t_inputrec *ir, int nnodes)
             snew(state->cg_p, state->nalloc);
         }
     }
-    if (EI_SD(ir->eI) || ir->eI == eiBD || ir->etc == etcVRESCALE || ETC_ANDERSEN(ir->etc))
-    {
-        state->nrng  = gmx_rng_n();
-        state->nrngi = 1;
-        if (EI_SD(ir->eI) || ir->eI == eiBD || ETC_ANDERSEN(ir->etc))
-        {
-            /* This will be correct later with DD */
-            state->nrng  *= nnodes;
-            state->nrngi *= nnodes;
-        }
-        state->flags |= ((1<<estLD_RNG) | (1<<estLD_RNGI));
-        snew(state->ld_rng, state->nrng);
-        snew(state->ld_rngi, state->nrngi);
-    }
-    else
-    {
-        state->nrng = 0;
-    }
-
-    if (ir->bExpanded)
-    {
-        state->nmcrng  = gmx_rng_n();
-        snew(state->mc_rng, state->nmcrng);
-        snew(state->mc_rngi, 1);
-    }
 
     state->nnhpres = 0;
     if (ir->ePBC != epbcNONE)
@@ -182,6 +151,7 @@ void set_state_entries(t_state *state, const t_inputrec *ir, int nnodes)
 
     init_energyhistory(&state->enerhist);
     init_df_history(&state->dfhist, ir->fepvals->n_lambda);
+    state->swapstate.eSwapCoords = ir->eSwapCoords;
 }
 
 
@@ -189,10 +159,4 @@ void init_parallel(t_commrec *cr, t_inputrec *inputrec,
                    gmx_mtop_t *mtop)
 {
     bcast_ir_mtop(cr, inputrec, mtop);
-
-    if (inputrec->eI == eiBD || EI_SD(inputrec->eI) || ETC_ANDERSEN(inputrec->etc))
-    {
-        /* Make sure the random seeds are different on each node */
-        inputrec->ld_seed += cr->nodeid;
-    }
 }