Remove gmx custom fixed int (e.g. gmx_int64_t) types
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_tune_pme.cpp
index 921345bd8aaa1235eb552996ef4d1df4c8454cef..ac3a4a42ce089a098611aaed732b80a1fd92039c 100644 (file)
@@ -113,8 +113,8 @@ typedef struct
 typedef struct
 {
     int             nr_inputfiles;   /* The number of tpr and mdp input files */
-    gmx_int64_t     orig_sim_steps;  /* Number of steps to be done in the real simulation */
-    gmx_int64_t     orig_init_step;  /* Init step for the real simulation */
+    int64_t         orig_sim_steps;  /* Number of steps to be done in the real simulation */
+    int64_t         orig_init_step;  /* Init step for the real simulation */
     real           *rcoulomb;        /* The coulomb radii [0...nr_inputfiles] */
     real           *rvdw;            /* The vdW radii */
     real           *rlist;           /* Neighbourlist cutoff radius */
@@ -184,7 +184,7 @@ enum {
 };
 
 static int parse_logfile(const char *logfile, const char *errfile,
-                         t_perf *perfdata, int test_nr, int presteps, gmx_int64_t cpt_steps,
+                         t_perf *perfdata, int test_nr, int presteps, int64_t cpt_steps,
                          int nnodes)
 {
     FILE           *fp;
@@ -198,7 +198,7 @@ static int parse_logfile(const char *logfile, const char *errfile,
     float           dum1, dum2, dum3, dum4;
     int             ndum;
     int             npme;
-    gmx_int64_t     resetsteps     = -1;
+    int64_t         resetsteps     = -1;
     gmx_bool        bFoundResetStr = FALSE;
     gmx_bool        bResetChecked  = FALSE;
 
@@ -238,7 +238,7 @@ static int parse_logfile(const char *logfile, const char *errfile,
         {
             if (std::strstr(line, matchstrcr) != nullptr)
             {
-                sprintf(dumstring, "step %s", "%" GMX_SCNd64);
+                sprintf(dumstring, "step %s", "%" SCNd64);
                 sscanf(line, dumstring, &resetsteps);
                 bFoundResetStr = TRUE;
                 if (resetsteps == presteps+cpt_steps)
@@ -247,8 +247,8 @@ static int parse_logfile(const char *logfile, const char *errfile,
                 }
                 else
                 {
-                    sprintf(dumstring, "%" GMX_PRId64, resetsteps);
-                    sprintf(dumstring2, "%" GMX_PRId64, presteps+cpt_steps);
+                    sprintf(dumstring, "%" PRId64, resetsteps);
+                    sprintf(dumstring2, "%" PRId64, presteps+cpt_steps);
                     fprintf(stderr, "WARNING: Time step counters were reset at step %s,\n"
                             "         though they were supposed to be reset at step %s!\n",
                             dumstring, dumstring2);
@@ -817,8 +817,8 @@ static void launch_simulation(
 
 
 static void modify_PMEsettings(
-        gmx_int64_t     simsteps,    /* Set this value as number of time steps */
-        gmx_int64_t     init_step,   /* Set this value as init_step */
+        int64_t         simsteps,    /* Set this value as number of time steps */
+        int64_t         init_step,   /* Set this value as init_step */
         const char     *fn_best_tpr, /* tpr file with the best performance */
         const char     *fn_sim_tpr)  /* name of tpr file to be launched */
 {
@@ -835,7 +835,7 @@ static void modify_PMEsettings(
     ir->init_step = init_step;
 
     /* Write the tpr file which will be launched */
-    sprintf(buf, "Writing optimized simulation file %s with nsteps=%s.\n", fn_sim_tpr, "%" GMX_PRId64);
+    sprintf(buf, "Writing optimized simulation file %s with nsteps=%s.\n", fn_sim_tpr, "%" PRId64);
     fprintf(stdout, buf, ir->nsteps);
     fflush(stdout);
     write_tpx_state(fn_sim_tpr, ir, &state, &mtop);
@@ -854,8 +854,8 @@ static gmx_bool can_scale_rvdw(int vdwtype)
 static void make_benchmark_tprs(
         const char           *fn_sim_tpr,      /* READ : User-provided tpr file                 */
         char                 *fn_bench_tprs[], /* WRITE: Names of benchmark tpr files           */
-        gmx_int64_t           benchsteps,      /* Number of time steps for benchmark runs       */
-        gmx_int64_t           statesteps,      /* Step counter in checkpoint file               */
+        int64_t               benchsteps,      /* Number of time steps for benchmark runs       */
+        int64_t               statesteps,      /* Step counter in checkpoint file               */
         real                  rmin,            /* Minimal Coulomb radius                        */
         real                  rmax,            /* Maximal Coulomb radius                        */
         real                  bScaleRvdw,      /* Scale rvdw along with rcoulomb                */
@@ -877,11 +877,11 @@ static void make_benchmark_tprs(
 
 
     sprintf(buf, "Making benchmark tpr file%s with %s time step%s",
-            *ntprs > 1 ? "s" : "", "%" GMX_PRId64, benchsteps > 1 ? "s" : "");
+            *ntprs > 1 ? "s" : "", "%" PRId64, benchsteps > 1 ? "s" : "");
     fprintf(stdout, buf, benchsteps);
     if (statesteps > 0)
     {
-        sprintf(buf, " (adding %s steps from checkpoint file)", "%" GMX_PRId64);
+        sprintf(buf, " (adding %s steps from checkpoint file)", "%" PRId64);
         fprintf(stdout, buf, statesteps);
         benchsteps += statesteps;
     }
@@ -1079,7 +1079,7 @@ static void make_benchmark_tprs(
         sprintf(buf, "_bench%.2d.tpr", j);
         std::strcat(fn_bench_tprs[j], buf);
         fprintf(stdout, "Writing benchmark tpr %s with nsteps=", fn_bench_tprs[j]);
-        fprintf(stdout, "%" GMX_PRId64, ir->nsteps);
+        fprintf(stdout, "%" PRId64, ir->nsteps);
         if (j > 0)
         {
             fprintf(stdout, ", scaling factor %f\n", fac);
@@ -1392,7 +1392,7 @@ static void do_the_tests(
         const t_filenm *fnm,              /* List of filenames from command line    */
         int             nfile,            /* Number of files specified on the cmdl. */
         int             presteps,         /* DLB equilibration steps, is checked    */
-        gmx_int64_t     cpt_steps,        /* Time step counter in the checkpoint    */
+        int64_t         cpt_steps,        /* Time step counter in the checkpoint    */
         gmx_bool        bCheck,           /* Check whether benchmark mdrun works    */
         const char     *eligible_gpu_ids) /* GPU IDs for
                                            * constructing mdrun command lines */
@@ -1617,7 +1617,7 @@ static void check_input(
         real            maxPMEfraction,
         real            minPMEfraction,
         int             npme_fixed,
-        gmx_int64_t     bench_nsteps,
+        int64_t         bench_nsteps,
         const t_filenm *fnm,
         int             nfile,
         int             sim_part,
@@ -1761,7 +1761,7 @@ static void check_input(
     if (bench_nsteps > 10000 || bench_nsteps < 100)
     {
         fprintf(stderr, "WARNING: steps=");
-        fprintf(stderr, "%" GMX_PRId64, bench_nsteps);
+        fprintf(stderr, "%" PRId64, bench_nsteps);
         fprintf(stderr, ". Are you sure you want to perform so %s steps for each benchmark?\n", (bench_nsteps < 100) ? "few" : "many");
     }
 
@@ -2133,9 +2133,9 @@ int gmx_tune_pme(int argc, char *argv[])
     real            rmin           = 0.0, rmax = 0.0; /* min and max value for rcoulomb if scaling is requested */
     real            rcoulomb       = -1.0;            /* Coulomb radius as set in .tpr file */
     gmx_bool        bScaleRvdw     = TRUE;
-    gmx_int64_t     bench_nsteps   = BENCHSTEPS;
-    gmx_int64_t     new_sim_nsteps = -1;   /* -1 indicates: not set by the user */
-    gmx_int64_t     cpt_steps      = 0;    /* Step counter in .cpt input file   */
+    int64_t         bench_nsteps   = BENCHSTEPS;
+    int64_t         new_sim_nsteps = -1;   /* -1 indicates: not set by the user */
+    int64_t         cpt_steps      = 0;    /* Step counter in .cpt input file   */
     int             presteps       = 1500; /* Do a full cycle reset after presteps steps */
     gmx_bool        bOverwrite     = FALSE, bKeepTPR;
     gmx_bool        bLaunch        = FALSE;
@@ -2471,13 +2471,13 @@ int gmx_tune_pme(int argc, char *argv[])
     fprintf(fp, "The mdrun  command is   : %s\n", cmd_mdrun);
     fprintf(fp, "mdrun args benchmarks   : %s\n", cmd_args_bench);
     fprintf(fp, "Benchmark steps         : ");
-    fprintf(fp, "%" GMX_PRId64, bench_nsteps);
+    fprintf(fp, "%" PRId64, bench_nsteps);
     fprintf(fp, "\n");
     fprintf(fp, "dlb equilibration steps : %d\n", presteps);
     if (sim_part > 1)
     {
         fprintf(fp, "Checkpoint time step    : ");
-        fprintf(fp, "%" GMX_PRId64, cpt_steps);
+        fprintf(fp, "%" PRId64, cpt_steps);
         fprintf(fp, "\n");
     }
     fprintf(fp, "mdrun args at launchtime: %s\n", cmd_args_launch);
@@ -2486,10 +2486,10 @@ int gmx_tune_pme(int argc, char *argv[])
     {
         bOverwrite = TRUE;
         fprintf(stderr, "Note: Simulation input file %s will have ", opt2fn("-so", NFILE, fnm));
-        fprintf(stderr, "%" GMX_PRId64, new_sim_nsteps+cpt_steps);
+        fprintf(stderr, "%" PRId64, new_sim_nsteps+cpt_steps);
         fprintf(stderr, " steps.\n");
         fprintf(fp, "Simulation steps        : ");
-        fprintf(fp, "%" GMX_PRId64, new_sim_nsteps);
+        fprintf(fp, "%" PRId64, new_sim_nsteps);
         fprintf(fp, "\n");
     }
     if (repeats > 1)