Allow for "computational electrophysiology" simulations (CompEl)
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_tune_pme.c
index bda2ae89df34a73acb8e0d9f490283720ce4e7c8..121e763e6385dcf175305e22bdbdca97ca3fa979 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,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.
@@ -1750,6 +1750,11 @@ static void check_input(
 /* Returns TRUE when "opt" is needed at launch time */
 static gmx_bool is_launch_file(char *opt, gmx_bool bSet)
 {
+    if (0 == strncmp(opt, "-swap", 5))
+    {
+        return bSet;
+    }
+
     /* Apart from the input .tpr and the output log files we need all options that
      * were set on the command line and that do not start with -b */
     if    (0 == strncmp(opt, "-b", 2) || 0 == strncmp(opt, "-s", 2)
@@ -1925,6 +1930,7 @@ static float inspect_tpr(int nfile, t_filenm fnm[], real *rcoulomb)
     gmx_bool     bTpi;      /* Is test particle insertion requested?          */
     gmx_bool     bFree;     /* Is a free energy simulation requested?         */
     gmx_bool     bNM;       /* Is a normal mode analysis requested?           */
+    gmx_bool     bSwap;     /* Is water/ion position swapping requested?      */
     t_inputrec   ir;
     t_state      state;
     gmx_mtop_t   mtop;
@@ -1935,6 +1941,7 @@ static float inspect_tpr(int nfile, t_filenm fnm[], real *rcoulomb)
     bPull = (epullNO != ir.ePull);
     bFree = (efepNO  != ir.efep );
     bNM   = (eiNM    == ir.eI   );
+    bSwap = (eswapNO != ir.eSwapCoords);
     bTpi  = EI_TPI(ir.eI);
 
     /* Set these output files on the tuning command-line */
@@ -1956,6 +1963,10 @@ static float inspect_tpr(int nfile, t_filenm fnm[], real *rcoulomb)
     {
         setopt("-mtx", nfile, fnm);
     }
+    if (bSwap)
+    {
+        setopt("-swap", nfile, fnm);
+    }
 
     *rcoulomb = ir.rcoulomb;
 
@@ -2120,6 +2131,7 @@ int gmx_tune_pme(int argc, char *argv[])
         { efLOG, "-rt",     "rottorque", ffOPTWR },
         { efMTX, "-mtx",    "nm",       ffOPTWR },
         { efNDX, "-dn",     "dipole",   ffOPTWR },
+        { efXVG, "-swap",   "swapions", ffOPTWR },
         /* Output files that are deleted after each benchmark run */
         { efTRN, "-bo",     "bench",    ffWRITE },
         { efXTC, "-bx",     "bench",    ffWRITE },
@@ -2141,7 +2153,8 @@ int gmx_tune_pme(int argc, char *argv[])
         { efLOG, "-brs",    "benchrots", ffOPTWR },
         { efLOG, "-brt",    "benchrott", ffOPTWR },
         { efMTX, "-bmtx",   "benchn",   ffOPTWR },
-        { efNDX, "-bdn",    "bench",    ffOPTWR }
+        { efNDX, "-bdn",    "bench",    ffOPTWR },
+        { efXVG, "-bswap",  "benchswp", ffOPTWR }
     };
 
     gmx_bool        bThreads     = FALSE;