changed mdrun -nsteps to gmx_large_int_t
authorBerk Hess <hess@kth.se>
Thu, 18 Apr 2013 15:51:20 +0000 (17:51 +0200)
committerBerk Hess <hess@kth.se>
Thu, 18 Apr 2013 15:51:20 +0000 (17:51 +0200)
Fixes #1224

Change-Id: Idc66a0de4b8c6463be2df92ee7b8261a90eb5014

include/mdrun.h
src/kernel/mdrun.c
src/kernel/runner.c

index 1373bfd55eaa0d0bcfb88aba99e2eb16587e8b76..a11fa78ac34145c2bdf2f912be8dc3e1e9e941e7 100644 (file)
@@ -215,7 +215,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
              real rdd, real rconstr, const char *dddlb_opt, real dlb_scale,
              const char *ddcsx, const char *ddcsy, const char *ddcsz,
              const char *nbpu_opt,
-             int nsteps_cmdline, int nstepout, int resetstep,
+             gmx_large_int_t nsteps_cmdline, int nstepout, int resetstep,
              int nmultisim, int repl_ex_nst, int repl_ex_nex,
              int repl_ex_seed, real pforce, real cpt_period, real max_hours,
              const char *deviceOptions, unsigned long Flags);
index 8640ee3e016e9db15d8f19f9928f13708839e974..a5c0e6a6256def6a24b6b0bb702c5eef114b58c5 100644 (file)
@@ -431,7 +431,7 @@ int cmain(int argc, char *argv[])
     int           repl_ex_nex   = 0;
     int           nstepout      = 100;
     int           resetstep     = -1;
-    int           nsteps        = -2; /* the value -2 means that the mdp option will be used */
+    gmx_large_int_t nsteps      = -2; /* the value -2 means that the mdp option will be used */
 
     rvec          realddxyz          = {0, 0, 0};
     const char   *ddno_opt[ddnoNR+1] =
@@ -521,7 +521,7 @@ int cmain(int argc, char *argv[])
           "Keep and number checkpoint files" },
         { "-append",  FALSE, etBOOL, {&bAppendFiles},
           "Append to previous output files when continuing from checkpoint instead of adding the simulation part number to all file names" },
-        { "-nsteps",  FALSE, etINT, {&nsteps},
+        { "-nsteps",  FALSE, etGMX_LARGE_INT, {&nsteps},
           "Run this number of steps, overrides .mdp file option" },
         { "-maxh",   FALSE, etREAL, {&max_hours},
           "Terminate after 0.99 times this time (hours)" },
index 9c0cae32346428955193f00ea9009067094cf727..765be55653ee82ab5793a832b38605b15d323025 100644 (file)
@@ -131,7 +131,7 @@ struct mdrunner_arglist
     const char     *ddcsy;
     const char     *ddcsz;
     const char     *nbpu_opt;
-    int             nsteps_cmdline;
+    gmx_large_int_t nsteps_cmdline;
     int             nstepout;
     int             resetstep;
     int             nmultisim;
@@ -193,7 +193,8 @@ static t_commrec *mdrunner_start_threads(gmx_hw_opt_t *hw_opt,
                                          const char *dddlb_opt, real dlb_scale,
                                          const char *ddcsx, const char *ddcsy, const char *ddcsz,
                                          const char *nbpu_opt,
-                                         int nsteps_cmdline, int nstepout, int resetstep,
+                                         gmx_large_int_t nsteps_cmdline,
+                                         int nstepout, int resetstep,
                                          int nmultisim, int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
                                          real pforce, real cpt_period, real max_hours,
                                          const char *deviceOptions, unsigned long Flags)
@@ -865,10 +866,12 @@ static void check_and_update_hw_opt(gmx_hw_opt_t *hw_opt,
 
 /* Override the value in inputrec with value passed on the command line (if any) */
 static void override_nsteps_cmdline(FILE            *fplog,
-                                    int              nsteps_cmdline,
+                                    gmx_large_int_t  nsteps_cmdline,
                                     t_inputrec      *ir,
                                     const t_commrec *cr)
 {
+    char sbuf[STEPSTRSIZE];
+
     assert(ir);
     assert(cr);
 
@@ -880,13 +883,14 @@ static void override_nsteps_cmdline(FILE            *fplog,
         ir->nsteps = nsteps_cmdline;
         if (EI_DYNAMICS(ir->eI))
         {
-            sprintf(stmp, "Overriding nsteps with value passed on the command line: %d steps, %.3f ps",
-                    nsteps_cmdline, nsteps_cmdline*ir->delta_t);
+            sprintf(stmp, "Overriding nsteps with value passed on the command line: %s steps, %.3f ps",
+                    gmx_step_str(nsteps_cmdline, sbuf),
+                    nsteps_cmdline*ir->delta_t);
         }
         else
         {
-            sprintf(stmp, "Overriding nsteps with value passed on the command line: %d steps",
-                    nsteps_cmdline);
+            sprintf(stmp, "Overriding nsteps with value passed on the command line: %s steps",
+                    gmx_step_str(nsteps_cmdline, sbuf));
         }
 
         md_print_warn(cr, fplog, "%s\n", stmp);
@@ -909,7 +913,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
              const char *dddlb_opt, real dlb_scale,
              const char *ddcsx, const char *ddcsy, const char *ddcsz,
              const char *nbpu_opt,
-             int nsteps_cmdline, int nstepout, int resetstep,
+             gmx_large_int_t nsteps_cmdline, int nstepout, int resetstep,
              int nmultisim, int repl_ex_nst, int repl_ex_nex,
              int repl_ex_seed, real pforce, real cpt_period, real max_hours,
              const char *deviceOptions, unsigned long Flags)