Moved random number generator code to separate dir.
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / grompp.c
index 1b8889355874bc08cce258a1225f5792f9dc9c6d..7d867b4b5f9a2fb0f1432a1e06286ff00a3af842 100644 (file)
 #include "symtab.h"
 #include "names.h"
 #include "grompp-impl.h"
-#include "random.h"
+#include "gromacs/random/random.h"
+#include "gromacs/gmxpreprocess/gen_maxwell_velocities.h"
 #include "vec.h"
 #include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "splitter.h"
-#include "sortwater.h"
+#include "gromacs/gmxana/sortwater.h"
 #include "convparm.h"
 #include "gmx_fatal.h"
 #include "warninp.h"
@@ -601,6 +602,7 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
         real                   *mass;
         gmx_mtop_atomloop_all_t aloop;
         t_atom                 *atom;
+        unsigned int            useed;
 
         snew(mass, state->natoms);
         aloop = gmx_mtop_atomloop_all_init(sys);
@@ -609,12 +611,13 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
             mass[i] = atom->m;
         }
 
+        useed = opts->seed;
         if (opts->seed == -1)
         {
-            opts->seed = make_seed();
-            fprintf(stderr, "Setting gen_seed to %d\n", opts->seed);
+            useed = (int)gmx_rng_make_seed();
+            fprintf(stderr, "Setting gen_seed to %u\n", useed);
         }
-        maxwell_speed(opts->tempi, opts->seed, sys, state->v);
+        maxwell_speed(opts->tempi, useed, sys, state->v);
 
         stop_cm(stdout, state->natoms, mass, state->x, state->v);
         sfree(mass);
@@ -1445,6 +1448,7 @@ int gmx_grompp(int argc, char *argv[])
     gmx_bool           bVerbose = FALSE;
     warninp_t          wi;
     char               warn_buf[STRLEN];
+    unsigned int       useed;
 
     t_filenm           fnm[] = {
         { efMDP, NULL,  NULL,        ffREAD  },
@@ -1509,13 +1513,13 @@ int gmx_grompp(int argc, char *argv[])
 
     if (ir->ld_seed == -1)
     {
-        ir->ld_seed = make_seed();
+        ir->ld_seed = (int)gmx_rng_make_seed();
         fprintf(stderr, "Setting the LD random seed to %d\n", ir->ld_seed);
     }
 
     if (ir->expandedvals->lmc_seed == -1)
     {
-        ir->expandedvals->lmc_seed = make_seed();
+        ir->expandedvals->lmc_seed = (int)gmx_rng_make_seed();
         fprintf(stderr, "Setting the lambda MC random seed to %d\n", ir->expandedvals->lmc_seed);
     }