* And Hey:
* Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
*/
+#include <algorithm>
+
#include "statutil.h"
#include "typedefs.h"
#include "smalloc.h"
};
-typedef struct
-{
- int nPMEnodes; /* number of PME only nodes used in this test */
- int nx, ny, nz; /* DD grid */
- int guessPME; /* if nPMEnodes == -1, this is the guessed number of PME nodes */
- float *Gcycles; /* This can contain more than one value if doing multiple tests */
- float Gcycles_Av;
- float *ns_per_day;
- float ns_per_day_Av;
- float *PME_f_load; /* PME mesh/force load average*/
- float PME_f_load_Av; /* Average average ;) ... */
- char *mdrun_cmd_line; /* Mdrun command line used for this test */
-} t_perf;
-
-
typedef struct
{
gmx_large_int_t orig_sim_steps; /* Number of steps to be done in the real simulation */
real q2_all = 0; /* Sum of squared charges */
int nrq_mol; /* Number of charges in a single molecule */
int nrq_all; /* Total number of charges in the MD system */
- real nrq_all_r; /* No of charges in real format */
real qi, q2_mol;
gmx_moltype_t *molecule;
gmx_molblock_t *molblock;
imol, molblock->natoms_mol, q2_mol, nrq_mol, molblock->nmol, q2_all, nrq_all);
#endif
}
- nrq_all_r = nrq_all;
*q2all = q2_all;
*q2allnr = nrq_all;
{
tmp = m / K + i;
tmp *= 2.0*M_PI;
- nom += pow( tmp, -2.0*n );
+ nom += pow( tmp, -2*n );
}
for (i = SUMORDER; i > 0; i--)
{
tmp = m / K + i;
tmp *= 2.0*M_PI;
- nom += pow( tmp, -2.0*n );
+ nom += pow( tmp, -2*n );
}
for (i = -SUMORDER; i < SUMORDER+1; i++)
{
tmp = m / K + i;
tmp *= 2.0*M_PI;
- nom += i * pow( tmp, -2.0*n );
+ nom += i * pow( tmp, -2*n );
}
for (i = SUMORDER; i > 0; i--)
{
tmp = m / K + i;
tmp *= 2.0*M_PI;
- nom += i * pow( tmp, -2.0*n );
+ nom += i * pow( tmp, -2*n );
}
for (i = -SUMORDER; i < SUMORDER+1; i++)
{
tmp = m / K + i;
tmp *= 2.0*M_PI;
- nom += i * i * pow( tmp, -2.0*n );
+ nom += i * i * pow( tmp, -2*n );
}
for (i = SUMORDER; i > 0; i--)
{
tmp = m / K + i;
tmp *= 2.0*M_PI;
- nom += i * i * pow( tmp, -2.0*n );
+ nom += i * i * pow( tmp, -2*n );
}
for (i = -SUMORDER; i < SUMORDER+1; i++)
{
tmp = -sin(2.0 * M_PI * i * K * rcoord);
tmp1 = 2.0 * M_PI * m / K + 2.0 * M_PI * i;
- tmp2 = pow(tmp1, -1.0*n);
+ tmp2 = pow(tmp1, -n);
nom += tmp * tmp2 * i;
denom += tmp2;
}
{
tmp = -sin(2.0 * M_PI * i * K * rcoord);
tmp1 = 2.0 * M_PI * m / K + 2.0 * M_PI * i;
- tmp2 = pow(tmp1, -1.0*n);
+ tmp2 = pow(tmp1, -n);
nom += tmp * tmp2 * i;
denom += tmp2;
}
tmp = 2.0 * M_PI * m / K;
- tmp1 = pow(tmp, -1.0*n);
+ tmp1 = pow(tmp, -n);
denom += tmp1;
return 2.0 * M_PI * nom / denom * K;
xtot = stopglobal*2+1;
if (PAR(cr))
{
- x_per_core = ceil((real)xtot / (real)cr->nnodes);
+ x_per_core = static_cast<int>(ceil(static_cast<real>(xtot) / cr->nnodes));
startlocal = startglobal + x_per_core*cr->nodeid;
stoplocal = startlocal + x_per_core -1;
if (stoplocal > stopglobal)
/* Here xtot is the number of samples taken for the Monte Carlo calculation
* of the average of term IV of equation 35 in Wang2010. Round up to a
* number of samples that is divisible by the number of nodes */
- x_per_core = ceil(info->fracself * nr / (real)cr->nnodes);
+ x_per_core = static_cast<int>(ceil(info->fracself * nr / cr->nnodes));
xtot = x_per_core * cr->nnodes;
}
else
{
/* In this case we use all nr particle positions */
xtot = nr;
- x_per_core = ceil( (real)xtot / (real)cr->nnodes );
+ x_per_core = static_cast<int>(ceil(static_cast<real>(xtot) / cr->nnodes));
}
startlocal = x_per_core * cr->nodeid;
- stoplocal = min(startlocal + x_per_core, xtot); /* min needed if xtot == nr */
+ stoplocal = std::min(startlocal + x_per_core, xtot); /* min needed if xtot == nr */
if (bFraction)
{
{
for (i = 0; i < xtot; i++)
{
- numbers[i] = floor(gmx_rng_uniform_real(rng) * nr );
+ numbers[i] = static_cast<int>(floor(gmx_rng_uniform_real(rng) * nr));
}
}
/* Broadcast the random number array to the other nodes */
edir = info->e_dir[0];
erec = info->e_rec[0];
derr = edir-erec;
- while (fabs(derr/min(erec, edir)) > 1e-4)
+ while (fabs(derr/std::min(erec, edir)) > 1e-4)
{
beta = info->ewald_beta[0];
/* for libraries we can use the low-level close routines */
ffclose(fp);
seed = time(NULL);
- *cqnum = nhlp*rando(&seed);
+ *cqnum = static_cast<int>(nhlp*rando(&seed));
if (strlen(help[*cqnum]) >= STRLEN)
{
help[*cqnum][STRLEN-1] = '\0';
}
else
{
+ *cqnum = -1;
strncpy(retstring, defstring, retsize);
}
}
void cool_quote(char *retstring, int retsize, int *cqnum)
{
char *tmpstr;
- char *s, *ptr;
+ char *ptr;
int tmpcq, *p;
if (cqnum != NULL)
void gmx_thanx(FILE *fp)
{
char cq[1024];
- int cqnum;
+ int cqnum = -1;
/* protect the audience from suggestive discussions */
cool_quote(cq, 1023, &cqnum);
- if (be_cool())
+ if (cqnum >= 0)
{
fprintf(fp, "\ngcq#%d: %s\n\n", cqnum, cq);
}
};
#define NSTR (int)asize(citedb)
- int j, index;
+ int index;
char *author;
char *title;
#define LINE_WIDTH 79
#include "buildinfo.h"
-extern "C" void gmx_print_version_info_gpu(FILE *fp)
+void gmx_print_version_info_gpu(FILE *fp)
{
int cuda_driver,cuda_runtime;
fprintf(fp, "CUDA compiler: %s\n",CUDA_NVCC_COMPILER_INFO);
#include "gmx_fatal.h"
#include "topdirs.h"
+/* Must correspond to the directive enum in grompp.h */
+static const char *directive_names[d_maxdir+1] = {
+ "defaults",
+ "atomtypes",
+ "bondtypes",
+ "constrainttypes",
+ "pairtypes",
+ "angletypes",
+ "dihedraltypes",
+ "nonbond_params",
+ "implicit_genborn_params",
+ "implicit_surface_params",
+ "cmaptypes",
+ /* All the directives above can not appear after moleculetype */
+ "moleculetype",
+ "atoms",
+ "virtual_sites2",
+ "virtual_sites3",
+ "virtual_sites4",
+ "virtual_sitesn",
+ "bonds",
+ "exclusions",
+ "pairs",
+ "pairs_nb",
+ "angles",
+ "dihedrals",
+ "constraints",
+ "settles",
+ "polarization",
+ "water_polarization",
+ "thole_polarization",
+ "system",
+ "molecules",
+ "position_restraints",
+ "angle_restraints",
+ "angle_restraints_z",
+ "distance_restraints",
+ "orientation_restraints",
+ "dihedral_restraints",
+ "cmap",
+ "invalid"
+};
+
int ifunc_index(directive d, int type)
{
switch (d)
{
if (d < d_maxdir)
{
- return ds[d];
+ return directive_names[d];
}
else
{
- return ds[d_maxdir];
+ return directive_names[d_maxdir];
}
}
gmx_bool is_int(double x);
/* Returns TRUE when x is integer */
+/* Must correspond to strings in topdirs.c */
typedef enum {
d_defaults,
d_atomtypes,
d_none
} directive;
-static const char *ds[d_maxdir+1] = {
- "defaults",
- "atomtypes",
- "bondtypes",
- "constrainttypes",
- "pairtypes",
- "angletypes",
- "dihedraltypes",
- "nonbond_params",
- "implicit_genborn_params",
- "implicit_surface_params",
- "cmaptypes",
- /* All the directives above can not appear after moleculetype */
- "moleculetype",
- "atoms",
- "virtual_sites2",
- "virtual_sites3",
- "virtual_sites4",
- "virtual_sitesn",
- "bonds",
- "exclusions",
- "pairs",
- "pairs_nb",
- "angles",
- "dihedrals",
- "constraints",
- "settles",
- "polarization",
- "water_polarization",
- "thole_polarization",
- "system",
- "molecules",
- "position_restraints",
- "angle_restraints",
- "angle_restraints_z",
- "distance_restraints",
- "orientation_restraints",
- "dihedral_restraints",
- "cmap",
- "invalid"
-};
-
#ifdef __cplusplus
}
#endif
#include "tgroup.h"
#include "filenm.h"
#include "mshift.h"
-#include "force.h"
#include "edsam.h"
#include "mdebin.h"
#include "vcm.h"
#include "mshift.h"
#include "tgroup.h"
#include "network.h"
-#include "force.h"
#include "pull.h"
#include "gmx_random.h"
#include "maths.h"
#include "gmx_fatal.h"
#include "vec.h"
#include "txtdump.h"
+#include "force.h"
#include "mdrun.h"
#include "partdec.h"
#include "mdatoms.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2012, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
* David van der Spoel, Berk Hess, Erik Lindahl, and including many
* others, as listed in the AUTHORS file in the top-level source
* directory and at http://www.gromacs.org.
#ifndef GMX_UTILITY_GITVERSION_H
#define GMX_UTILITY_GITVERSION_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
extern const char _gmx_ver_string[];
extern const char _gmx_full_git_hash[];
extern const char _gmx_central_base_hash[];
+#ifdef __cplusplus
+}
+#endif
+
#endif
# List of programs with single corresponding *.c source file,
# used to create build rules automatically.
#
-set(NGMX_PROGRAMS
+set(NGMX_PROGRAMS
ngmx g_xrama)
foreach(PROG ${NGMX_PROGRAMS})
- add_executable(${PROG} ${PROG}.c ${NGMX_COMMON_SOURCE})
+ add_executable(${PROG} ${PROG}.cpp ${NGMX_COMMON_SOURCE})
target_link_libraries(${PROG} libgromacs ${GMX_EXTRA_LIBRARIES})
gmx_add_man_page(${PROG})
set_target_properties(${PROG} PROPERTIES OUTPUT_NAME "${PROG}${GMX_BINARY_SUFFIX}")
-endforeach(PROG)
+endforeach(PROG)
install(TARGETS ${NGMX_PROGRAMS}
COMPONENT ngmx
output_env_t oenv;
t_x11 *x11;
- t_topology *ramatop;
t_app *app;
t_filenm fnm[] = {
{ efTRX, "-f", NULL, ffREAD },
XSetForeground(x11->disp, x11->gc, x11->fg);
app = init_app(x11, argc, argv);
- ramatop = init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPX, NFILE, fnm),
- app->xr, 3);
+ init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPX, NFILE, fnm),
+ app->xr, 3);
mk_gly(app);
XMapWindow(x11->disp, app->wd.self);
static void dump_xw(char *dispname, Window w, char *fn)
{
char comm[256];
- int rc;
sprintf(comm, "xwd -id %d -display %s > %s", (int)w, dispname, fn);
printf("Warning-- No calls to system(3) supported on this platform.");
printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
#else
- rc = system(comm);
+ (void)system(comm);
#endif
}
t_gmx *gmx;
XSizeHints hints;
int w0, h0;
- int natom, nre, natom_trx;
+ int natom, natom_trx;
t_topology top;
int ePBC;
matrix box;
+++ /dev/null
-/*
- * This source code is part of
- *
- * G R O M A C S
- *
- * Copyright (c) 2001-2012, The GROMACS Development Team
- *
- * Gromacs is a library for molecular simulation and trajectory analysis,
- * written by Erik Lindahl, David van der Spoel, Berk Hess, and others - for
- * a full list of developers and information, check out http://www.gromacs.org
- *
- * This program 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 of the License, or (at your option) any
- * later version.
- *
- * To help fund GROMACS development, we humbly ask that you cite
- * the papers people have written on it - you can find them on the website.
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-int cmain(int argc, char *argv[]);
-#ifdef __cplusplus
-}
-#endif
-int main(int argc, char *argv[])
-{
- return cmain(argc, argv);
-}
set(MDRUN_SOURCES
do_gct.c gctio.c genalg.c ionize.c
- md.c mdrun.c membed.c
- pme_loadbal.c repl_ex.c runner.c xutils.c
- ../main.cpp)
+ md.c mdrun.cpp membed.c
+ pme_loadbal.c repl_ex.c runner.c xutils.c)
if(GMX_OPENMM)
# Even though the OpenMM build has "moved to contrib", many things
* Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
*/
#ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
#endif
-#include "typedefs.h"
-#include "macros.h"
-#include "copyrite.h"
-#include "main.h"
-#include "statutil.h"
-#include "smalloc.h"
-#include "futil.h"
-#include "smalloc.h"
-#include "edsam.h"
-#include "mdrun.h"
-#include "xmdrun.h"
-#include "checkpoint.h"
-#ifdef GMX_THREAD_MPI
-#include "thread_mpi.h"
-#endif
-
-/* afm stuf */
-#include "pull.h"
-
-int cmain(int argc, char *argv[])
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/filenm.h"
+#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/statutil.h"
+#include "gromacs/legacyheaders/typedefs.h"
+
+int main(int argc, char *argv[])
{
const char *desc[] = {
"The [TT]mdrun[tt] program is the main computational chemistry engine",
#define NFILE asize(fnm)
/* Command line options ! */
- gmx_bool bCart = FALSE;
- gmx_bool bPPPME = FALSE;
gmx_bool bPartDec = FALSE;
gmx_bool bDDBondCheck = TRUE;
gmx_bool bDDBondComm = TRUE;
{ "-resethway", FALSE, etBOOL, {&bResetCountersHalfWay},
"HIDDENReset the cycle counters after half the number of steps or halfway [TT]-maxh[tt]" }
};
- gmx_edsam_t ed;
unsigned long Flags, PCA_Flags;
ivec ddxyz;
int dd_node_order;
/* now check the -multi and -multidir option */
if (opt2bSet("-multidir", NFILE, fnm))
{
- int i;
if (nmultisim > 0)
{
gmx_fatal(FARGS, "mdrun -multi and -multidir options are mutually exclusive.");
#include "smalloc.h"
#include "sysstuff.h"
#include "statutil.h"
+#include "force.h"
#include "mdrun.h"
#include "md_logging.h"
#include "md_support.h"
${_outputopt})
set(_c_flags
-I src/gromacs/gmxpreprocess
- -I src/programs/mdrun -I src/programs/pdb2gmx
+ -I src/programs/mdrun
--suppress=variableScope
--suppress=unusedVariable
--suppress=unreadVariable