/* The source code in this file should be thread-safe.
Please keep it that way. */
-
+#include "checkpoint.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "names.h"
#include "typedefs.h"
#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
#include "txtdump.h"
#include "gromacs/math/vec.h"
#include "network.h"
-#include "checkpoint.h"
-#include "gromacs/utility/cstringutil.h"
#include "gromacs/fileio/filenm.h"
#include "gromacs/utility/futil.h"
#include "gromacs/fileio/xdr_datatype.h"
#include "gromacs/utility/basenetwork.h"
#include "gromacs/utility/baseversion.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
#include "buildinfo.h"
return 0;
#else
FILE *fp;
- int rc;
fp = fopen(filename, "rb+");
static int do_cpte_real(XDR *xd, int cptp, int ecpt, int sflags,
real *r, FILE *list)
{
- int n;
-
return do_cpte_reals_low(xd, cptp, ecpt, sflags, 1, NULL, &r, list, ecprREAL);
}
bool_t res = 0;
int dtc = xdr_datatype_int;
int *vp, *va = NULL;
- int nf, dt, i;
+ int nf, dt;
nf = n;
res = xdr_int(xd, &nf);
bool_t res = 0;
int dtc = xdr_datatype_double;
double *vp, *va = NULL;
- int nf, dt, i;
+ int nf, dt;
nf = n;
res = xdr_int(xd, &nf);
static int do_cpte_rvecs(XDR *xd, int cptp, int ecpt, int sflags,
int n, rvec **v, FILE *list)
{
- int n3;
-
return do_cpte_reals_low(xd, cptp, ecpt, sflags,
n*DIM, NULL, (real **)v, list, ecprRVEC);
}
matrix v, FILE *list)
{
real *vr;
- real ret;
+ int ret;
vr = (real *)&(v[0][0]);
ret = do_cpte_reals_low(xd, cptp, ecpt, sflags,
int n, real **v, FILE *list)
{
int i;
- real *vr;
- real ret, reti;
+ int ret, reti;
char name[CPTSTRLEN];
ret = 0;
}
for (i = 0; i < n; i++)
{
- vr = v[i];
reti = do_cpte_reals_low(xd, cptp, ecpt, sflags, n, NULL, &(v[i]), NULL, ecprREAL);
if (list && reti == 0)
{
sprintf(name, "%s[%d]", st_names(cptp, ecpt), i);
pr_reals(list, 0, name, v[i], n);
}
- if (reti == 0)
+ if (reti != 0)
{
- ret = 0;
+ ret = reti;
}
}
return ret;
bool_t res = 0;
int magic;
int idum = 0;
- int i;
char *fhost;
if (bRead)
static int do_cpt_EDstate(XDR *xd, gmx_bool bRead,
edsamstate_t *EDstate, FILE *list)
{
- int i, j;
+ int i;
int ret = 0;
char buf[STRLEN];
gmx_file_position_t **p_outputfiles, int *nfiles,
FILE *list, int file_version)
{
- int i, j;
+ int i;
gmx_off_t offset;
gmx_off_t mask = 0xFFFFFFFFL;
int offset_high, offset_low;
char *fntemp; /* the temporary checkpoint file name */
time_t now;
char timebuf[STRLEN];
- int nppnodes, npmenodes, flag_64bit;
+ int nppnodes, npmenodes;
char buf[1024], suffix[5+STEPSTRSIZE], sbuf[STEPSTRSIZE];
gmx_file_position_t *outputfiles;
int noutputfiles;
char *ftime;
- int flags_eks, flags_enh, flags_dfh, i;
+ int flags_eks, flags_enh, flags_dfh;
t_fileio *ret;
if (DOMAINDECOMP(cr))
int file_version;
char *version, *btime, *buser, *bhost, *fprog, *ftime;
int double_prec;
- char filename[STRLEN], buf[STEPSTRSIZE];
- int nppnodes, eIntegrator_f, nppnodes_f, npmenodes_f;
+ char buf[STEPSTRSIZE];
+ int eIntegrator_f, nppnodes_f, npmenodes_f;
ivec dd_nc_f;
int natoms, ngtc, nnhpres, nhchainlength, nlambda, fflags, flags_eks, flags_enh, flags_dfh;
int d;
if (!PAR(cr))
{
- nppnodes = 1;
cr->npmenodes = 0;
}
else if (cr->nnodes == nppnodes_f + npmenodes_f)
{
cr->npmenodes = npmenodes_f;
}
- nppnodes = cr->nnodes - cr->npmenodes;
+ int nppnodes = cr->nnodes - cr->npmenodes;
if (nppnodes == nppnodes_f)
{
for (d = 0; d < DIM; d++)
}
}
}
- else
- {
- /* The number of PP nodes has not been set yet */
- nppnodes = -1;
- }
if (fflags != state->flags)
{
ivec dd_nc;
t_state state;
int flags_eks, flags_enh, flags_dfh;
- int indent;
- int i, j;
int ret;
gmx_file_position_t *outputfiles;
int nfiles;