/*
- * This source code is part of
+ * This file is part of the GROMACS molecular simulation package.
*
- * G R O M A C S
+ * Copyright (c) 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.
*
- * GROningen MAchine for Chemical Simulations
- *
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2008, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
*
- * And Hey:
- * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
*/
+#include "gmxpre.h"
+
+#include "config.h"
+
#include <algorithm>
-#include "statutil.h"
-#include "typedefs.h"
-#include "smalloc.h"
-#include "vec.h"
-#include "copyrite.h"
-#include "tpxio.h"
-#include "string2.h"
-#include "readinp.h"
-#include "calcgrid.h"
-#include "checkpoint.h"
-#include "gmx_ana.h"
-#include "gmx_random.h"
-#include "physics.h"
-#include "mdatoms.h"
-#include "coulomb.h"
-#include "mtop_util.h"
-#include "network.h"
-#include "main.h"
-#include "macros.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/calcgrid.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/coulomb.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/random/random.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
/* We use the same defines as in mvdata.c here */
#define block_bc(cr, d) gmx_bcast( sizeof(d), &(d), (cr))
typedef struct
{
- gmx_large_int_t orig_sim_steps; /* Number of steps to be done in the real simulation */
+ gmx_int64_t orig_sim_steps; /* Number of steps to be done in the real simulation */
int n_entries; /* Number of entries in arrays */
real volume; /* The volume of the box */
matrix recipbox; /* The reciprocal box */
/* Estimate the reciprocal space part error of the SPME Ewald sum. */
static real estimate_reciprocal(
- t_inputinfo *info,
- rvec x[], /* array of particles */
- real q[], /* array of charges */
- int nr, /* number of charges = size of the charge array */
+ t_inputinfo *info,
+ rvec x[], /* array of particles */
+ real q[], /* array of charges */
+ int nr, /* number of charges = size of the charge array */
FILE gmx_unused *fp_out,
- gmx_bool bVerbose,
- unsigned int seed, /* The seed for the random number generator */
- int *nsamples, /* Return the number of samples used if Monte Carlo
- * algorithm is used for self energy error estimate */
- t_commrec *cr)
+ gmx_bool bVerbose,
+ unsigned int seed, /* The seed for the random number generator */
+ int *nsamples, /* Return the number of samples used if Monte Carlo
+ * algorithm is used for self energy error estimate */
+ t_commrec *cr)
{
real e_rec = 0; /* reciprocal error estimate */
real e_rec1 = 0; /* Error estimate term 1*/
xtot, xtot == 1 ? "" : "s");
if (PAR(cr))
{
- fprintf(stdout, " (%d sample%s per node)", x_per_core, x_per_core == 1 ? "" : "s");
+ fprintf(stdout, " (%d sample%s per rank)", x_per_core, x_per_core == 1 ? "" : "s");
}
fprintf(stdout, ".\n");
}
#ifdef DEBUG
if (PAR(cr))
{
- fprintf(stderr, "Node %3d: nx=[%3d...%3d] e_rec3=%e\n",
+ fprintf(stderr, "Rank %3d: nx=[%3d...%3d] e_rec3=%e\n",
cr->nodeid, startlocal, stoplocal, e_rec3);
}
#endif
}
else
{
- info->ewald_beta[0] = calc_ewaldcoeff(info->rcoulomb[0], info->ewald_rtol[0]);
+ info->ewald_beta[0] = calc_ewaldcoeff_q(info->rcoulomb[0], info->ewald_rtol[0]);
}
/* Check if PME was chosen */
int gmx_pme_error(int argc, char *argv[])
{
const char *desc[] = {
- "[TT]g_pme_error[tt] estimates the error of the electrostatic forces",
+ "[THISMODULE] estimates the error of the electrostatic forces",
"if using the sPME algorithm. The flag [TT]-tune[tt] will determine",
"the splitting parameter such that the error is equally",
"distributed over the real and reciprocal space part.",
static t_filenm fnm[] = {
- { efTPX, "-s", NULL, ffREAD },
+ { efTPR, "-s", NULL, ffREAD },
{ efOUT, "-o", "error", ffWRITE },
- { efTPX, "-so", "tuned", ffOPTWR }
+ { efTPR, "-so", "tuned", ffOPTWR }
};
output_env_t oenv = NULL;
#define NFILE asize(fnm)
- cr = init_par(&argc, &argv);
+ cr = init_commrec();
-#ifdef GMX_LIB_MPI
- MPI_Barrier(MPI_COMM_WORLD);
-#endif
+ PCA_Flags = PCA_NOEXIT_ON_ARGS;
- if (MASTER(cr))
+ if (!parse_common_args(&argc, argv, PCA_Flags,
+ NFILE, fnm, asize(pa), pa, asize(desc), desc,
+ 0, NULL, &oenv))
{
- CopyRight(stderr, argv[0]);
+ return 0;
}
- PCA_Flags = PCA_NOEXIT_ON_ARGS;
- PCA_Flags |= (MASTER(cr) ? 0 : PCA_QUIET);
-
- parse_common_args(&argc, argv, PCA_Flags,
- NFILE, fnm, asize(pa), pa, asize(desc), desc,
- 0, NULL, &oenv);
-
if (!bTUNE)
{
bTUNE = opt2bSet("-so", NFILE, fnm);
fclose(fp);
}
- gmx_finalize_par();
-
return 0;
}