From 95733b9ff8d8e3d31f5c460e7a08628c2d75b346 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Sun, 8 Dec 2013 16:08:49 -0500 Subject: [PATCH] Replace gmx_large_int_t with gmx_int64_t Most changes are only the rename: gmx_large_int_t -> gmx_int64_t gmx_large_int_fmt -> GMX_PRId64 (or GMX_SCNd64) gmx_large_int_pfmt -> "%"GMX_PRId64 (with space for cpp) SIZEOF_GMX_LARGE_INT -> 8 GMX_LARGE_INT_MAX -> GMX_INT64_MAX GMX_MPI_LARGE_INT -> MPI_INT64_T str_to_large_int_t -> str_to_int64_t get_egmx_large_int -> get_eint64 Exceptions: simple.h: Adding of new type xdrd.c: Remove code for SIZEOF_GMX_LARGE_INT!=8 thread_mpi: Add MPI_INT64_T type scanner.*: Insert #include for simple.h to fix macro issues Change-Id: I99abbec0ecafb2580ddba89677a110c137e9abd6 --- admin/installguide/installguide.tex | 6 +- src/gromacs/commandline/pargs.cpp | 4 +- src/gromacs/commandline/pargs.h | 2 +- src/gromacs/commandline/wman.cpp | 2 +- src/gromacs/fileio/enxio.h | 6 +- src/gromacs/fileio/futil.h | 5 +- src/gromacs/fileio/gmxfio.h | 12 +-- src/gromacs/fileio/gmxfio_asc.c | 10 +- src/gromacs/fileio/gmxfio_bin.c | 4 +- src/gromacs/fileio/gmxfio_rw.c | 12 +-- src/gromacs/fileio/gmxfio_xdr.c | 9 +- src/gromacs/fileio/trajectory_writing.c | 4 +- src/gromacs/fileio/trajectory_writing.h | 6 +- .../fileio/trajectory_writing_low_level.c | 2 +- src/gromacs/fileio/xdrd.c | 37 ++----- src/gromacs/fileio/xdrf.h | 6 +- src/gromacs/gmxana/gmx_bar.c | 30 +++--- src/gromacs/gmxana/gmx_cluster.c | 10 +- src/gromacs/gmxana/gmx_covar.c | 4 +- src/gromacs/gmxana/gmx_eneconv.c | 24 ++--- src/gromacs/gmxana/gmx_energy.c | 24 ++--- src/gromacs/gmxana/gmx_genion.c | 2 +- src/gromacs/gmxana/gmx_pme_error.cpp | 2 +- src/gromacs/gmxana/gmx_sham.c | 18 ++-- src/gromacs/gmxana/gmx_tune_pme.c | 50 +++++----- src/gromacs/gmxana/nsfactor.c | 6 +- src/gromacs/gmxlib/bondfree.c | 14 +-- src/gromacs/gmxlib/checkpoint.c | 28 +++--- src/gromacs/gmxlib/main.cpp | 6 +- src/gromacs/gmxlib/maths.c | 12 +-- src/gromacs/gmxlib/network.c | 26 ++--- src/gromacs/gmxlib/nrnb.c | 2 +- src/gromacs/gmxlib/readinp.c | 12 +-- src/gromacs/gmxlib/smalloc.c | 20 ++-- src/gromacs/gmxlib/string2.c | 6 +- src/gromacs/gmxlib/thread_mpi/type.c | 12 ++- src/gromacs/gmxlib/txtdump.c | 2 +- src/gromacs/gmxlib/typedefs.c | 36 +++---- src/gromacs/legacyheaders/bondf.h | 2 +- src/gromacs/legacyheaders/checkpoint.h | 6 +- src/gromacs/legacyheaders/constr.h | 4 +- src/gromacs/legacyheaders/domdec.h | 4 +- src/gromacs/legacyheaders/ebin.h | 8 +- src/gromacs/legacyheaders/edsam.h | 4 +- src/gromacs/legacyheaders/force.h | 4 +- src/gromacs/legacyheaders/main.h | 2 +- src/gromacs/legacyheaders/maths.h | 10 +- src/gromacs/legacyheaders/md_support.h | 6 +- src/gromacs/legacyheaders/mdebin.h | 4 +- src/gromacs/legacyheaders/mdrun.h | 8 +- src/gromacs/legacyheaders/network.h | 4 +- src/gromacs/legacyheaders/nrnb.h | 2 +- src/gromacs/legacyheaders/pme.h | 6 +- src/gromacs/legacyheaders/pull.h | 2 +- src/gromacs/legacyheaders/pull_rotation.h | 4 +- src/gromacs/legacyheaders/readinp.h | 8 +- src/gromacs/legacyheaders/shellfc.h | 2 +- src/gromacs/legacyheaders/sim_util.h | 6 +- src/gromacs/legacyheaders/string2.h | 4 +- .../legacyheaders/thread_mpi/mpi_bindings.h | 2 +- src/gromacs/legacyheaders/thread_mpi/tmpi.h | 3 + src/gromacs/legacyheaders/typedefs.h | 10 +- src/gromacs/legacyheaders/types/commrec.h | 4 +- src/gromacs/legacyheaders/types/inputrec.h | 4 +- .../legacyheaders/types/nlistheuristics.h | 14 +-- src/gromacs/legacyheaders/types/simple.h | 99 +++++++++---------- src/gromacs/legacyheaders/types/state.h | 8 +- src/gromacs/legacyheaders/update.h | 20 ++-- src/gromacs/mdlib/clincs.c | 2 +- src/gromacs/mdlib/constr.c | 6 +- src/gromacs/mdlib/coupling.c | 8 +- src/gromacs/mdlib/domdec.c | 40 ++++---- src/gromacs/mdlib/domdec_setup.c | 2 +- src/gromacs/mdlib/edsam.c | 12 +-- src/gromacs/mdlib/expanded.c | 14 +-- src/gromacs/mdlib/force.c | 2 +- src/gromacs/mdlib/md_support.c | 21 ++-- src/gromacs/mdlib/mdebin.c | 4 +- src/gromacs/mdlib/mdebin_bar.c | 2 +- src/gromacs/mdlib/mdebin_bar.h | 8 +- src/gromacs/mdlib/minimize.c | 10 +- src/gromacs/mdlib/nlistheuristics.c | 10 +- src/gromacs/mdlib/pme.c | 4 +- src/gromacs/mdlib/pme_pp.c | 10 +- src/gromacs/mdlib/pull.c | 36 +++---- src/gromacs/mdlib/pull_rotation.c | 34 +++---- src/gromacs/mdlib/shellfc.c | 6 +- src/gromacs/mdlib/sim_util.c | 16 +-- src/gromacs/mdlib/stat.c | 3 +- src/gromacs/mdlib/update.c | 20 ++-- src/gromacs/selection/scanner.cpp | 84 +++++++++------- src/gromacs/selection/scanner.l | 12 ++- src/gromacs/selection/scanner_flex.h | 13 ++- src/gromacs/timing/wallcycle.c | 6 +- src/gromacs/timing/wallcycle.h | 4 +- src/gromacs/timing/walltime_accounting.c | 4 +- src/gromacs/timing/walltime_accounting.h | 2 +- src/programs/gmx/tpbcmp.c | 6 +- src/programs/gmx/tpbconv.c | 12 +-- src/programs/mdrun/md.c | 12 +-- src/programs/mdrun/mdrun.cpp | 2 +- src/programs/mdrun/pme_loadbal.c | 4 +- src/programs/mdrun/pme_loadbal.h | 2 +- src/programs/mdrun/repl_ex.c | 6 +- src/programs/mdrun/repl_ex.h | 2 +- src/programs/mdrun/runner.c | 84 ++++++++-------- 106 files changed, 627 insertions(+), 635 deletions(-) diff --git a/admin/installguide/installguide.tex b/admin/installguide/installguide.tex index 015a274a11..40a0395dbf 100644 --- a/admin/installguide/installguide.tex +++ b/admin/installguide/installguide.tex @@ -90,12 +90,14 @@ are only going to continue to get more complex. \gromacs{} can be compiled for any distribution of Linux, Mac OS X, Windows (native, Cygwin or MinGW), BlueGene, Cray and many other architectures. Technically, it can be compiled on any platform with -an ANSI C89 compiler, an ISO C++98 compiler, and supporting libraries, +an ANSI C99 compiler, an ISO C++98 compiler, and supporting libraries, such as the GNU C library. However, \gromacs{} also comes with many hardware-specific extensions to provide very high performance on those platforms, and to enable these we have slightly more specific requirements since old compilers do not support new features, or they -can be buggy. +can be buggy. Not all of the C99 standard is required and some C89 +compilers (including Microsoft Visual C) will also be able to compile +Gromacs. \subsection{Compiler} diff --git a/src/gromacs/commandline/pargs.cpp b/src/gromacs/commandline/pargs.cpp index 5e71cd8b05..245ec60790 100644 --- a/src/gromacs/commandline/pargs.cpp +++ b/src/gromacs/commandline/pargs.cpp @@ -100,7 +100,7 @@ static int iscan(int argc, char *argv[], int *i) } /* Same as above, but for large integer values */ -static gmx_large_int_t istepscan(int argc, char *argv[], int *i) +static gmx_int64_t istepscan(int argc, char *argv[], int *i) { const char *const arg = argv[*i]; if (argc <= (*i)+1) @@ -109,7 +109,7 @@ static gmx_large_int_t istepscan(int argc, char *argv[], int *i) } const char *const value = argv[++(*i)]; char *endptr; - gmx_large_int_t var = str_to_large_int_t(value, &endptr); + gmx_int64_t var = str_to_int64_t(value, &endptr); if (*value == '\0' || *endptr != '\0') { usage("an integer", arg); diff --git a/src/gromacs/commandline/pargs.h b/src/gromacs/commandline/pargs.h index c3b8cd859a..b89a347d95 100644 --- a/src/gromacs/commandline/pargs.h +++ b/src/gromacs/commandline/pargs.h @@ -61,7 +61,7 @@ typedef struct { void *v; /* This is a nasty workaround, to be able to use initialized */ int *i; /* arrays */ - gmx_large_int_t *is; + gmx_int64_t *is; real *r; const char **c; /* Must be pointer to string (when type == etSTR) */ /* or null terminated list of enums (when type == etENUM) */ diff --git a/src/gromacs/commandline/wman.cpp b/src/gromacs/commandline/wman.cpp index ffd0e59576..de19f7aa3f 100644 --- a/src/gromacs/commandline/wman.cpp +++ b/src/gromacs/commandline/wman.cpp @@ -205,7 +205,7 @@ static char *pa_val(t_pargs *pa, char buf[], int sz) sprintf(buf, "%-d", *(pa->u.i)); break; case etGMX_LARGE_INT: - sprintf(buf, gmx_large_int_pfmt, *(pa->u.is)); + sprintf(buf, "%" GMX_PRId64, *(pa->u.is)); break; case etTIME: case etREAL: diff --git a/src/gromacs/fileio/enxio.h b/src/gromacs/fileio/enxio.h index 122941a291..922467a0cc 100644 --- a/src/gromacs/fileio/enxio.h +++ b/src/gromacs/fileio/enxio.h @@ -102,7 +102,7 @@ typedef struct float* fval; double* dval; int* ival; - gmx_large_int_t* lval; + gmx_int64_t* lval; unsigned char* cval; char** sval; @@ -130,8 +130,8 @@ typedef struct t_enxblock{ /* The frames that are read/written */ typedef struct { double t; /* Timestamp of this frame */ - gmx_large_int_t step; /* MD step */ - gmx_large_int_t nsteps; /* The number of steps between frames */ + gmx_int64_t step; /* MD step */ + gmx_int64_t nsteps; /* The number of steps between frames */ double dt; /* The MD time step */ int nsum; /* The number of terms for the sums in ener */ int nre; /* Number of energies */ diff --git a/src/gromacs/fileio/futil.h b/src/gromacs/fileio/futil.h index 8e644085a0..0447f9de4d 100644 --- a/src/gromacs/fileio/futil.h +++ b/src/gromacs/fileio/futil.h @@ -81,9 +81,8 @@ typedef off_t gmx_off_t; typedef __int64 gmx_off_t; # define SIZEOF_GMX_OFF_T 8 #else -/* Almost certainly 64 bits, and guaranteed to be available */ -typedef gmx_large_int_t gmx_off_t; -# define SIZEOF_GMX_OFF_T SIZEOF_GMX_LARGE_INT +typedef gmx_int64_t gmx_off_t; +# define SIZEOF_GMX_OFF_T 8 #endif diff --git a/src/gromacs/fileio/gmxfio.h b/src/gromacs/fileio/gmxfio.h index a9ffc11c5d..58cc2651c4 100644 --- a/src/gromacs/fileio/gmxfio.h +++ b/src/gromacs/fileio/gmxfio.h @@ -245,7 +245,7 @@ gmx_bool gmx_fio_reade_double(t_fileio *fio, double *item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_reade_int(t_fileio *fio, int *item, const char *desc, const char *srcfile, int line); -gmx_bool gmx_fio_reade_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, +gmx_bool gmx_fio_reade_gmx_large_int(t_fileio *fio, gmx_int64_t *item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_reade_uchar(t_fileio *fio, unsigned char *item, const char *desc, const char *srcfile, int line); @@ -266,7 +266,7 @@ gmx_bool gmx_fio_writee_double(t_fileio *fio, double item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_writee_int(t_fileio *fio, int item, const char *desc, const char *srcfile, int line); -gmx_bool gmx_fio_writee_gmx_large_int(t_fileio *fio, gmx_large_int_t item, +gmx_bool gmx_fio_writee_gmx_large_int(t_fileio *fio, gmx_int64_t item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_writee_uchar(t_fileio *fio, unsigned char item, const char *desc, const char *srcfile, int line); @@ -290,7 +290,7 @@ gmx_bool gmx_fio_doe_gmx_bool(t_fileio *fio, gmx_bool *item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_doe_int(t_fileio *fio, int *item, const char *desc, const char *srcfile, int line); -gmx_bool gmx_fio_doe_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, +gmx_bool gmx_fio_doe_gmx_large_int(t_fileio *fio, gmx_int64_t *item, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_doe_uchar(t_fileio *fio, unsigned char *item, const char *desc, const char *srcfile, int line); @@ -315,7 +315,7 @@ gmx_bool gmx_fio_nreade_double(t_fileio *fio, double *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_nreade_int(t_fileio *fio, int *item, int n, const char *desc, const char *srcfile, int line); -gmx_bool gmx_fio_nreade_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, int n, +gmx_bool gmx_fio_nreade_gmx_large_int(t_fileio *fio, gmx_int64_t *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_nreade_uchar(t_fileio *fio, unsigned char *item, int n, @@ -338,7 +338,7 @@ gmx_bool gmx_fio_nwritee_double(t_fileio *fio, const double *item, int n, gmx_bool gmx_fio_nwritee_int(t_fileio *fio, const int *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_nwritee_gmx_large_int(t_fileio *fio, - const gmx_large_int_t *item, int n, + const gmx_int64_t *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_nwritee_uchar(t_fileio *fio, const unsigned char *item, int n, @@ -362,7 +362,7 @@ gmx_bool gmx_fio_ndoe_gmx_bool(t_fileio *fio, gmx_bool *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_ndoe_int(t_fileio *fio, int *item, int n, const char *desc, const char *srcfile, int line); -gmx_bool gmx_fio_ndoe_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, int n, +gmx_bool gmx_fio_ndoe_gmx_large_int(t_fileio *fio, gmx_int64_t *item, int n, const char *desc, const char *srcfile, int line); gmx_bool gmx_fio_ndoe_uchar(t_fileio *fio, unsigned char *item, int n, diff --git a/src/gromacs/fileio/gmxfio_asc.c b/src/gromacs/fileio/gmxfio_asc.c index b8563657d1..57bc1b6a80 100644 --- a/src/gromacs/fileio/gmxfio_asc.c +++ b/src/gromacs/fileio/gmxfio_asc.c @@ -171,8 +171,8 @@ static gmx_bool do_ascwrite(t_fileio *fio, const void *item, int nitem, int eio, buf)); break; case eioGMX_LARGE_INT: - sprintf(strbuf, "%s%s%s", "%", gmx_large_int_fmt, "\n"); - res = fprintf(fp, strbuf, *((gmx_large_int_t *) item), + sprintf(strbuf, "%s%s%s", "%", GMX_PRId64, "\n"); + res = fprintf(fp, strbuf, *((gmx_int64_t *) item), gmx_fio_dbgstr(fio, desc, buf)); break; case eioUCHAR: @@ -292,7 +292,7 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio, { FILE *fp = fio->fp; int i, m, res = 0, *iptr, ix; - gmx_large_int_t s; + gmx_int64_t s; double d, x; real *ptr; unsigned char uc, *ucptr; @@ -321,10 +321,10 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio, break; case eioGMX_LARGE_INT: res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), - gmx_large_int_pfmt, &s); + "%"GMX_SCNd64, &s); if (item) { - *((gmx_large_int_t *) item) = s; + *((gmx_int64_t *) item) = s; } break; case eioUCHAR: diff --git a/src/gromacs/fileio/gmxfio_bin.c b/src/gromacs/fileio/gmxfio_bin.c index 821da26aa6..6c2bc2ab5d 100644 --- a/src/gromacs/fileio/gmxfio_bin.c +++ b/src/gromacs/fileio/gmxfio_bin.c @@ -90,7 +90,7 @@ static gmx_bool do_binwrite(t_fileio *fio, const void *item, int nitem, int eio, size = sizeof(int); break; case eioGMX_LARGE_INT: - size = sizeof(gmx_large_int_t); + size = sizeof(gmx_int64_t); break; case eioUCHAR: size = sizeof(unsigned char); @@ -160,7 +160,7 @@ static gmx_bool do_binread(t_fileio *fio, void *item, int nitem, int eio, size = sizeof(int); break; case eioGMX_LARGE_INT: - size = sizeof(gmx_large_int_t); + size = sizeof(gmx_int64_t); break; case eioUCHAR: size = sizeof(unsigned char); diff --git a/src/gromacs/fileio/gmxfio_rw.c b/src/gromacs/fileio/gmxfio_rw.c index 5036fd75ef..bdeed18554 100644 --- a/src/gromacs/fileio/gmxfio_rw.c +++ b/src/gromacs/fileio/gmxfio_rw.c @@ -104,7 +104,7 @@ gmx_bool gmx_fio_reade_int(t_fileio *fio, int *item, return ret; } -gmx_bool gmx_fio_reade_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, +gmx_bool gmx_fio_reade_gmx_large_int(t_fileio *fio, gmx_int64_t *item, const char *desc, const char *srcfile, int line) { gmx_bool ret; @@ -209,7 +209,7 @@ gmx_bool gmx_fio_writee_int(t_fileio *fio, int item, return ret; } -gmx_bool gmx_fio_writee_gmx_large_int(t_fileio *fio, gmx_large_int_t item, +gmx_bool gmx_fio_writee_gmx_large_int(t_fileio *fio, gmx_int64_t item, const char *desc, const char *srcfile, int line) { gmx_bool ret; @@ -364,7 +364,7 @@ gmx_bool gmx_fio_doe_int(t_fileio *fio, int *item, return ret; } -gmx_bool gmx_fio_doe_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, +gmx_bool gmx_fio_doe_gmx_large_int(t_fileio *fio, gmx_int64_t *item, const char *desc, const char *srcfile, int line) { gmx_bool ret; @@ -533,7 +533,7 @@ gmx_bool gmx_fio_nreade_int(t_fileio *fio, int *item, int n, return ret; } -gmx_bool gmx_fio_nreade_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, int n, +gmx_bool gmx_fio_nreade_gmx_large_int(t_fileio *fio, gmx_int64_t *item, int n, const char *desc, const char *srcfile, int line) { gmx_bool ret = TRUE; @@ -678,7 +678,7 @@ gmx_bool gmx_fio_nwritee_int(t_fileio *fio, const int *item, int n, } gmx_bool gmx_fio_nwritee_gmx_large_int(t_fileio *fio, - const gmx_large_int_t *item, int n, + const gmx_int64_t *item, int n, const char *desc, const char *srcfile, int line) { gmx_bool ret = TRUE; @@ -890,7 +890,7 @@ gmx_bool gmx_fio_ndoe_int(t_fileio *fio, int *item, int n, -gmx_bool gmx_fio_ndoe_gmx_large_int(t_fileio *fio, gmx_large_int_t *item, int n, +gmx_bool gmx_fio_ndoe_gmx_large_int(t_fileio *fio, gmx_int64_t *item, int n, const char *desc, const char *srcfile, int line) { gmx_bool ret = TRUE; diff --git a/src/gromacs/fileio/gmxfio_xdr.c b/src/gromacs/fileio/gmxfio_xdr.c index 5d82febed9..11217cb6d7 100644 --- a/src/gromacs/fileio/gmxfio_xdr.c +++ b/src/gromacs/fileio/gmxfio_xdr.c @@ -79,7 +79,7 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio, float fvec[DIM]; double dvec[DIM]; int j, m, *iptr, idum; - gmx_large_int_t sdum; + gmx_int64_t sdum; real *ptr; unsigned short us; double d = 0; @@ -148,17 +148,14 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio, } break; case eioGMX_LARGE_INT: - /* do_xdr will not generate a warning when a 64bit gmx_large_int_t - * value that is out of 32bit range is read into a 32bit gmx_large_int_t. - */ if (item && !fio->bRead) { - sdum = *(gmx_large_int_t *) item; + sdum = *(gmx_int64_t *) item; } res = xdr_gmx_large_int(fio->xdr, &sdum); if (item) { - *(gmx_large_int_t *) item = sdum; + *(gmx_int64_t *) item = sdum; } break; case eioUCHAR: diff --git a/src/gromacs/fileio/trajectory_writing.c b/src/gromacs/fileio/trajectory_writing.c index d204b6cbc5..e109fc75ed 100644 --- a/src/gromacs/fileio/trajectory_writing.c +++ b/src/gromacs/fileio/trajectory_writing.c @@ -53,8 +53,8 @@ do_trajectory_writing(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], - gmx_large_int_t step, - gmx_large_int_t step_rel, + gmx_int64_t step, + gmx_int64_t step_rel, double t, t_inputrec *ir, t_state *state, diff --git a/src/gromacs/fileio/trajectory_writing.h b/src/gromacs/fileio/trajectory_writing.h index 2fa803abe3..53fd96d887 100644 --- a/src/gromacs/fileio/trajectory_writing.h +++ b/src/gromacs/fileio/trajectory_writing.h @@ -51,8 +51,8 @@ do_trajectory_writing(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], - gmx_large_int_t step, - gmx_large_int_t step_rel, + gmx_int64_t step, + gmx_int64_t step_rel, double t, t_inputrec *ir, t_state *state, @@ -80,7 +80,7 @@ void write_traj(FILE *fplog, t_commrec *cr, gmx_mdoutf_t *of, int mdof_flags, gmx_mtop_t *top_global, - gmx_large_int_t step, double t, + gmx_int64_t step, double t, t_state *state_local, t_state *state_global, rvec *f_local, rvec *f_global, int *n_xtc, rvec **x_xtc); diff --git a/src/gromacs/fileio/trajectory_writing_low_level.c b/src/gromacs/fileio/trajectory_writing_low_level.c index 764b961972..0559b9af35 100644 --- a/src/gromacs/fileio/trajectory_writing_low_level.c +++ b/src/gromacs/fileio/trajectory_writing_low_level.c @@ -55,7 +55,7 @@ void write_traj(FILE *fplog, t_commrec *cr, gmx_mdoutf_t *of, int mdof_flags, gmx_mtop_t *top_global, - gmx_large_int_t step, double t, + gmx_int64_t step, double t, t_state *state_local, t_state *state_global, rvec *f_local, rvec *f_global, int *n_xtc, rvec **x_xtc) diff --git a/src/gromacs/fileio/xdrd.c b/src/gromacs/fileio/xdrd.c index 8da1b6af2f..bfe81fd0ae 100644 --- a/src/gromacs/fileio/xdrd.c +++ b/src/gromacs/fileio/xdrd.c @@ -94,49 +94,24 @@ int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision) #endif } -int xdr_gmx_large_int(XDR *xdrs, gmx_large_int_t *i) +int xdr_gmx_large_int(XDR *xdrs, gmx_int64_t *i) { /* This routine stores values compatible with xdr_int64_t */ int imaj, imin; int ret; -#if ((defined SIZEOF_GMX_LARGE_INT) && SIZEOF_GMX_LARGE_INT == 8) - static const gmx_large_int_t two_p32_m1 = 0xFFFFFFFF; - gmx_large_int_t imaj64, imin64; + static const gmx_int64_t two_p32_m1 = 0xFFFFFFFF; + gmx_int64_t imaj64, imin64; imaj64 = ((*i)>>32) & two_p32_m1; imin64 = (*i) & two_p32_m1; imaj = (int)imaj64; imin = (int)imin64; -#else - /* Our code has 4 bytes, but we should make sure that this value - * will be correctly read by 8 byte code. - */ - if (*i >= 0) - { - imaj = 0; - } - else - { - imaj = -1; - } - imin = *i; -#endif - ret = xdr_int(xdrs, &imaj); - ret = xdr_int(xdrs, &imin); + ret = xdr_int(xdrs, &imaj); + ret = xdr_int(xdrs, &imin); -#if ((defined SIZEOF_GMX_LARGE_INT) && SIZEOF_GMX_LARGE_INT == 8) - *i = (((gmx_large_int_t)imaj << 32) | ((gmx_large_int_t)imin & two_p32_m1)); -#else - *i = imin; - - if (warn != NULL && (imaj < -1 || imaj > 0)) - { - fprintf(stderr, "\nWARNING during %s:\n", warn); - fprintf(stderr, "a step value written by code supporting 64bit integers is read by code that only supports 32bit integers, out of range step value has been converted to %d\n\n", *i); - } -#endif + *i = (((gmx_int64_t)imaj << 32) | ((gmx_int64_t)imin & two_p32_m1)); return ret; } diff --git a/src/gromacs/fileio/xdrf.h b/src/gromacs/fileio/xdrf.h index 7e2714c0c7..3a19b42b9d 100644 --- a/src/gromacs/fileio/xdrf.h +++ b/src/gromacs/fileio/xdrf.h @@ -71,10 +71,8 @@ int xdr_real(XDR *xdrs, real *r); int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision); -int xdr_gmx_large_int(XDR *xdrs, gmx_large_int_t *i); -/* Read or write a gmx_large_int_t value. - * 32bit code reading a 64bit gmx_large_int_t value from xdrs could - * lead to values out of int range. +int xdr_gmx_large_int(XDR *xdrs, gmx_int64_t *i); +/* Read or write a gmx_int64_t value. * When warn!=NULL a warning will be written to stderr * when a value does not fit, * the first line is: diff --git a/src/gromacs/gmxana/gmx_bar.c b/src/gromacs/gmxana/gmx_bar.c index 3354fb5600..9ab07bd480 100644 --- a/src/gromacs/gmxana/gmx_bar.c +++ b/src/gromacs/gmxana/gmx_bar.c @@ -107,12 +107,12 @@ typedef struct hist_t unsigned int *bin[2]; /* the (forward + reverse) histogram values */ double dx[2]; /* the histogram spacing. The reverse dx is the negative of the forward dx.*/ - gmx_large_int_t x0[2]; /* the (forward + reverse) histogram start - point(s) as int */ + gmx_int64_t x0[2]; /* the (forward + reverse) histogram start + point(s) as int */ int nbin[2]; /* the (forward+reverse) number of bins */ - gmx_large_int_t sum; /* the total number of counts. Must be - the same for forward + reverse. */ + gmx_int64_t sum; /* the total number of counts. Must be + the same for forward + reverse. */ int nhist; /* number of hist datas (forward or reverse) */ double start_time, delta_time; /* start time, end time of histogram */ @@ -141,7 +141,7 @@ typedef struct samples_t size_t ndu_alloc, nt_alloc; /* pre-allocated sizes */ hist_t *hist_alloc; /* allocated hist */ - gmx_large_int_t ntot; /* total number of samples */ + gmx_int64_t ntot; /* total number of samples */ const char *filename; /* the file name this sample comes from */ } samples_t; @@ -171,8 +171,8 @@ typedef struct sample_coll_t sample_range_t *r; /* the sample ranges */ int nsamples_alloc; /* number of allocated samples */ - gmx_large_int_t ntot; /* total number of samples in the ranges of - this collection */ + gmx_int64_t ntot; /* total number of samples in the ranges of + this collection */ struct sample_coll_t *next, *prev; /* next and previous in the list */ } sample_coll_t; @@ -1420,9 +1420,9 @@ static gmx_bool sample_coll_create_subsample(sample_coll_t *sc, int j; int hist_start, hist_end; - gmx_large_int_t ntot_start; - gmx_large_int_t ntot_end; - gmx_large_int_t ntot_so_far; + gmx_int64_t ntot_start; + gmx_int64_t ntot_end; + gmx_int64_t ntot_so_far; *sc = *sc_orig; /* just copy all fields */ @@ -1439,13 +1439,13 @@ static gmx_bool sample_coll_create_subsample(sample_coll_t *sc, /* now fix start and end fields */ /* the casts avoid possible overflows */ - ntot_start = (gmx_large_int_t)(sc_orig->ntot*(double)i/(double)ni); - ntot_end = (gmx_large_int_t)(sc_orig->ntot*(double)(i+1)/(double)ni); + ntot_start = (gmx_int64_t)(sc_orig->ntot*(double)i/(double)ni); + ntot_end = (gmx_int64_t)(sc_orig->ntot*(double)(i+1)/(double)ni); ntot_so_far = 0; for (j = 0; j < sc->nsamples; j++) { - gmx_large_int_t ntot_add; - gmx_large_int_t new_start, new_end; + gmx_int64_t ntot_add; + gmx_int64_t new_start, new_end; if (sc->r[j].use) { @@ -3131,7 +3131,7 @@ static samples_t *read_edr_hist_block(int *nsamples, t_enxblock *blk, for (i = 0; i < nhist; i++) { int nbin; - gmx_large_int_t sum = 0; + gmx_int64_t sum = 0; for (j = 0; j < s->hist->nbin[i]; j++) { diff --git a/src/gromacs/gmxana/gmx_cluster.c b/src/gromacs/gmxana/gmx_cluster.c index 7e64bb7100..4b58ca8531 100644 --- a/src/gromacs/gmxana/gmx_cluster.c +++ b/src/gromacs/gmxana/gmx_cluster.c @@ -1405,7 +1405,7 @@ int gmx_cluster(int argc, char *argv[]) FILE *fp, *log; int nf, i, i1, i2, j; - gmx_large_int_t nrms = 0; + gmx_int64_t nrms = 0; matrix box; rvec *xtps, *usextps, *x1, **xx = NULL; @@ -1740,7 +1740,7 @@ int gmx_cluster(int argc, char *argv[]) else /* !bReadMat */ { rms = init_mat(nf, method == m_diagonalize); - nrms = ((gmx_large_int_t)nf*((gmx_large_int_t)nf-1))/2; + nrms = ((gmx_int64_t)nf*((gmx_int64_t)nf-1))/2; if (!bRMSdist) { fprintf(stderr, "Computing %dx%d RMS deviation matrix\n", nf, nf); @@ -1761,8 +1761,8 @@ int gmx_cluster(int argc, char *argv[]) rmsd = rmsdev(isize, mass, xx[i2], x1); set_mat_entry(rms, i1, i2, rmsd); } - nrms -= (gmx_large_int_t) (nf-i1-1); - fprintf(stderr, "\r# RMSD calculations left: " gmx_large_int_pfmt " ", nrms); + nrms -= (gmx_int64_t) (nf-i1-1); + fprintf(stderr, "\r# RMSD calculations left: " "%"GMX_PRId64 " ", nrms); } sfree(x1); } @@ -1787,7 +1787,7 @@ int gmx_cluster(int argc, char *argv[]) set_mat_entry(rms, i1, i2, rms_dist(isize, d1, d2)); } nrms -= (nf-i1-1); - fprintf(stderr, "\r# RMSD calculations left: " gmx_large_int_pfmt " ", nrms); + fprintf(stderr, "\r# RMSD calculations left: " "%"GMX_PRId64 " ", nrms); } /* Clean up work arrays */ for (i = 0; (i < isize); i++) diff --git a/src/gromacs/gmxana/gmx_covar.c b/src/gromacs/gmxana/gmx_covar.c index 237b8602ef..503032fc9a 100644 --- a/src/gromacs/gmxana/gmx_covar.c +++ b/src/gromacs/gmxana/gmx_covar.c @@ -132,7 +132,7 @@ int gmx_covar(int argc, char *argv[]) real min, max, *axis; int ntopatoms, step; int natoms, nat, count, nframes0, nframes, nlevels; - gmx_large_int_t ndim, i, j, k, l; + gmx_int64_t ndim, i, j, k, l; int WriteXref; const char *fitfile, *trxfile, *ndxfile; const char *eigvalfile, *eigvecfile, *averfile, *logfile; @@ -266,7 +266,7 @@ int gmx_covar(int argc, char *argv[]) snew(x, natoms); snew(xav, natoms); ndim = natoms*DIM; - if (sqrt(GMX_LARGE_INT_MAX) < ndim) + if (sqrt(GMX_INT64_MAX) < ndim) { gmx_fatal(FARGS, "Number of degrees of freedoms to large for matrix.\n"); } diff --git a/src/gromacs/gmxana/gmx_eneconv.c b/src/gromacs/gmxana/gmx_eneconv.c index 4946eb0a84..b265992d61 100644 --- a/src/gromacs/gmxana/gmx_eneconv.c +++ b/src/gromacs/gmxana/gmx_eneconv.c @@ -347,8 +347,8 @@ static void copy_ee(t_energy *src, t_energy *dst, int nre) } } -static void update_ee(t_energy *lastee, gmx_large_int_t laststep, - t_energy *startee, gmx_large_int_t startstep, +static void update_ee(t_energy *lastee, gmx_int64_t laststep, + t_energy *startee, gmx_int64_t startstep, t_energy *ee, int step, t_energy *outee, int nre) { @@ -383,8 +383,8 @@ static void update_ee(t_energy *lastee, gmx_large_int_t laststep, */ if (startstep > 0) { - gmx_large_int_t q = laststep+step; - gmx_large_int_t p = startstep+1; + gmx_int64_t q = laststep+step; + gmx_int64_t p = startstep+1; prestart_esum = startee[i].esum-startee[i].e; sigmacorr = prestart_esum-(p-1)*startee[i].e; prestart_sigma = startee[i].eav- @@ -407,13 +407,13 @@ static void update_ee(t_energy *lastee, gmx_large_int_t laststep, } static void update_ee_sum(int nre, - gmx_large_int_t *ee_sum_step, - gmx_large_int_t *ee_sum_nsteps, - gmx_large_int_t *ee_sum_nsum, + gmx_int64_t *ee_sum_step, + gmx_int64_t *ee_sum_nsteps, + gmx_int64_t *ee_sum_nsum, t_energy *ee_sum, t_enxframe *fr, int out_step) { - gmx_large_int_t nsteps, nsum, fr_nsum; + gmx_int64_t nsteps, nsum, fr_nsum; int i; nsteps = *ee_sum_nsteps; @@ -517,9 +517,9 @@ int gmx_eneconv(int argc, char *argv[]) gmx_enxnm_t *enm = NULL; #endif t_enxframe *fr, *fro; - gmx_large_int_t ee_sum_step = 0, ee_sum_nsteps, ee_sum_nsum; + gmx_int64_t ee_sum_step = 0, ee_sum_nsteps, ee_sum_nsum; t_energy *ee_sum; - gmx_large_int_t lastfilestep, laststep, startstep, startstep_file = 0; + gmx_int64_t lastfilestep, laststep, startstep, startstep_file = 0; int noutfr; int nre, nremax, this_nre, nfile, f, i, j, kkk, nset, *set = NULL; double last_t; @@ -725,8 +725,8 @@ int gmx_eneconv(int argc, char *argv[]) } else { - fro->nsum = gmx_large_int_to_int(ee_sum_nsum, - "energy average summation"); + fro->nsum = gmx_int64_to_int(ee_sum_nsum, + "energy average summation"); /* Copy the energy sums */ for (i = 0; i < nre; i++) { diff --git a/src/gromacs/gmxana/gmx_energy.c b/src/gromacs/gmxana/gmx_energy.c index ad81bced5d..6d700e1726 100644 --- a/src/gromacs/gmxana/gmx_energy.c +++ b/src/gromacs/gmxana/gmx_energy.c @@ -79,8 +79,8 @@ typedef struct { } enerdat_t; typedef struct { - gmx_large_int_t nsteps; - gmx_large_int_t npoints; + gmx_int64_t nsteps; + gmx_int64_t npoints; int nframes; int *step; int *steps; @@ -633,7 +633,7 @@ static void einstein_visco(const char *fn, const char *fni, int nsets, } typedef struct { - gmx_large_int_t np; + gmx_int64_t np; double sum; double sav; double sav2; @@ -642,8 +642,8 @@ typedef struct { typedef struct { int b; ee_sum_t sum; - gmx_large_int_t nst; - gmx_large_int_t nst_min; + gmx_int64_t nst; + gmx_int64_t nst_min; } ener_ee_t; static void clear_ee_sum(ee_sum_t *ees) @@ -697,7 +697,7 @@ static void calc_averages(int nset, enerdata_t *edat, int nbmin, int nbmax) { int nb, i, f, nee; double sum, sum2, sump, see2; - gmx_large_int_t steps, np, p, bound_nb; + gmx_int64_t steps, np, p, bound_nb; enerdat_t *ed; exactsum_t *es; gmx_bool bAllZero; @@ -1132,8 +1132,8 @@ static void calc_fluctuation_props(FILE *fp, static void analyse_ener(gmx_bool bCorr, const char *corrfn, gmx_bool bFee, gmx_bool bSum, gmx_bool bFluct, gmx_bool bVisco, const char *visfn, int nmol, - gmx_large_int_t start_step, double start_t, - gmx_large_int_t step, double t, + gmx_int64_t start_step, double start_t, + gmx_int64_t step, double t, double time[], real reftemp, enerdata_t *edat, int nset, int set[], gmx_bool *bIsEner, @@ -1149,7 +1149,7 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn, real xxx, integral, intBulk, Temp = 0, Pres = 0; real sfrac, oldfrac, diffsum, diffav, fstep, pr_aver, pr_stddev, pr_errest; double beta = 0, expE, expEtot, *fee = NULL; - gmx_large_int_t nsteps; + gmx_int64_t nsteps; int nexact, nnotexact; double x1m, x1mk; int i, j, k, nout; @@ -1695,7 +1695,7 @@ static void do_dhdl(t_enxframe *fr, t_inputrec *ir, FILE **fp_dhdl, /* write the data */ if (nblock_hist > 0) { - gmx_large_int_t sum = 0; + gmx_int64_t sum = 0; /* histograms */ for (i = 0; i < fr->nblock; i++) { @@ -1703,7 +1703,7 @@ static void do_dhdl(t_enxframe *fr, t_inputrec *ir, FILE **fp_dhdl, if (blk->id == enxDHHIST) { double foreign_lambda, dx; - gmx_large_int_t x0; + gmx_int64_t x0; int nhist, derivative; /* check the block types etc. */ @@ -1985,7 +1985,7 @@ int gmx_energy(int argc, char *argv[]) int cur = 0; #define NEXT (1-cur) int nre, teller, teller_disre, nfr; - gmx_large_int_t start_step; + gmx_int64_t start_step; int nor = 0, nex = 0, norfr = 0, enx_i = 0; real start_t; real *bounds = NULL, *violaver = NULL, *oobs = NULL, *orient = NULL, *odrms = NULL; diff --git a/src/gromacs/gmxana/gmx_genion.c b/src/gromacs/gmxana/gmx_genion.c index 05dea2dec3..d60ea75c3f 100644 --- a/src/gromacs/gmxana/gmx_genion.c +++ b/src/gromacs/gmxana/gmx_genion.c @@ -67,7 +67,7 @@ static void insert_ion(int nsa, int *nwater, int i, ei, nw; real rmin2; rvec dx; - gmx_large_int_t maxrand; + gmx_int64_t maxrand; ei = -1; nw = *nwater; diff --git a/src/gromacs/gmxana/gmx_pme_error.cpp b/src/gromacs/gmxana/gmx_pme_error.cpp index 5865577c82..27ae29b5e6 100644 --- a/src/gromacs/gmxana/gmx_pme_error.cpp +++ b/src/gromacs/gmxana/gmx_pme_error.cpp @@ -79,7 +79,7 @@ enum { 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 */ diff --git a/src/gromacs/gmxana/gmx_sham.c b/src/gromacs/gmxana/gmx_sham.c index 67a66d2128..53f3082132 100644 --- a/src/gromacs/gmxana/gmx_sham.c +++ b/src/gromacs/gmxana/gmx_sham.c @@ -65,9 +65,9 @@ static int index3(int *ibox, int x, int y, int z) return (ibox[2]*(ibox[1]*x+y)+z); } -static gmx_large_int_t indexn(int ndim, const int *ibox, const int *nxyz) +static gmx_int64_t indexn(int ndim, const int *ibox, const int *nxyz) { - gmx_large_int_t d, dd; + gmx_int64_t d, dd; int k, kk; /* Compute index in 1-D array */ @@ -200,7 +200,7 @@ static void normalize_p_e(int len, double *P, int *nbin, real *E, real pmin) } typedef struct { - gmx_large_int_t index; + gmx_int64_t index; real ener; } t_minimum; @@ -227,7 +227,7 @@ static inline void print_minimum(FILE *fp, int num, const t_minimum *min) { fprintf(fp, - "Minimum %d at index " gmx_large_int_pfmt " energy %10.3f\n", + "Minimum %d at index " "%"GMX_PRId64 " energy %10.3f\n", num, min->index, min->ener); } @@ -1023,7 +1023,7 @@ int gmx_sham(int argc, char *argv[]) double *av, *sig, cum1, cum2, cum3, cum4, db; const char *fn_ge, *fn_ene; output_env_t oenv; - gmx_large_int_t num_grid_points; + gmx_int64_t num_grid_points; t_filenm fnm[] = { { efXVG, "-f", "graph", ffREAD }, @@ -1142,17 +1142,15 @@ int gmx_sham(int argc, char *argv[]) num_grid_points = ibox[0]; for (i = 1; i < nset; i++) { - gmx_large_int_t result; + gmx_int64_t result; if (!check_int_multiply_for_overflow(num_grid_points, ibox[i], &result)) { gmx_fatal(FARGS, - "The number of dimensions and grid points is too large for this tool\n" - "to handle with what it knows about the architecture upon which it\n" - "is running. Use a different machine or consult the GROMACS mailing list."); + "The number of dimensions and grid points is too large for this tool.\n"); } num_grid_points = result; } - /* The number of grid points fits in a gmx_large_int_t. */ + /* The number of grid points fits in a gmx_int64_t. */ do_sham(opt2fn("-dist", NFILE, fnm), opt2fn("-bin", NFILE, fnm), opt2fn("-lp", NFILE, fnm), diff --git a/src/gromacs/gmxana/gmx_tune_pme.c b/src/gromacs/gmxana/gmx_tune_pme.c index fa1cba5516..194bacb1f8 100644 --- a/src/gromacs/gmxana/gmx_tune_pme.c +++ b/src/gromacs/gmxana/gmx_tune_pme.c @@ -96,8 +96,8 @@ typedef struct typedef struct { int nr_inputfiles; /* The number of tpr and mdp input files */ - gmx_large_int_t orig_sim_steps; /* Number of steps to be done in the real simulation */ - gmx_large_int_t orig_init_step; /* Init step for the real simulation */ + 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 */ real *rcoulomb; /* The coulomb radii [0...nr_inputfiles] */ real *rvdw; /* The vdW radii */ real *rlist; /* Neighbourlist cutoff radius */ @@ -187,7 +187,7 @@ enum { }; static int parse_logfile(const char *logfile, const char *errfile, - t_perf *perfdata, int test_nr, int presteps, gmx_large_int_t cpt_steps, + t_perf *perfdata, int test_nr, int presteps, gmx_int64_t cpt_steps, int nnodes) { FILE *fp; @@ -202,7 +202,7 @@ static int parse_logfile(const char *logfile, const char *errfile, float dum1, dum2, dum3, dum4; int ndum; int npme; - gmx_large_int_t resetsteps = -1; + gmx_int64_t resetsteps = -1; gmx_bool bFoundResetStr = FALSE; gmx_bool bResetChecked = FALSE; @@ -242,7 +242,7 @@ static int parse_logfile(const char *logfile, const char *errfile, { if (strstr(line, matchstrcr) != NULL) { - sprintf(dumstring, "step %s", gmx_large_int_pfmt); + sprintf(dumstring, "step %s", "%"GMX_SCNd64); sscanf(line, dumstring, &resetsteps); bFoundResetStr = TRUE; if (resetsteps == presteps+cpt_steps) @@ -251,8 +251,8 @@ static int parse_logfile(const char *logfile, const char *errfile, } else { - sprintf(dumstring, gmx_large_int_pfmt, resetsteps); - sprintf(dumstring2, gmx_large_int_pfmt, presteps+cpt_steps); + sprintf(dumstring, "%"GMX_PRId64, resetsteps); + sprintf(dumstring2, "%"GMX_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); @@ -772,8 +772,8 @@ static void launch_simulation( static void modify_PMEsettings( - gmx_large_int_t simsteps, /* Set this value as number of time steps */ - gmx_large_int_t init_step, /* Set this value as init_step */ + gmx_int64_t simsteps, /* Set this value as number of time steps */ + gmx_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 */ { @@ -790,7 +790,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_large_int_pfmt); + sprintf(buf, "Writing optimized simulation file %s with nsteps=%s.\n", fn_sim_tpr, "%"GMX_PRId64); fprintf(stdout, buf, ir->nsteps); fflush(stdout); write_tpx_state(fn_sim_tpr, ir, &state, &mtop); @@ -806,8 +806,8 @@ static void modify_PMEsettings( 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_large_int_t benchsteps, /* Number of time steps for benchmark runs */ - gmx_large_int_t statesteps, /* Step counter in checkpoint file */ + gmx_int64_t benchsteps, /* Number of time steps for benchmark runs */ + gmx_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 */ @@ -830,11 +830,11 @@ static void make_benchmark_tprs( sprintf(buf, "Making benchmark tpr file%s with %s time step%s", - *ntprs > 1 ? "s" : "", gmx_large_int_pfmt, benchsteps > 1 ? "s" : ""); + *ntprs > 1 ? "s" : "", "%"GMX_PRId64, benchsteps > 1 ? "s" : ""); fprintf(stdout, buf, benchsteps); if (statesteps > 0) { - sprintf(buf, " (adding %s steps from checkpoint file)", gmx_large_int_pfmt); + sprintf(buf, " (adding %s steps from checkpoint file)", "%"GMX_PRId64); fprintf(stdout, buf, statesteps); benchsteps += statesteps; } @@ -1032,7 +1032,7 @@ static void make_benchmark_tprs( sprintf(buf, "_bench%.2d.tpr", j); strcat(fn_bench_tprs[j], buf); fprintf(stdout, "Writing benchmark tpr %s with nsteps=", fn_bench_tprs[j]); - fprintf(stdout, gmx_large_int_pfmt, ir->nsteps); + fprintf(stdout, "%"GMX_PRId64, ir->nsteps); if (j > 0) { fprintf(stdout, ", scaling factor %f\n", fac); @@ -1361,7 +1361,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_large_int_t cpt_steps) /* Time step counter in the checkpoint */ + gmx_int64_t cpt_steps) /* Time step counter in the checkpoint */ { int i, nr, k, ret, count = 0, totaltests; int *nPMEnodes = NULL; @@ -1559,7 +1559,7 @@ static void check_input( real maxPMEfraction, real minPMEfraction, int npme_fixed, - gmx_large_int_t bench_nsteps, + gmx_int64_t bench_nsteps, const t_filenm *fnm, int nfile, int sim_part, @@ -1703,7 +1703,7 @@ static void check_input( if (bench_nsteps > 10000 || bench_nsteps < 100) { fprintf(stderr, "WARNING: steps="); - fprintf(stderr, gmx_large_int_pfmt, bench_nsteps); + fprintf(stderr, "%"GMX_PRId64, bench_nsteps); fprintf(stderr, ". Are you sure you want to perform so %s steps for each benchmark?\n", (bench_nsteps < 100) ? "few" : "many"); } @@ -2057,9 +2057,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_large_int_t bench_nsteps = BENCHSTEPS; - gmx_large_int_t new_sim_nsteps = -1; /* -1 indicates: not set by the user */ - gmx_large_int_t cpt_steps = 0; /* Step counter in .cpt input file */ + 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 */ int presteps = 100; /* Do a full cycle reset after presteps steps */ gmx_bool bOverwrite = FALSE, bKeepTPR; gmx_bool bLaunch = FALSE; @@ -2380,13 +2380,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_large_int_pfmt, bench_nsteps); + fprintf(fp, "%"GMX_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_large_int_pfmt, cpt_steps); + fprintf(fp, "%"GMX_PRId64, cpt_steps); fprintf(fp, "\n"); } fprintf(fp, "mdrun args at launchtime: %s\n", cmd_args_launch); @@ -2395,10 +2395,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_large_int_pfmt, new_sim_nsteps+cpt_steps); + fprintf(stderr, "%"GMX_PRId64, new_sim_nsteps+cpt_steps); fprintf(stderr, " steps.\n"); fprintf(fp, "Simulation steps : "); - fprintf(fp, gmx_large_int_pfmt, new_sim_nsteps); + fprintf(fp, "%"GMX_PRId64, new_sim_nsteps); fprintf(fp, "\n"); } if (repeats > 1) diff --git a/src/gromacs/gmxana/nsfactor.c b/src/gromacs/gmxana/nsfactor.c index 4bd810845c..36a963603c 100644 --- a/src/gromacs/gmxana/nsfactor.c +++ b/src/gromacs/gmxana/nsfactor.c @@ -206,7 +206,7 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram ( int nthreads; gmx_rng_t *trng = NULL; #endif - gmx_large_int_t mc = 0, max; + gmx_int64_t mc = 0, max; gmx_rng_t rng = NULL; /* allocate memory for pr */ @@ -233,11 +233,11 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram ( /* Special case for setting automaticaly number of mc iterations to 1% of total number of direct iterations */ if (mcover == -1) { - max = (gmx_large_int_t)floor(0.5*0.01*isize*(isize-1)); + max = (gmx_int64_t)floor(0.5*0.01*isize*(isize-1)); } else { - max = (gmx_large_int_t)floor(0.5*mcover*isize*(isize-1)); + max = (gmx_int64_t)floor(0.5*mcover*isize*(isize-1)); } rng = gmx_rng_init(seed); #ifdef GMX_OPENMP diff --git a/src/gromacs/gmxlib/bondfree.c b/src/gromacs/gmxlib/bondfree.c index 43776abb70..38c4c90372 100644 --- a/src/gromacs/gmxlib/bondfree.c +++ b/src/gromacs/gmxlib/bondfree.c @@ -4189,10 +4189,10 @@ static real calc_one_bond(FILE *fplog, int thread, pdihs_noener_simd #endif (nbn, idef->il[ftype].iatoms+nb0, - idef->iparams, - (const rvec*)x, f, - pbc, g, lambda[efptFTYPE], md, fcd, - global_atom_index); + idef->iparams, + (const rvec*)x, f, + pbc, g, lambda[efptFTYPE], md, fcd, + global_atom_index); v = 0; } else @@ -4214,7 +4214,7 @@ static real calc_one_bond(FILE *fplog, int thread, { v = do_nonbonded_listed(ftype, nbn, iatoms+nb0, idef->iparams, (const rvec*)x, f, fshift, pbc, g, lambda, dvdl, md, fr, grpp, global_atom_index); - + if (bPrintSepPot) { fprintf(fplog, " %-5s + %-15s #%4d dVdl %12.5e\n", @@ -4245,7 +4245,7 @@ void calc_bonds(FILE *fplog, const gmx_multisim_t *ms, t_fcdata *fcd, int *global_atom_index, t_atomtypes gmx_unused *atype, gmx_genborn_t gmx_unused *born, int force_flags, - gmx_bool bPrintSepPot, gmx_large_int_t step) + gmx_bool bPrintSepPot, gmx_int64_t step) { gmx_bool bCalcEnerVir; int i; @@ -4391,7 +4391,7 @@ void calc_bonds_lambda(FILE *fplog, real dvdl_dum[efptNR]; rvec *f, *fshift; const t_pbc *pbc_null; - t_idef idef_fe; + t_idef idef_fe; if (fr->bMolPBC) { diff --git a/src/gromacs/gmxlib/checkpoint.c b/src/gromacs/gmxlib/checkpoint.c index 0445cb65e4..11e3707cdc 100644 --- a/src/gromacs/gmxlib/checkpoint.c +++ b/src/gromacs/gmxlib/checkpoint.c @@ -273,7 +273,7 @@ static void do_cpt_int_err(XDR *xd, const char *desc, int *i, FILE *list) } } -static void do_cpt_step_err(XDR *xd, const char *desc, gmx_large_int_t *i, FILE *list) +static void do_cpt_step_err(XDR *xd, const char *desc, gmx_int64_t *i, FILE *list) { bool_t res = 0; char buf[STEPSTRSIZE]; @@ -787,7 +787,7 @@ static void do_cpt_header(XDR *xd, gmx_bool bRead, int *file_version, int *double_prec, char **fprog, char **ftime, int *eIntegrator, int *simulation_part, - gmx_large_int_t *step, double *t, + gmx_int64_t *step, double *t, int *nnodes, int *dd_nc, int *npme, int *natoms, int *ngtc, int *nnhpres, int *nhchainlength, int *nlambda, int *flags_state, @@ -995,7 +995,7 @@ static int do_cpt_state(XDR *xd, gmx_bool bRead, if (bRead) /* we need to allocate space for dfhist if we are reading */ { - init_df_history(&state->dfhist,state->dfhist.nlambda); + init_df_history(&state->dfhist, state->dfhist.nlambda); } /* We want the MC_RNG the same across all the notes for now -- lambda MC is global */ @@ -1386,7 +1386,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep, FILE *fplog, t_commrec *cr, int eIntegrator, int simulation_part, gmx_bool bExpanded, int elamstats, - gmx_large_int_t step, double t, t_state *state) + gmx_int64_t step, double t, t_state *state) { t_fileio *fp; int file_version; @@ -1727,7 +1727,7 @@ static void check_match(FILE *fplog, static void read_checkpoint(const char *fn, FILE **pfplog, t_commrec *cr, gmx_bool bPartDecomp, ivec dd_nc, - int eIntegrator, int *init_fep_state, gmx_large_int_t *step, double *t, + int eIntegrator, int *init_fep_state, gmx_int64_t *step, double *t, t_state *state, gmx_bool *bReadRNG, gmx_bool *bReadEkin, int *simulation_part, gmx_bool bAppendOutputFiles, gmx_bool bForceAppend) @@ -2165,7 +2165,7 @@ void load_checkpoint(const char *fn, FILE **fplog, gmx_bool *bReadRNG, gmx_bool *bReadEkin, gmx_bool bAppend, gmx_bool bForceAppend) { - gmx_large_int_t step; + gmx_int64_t step; double t; if (SIMMASTER(cr)) @@ -2194,7 +2194,7 @@ void load_checkpoint(const char *fn, FILE **fplog, } static void read_checkpoint_data(t_fileio *fp, int *simulation_part, - gmx_large_int_t *step, double *t, t_state *state, + gmx_int64_t *step, double *t, t_state *state, gmx_bool bReadRNG, int *nfiles, gmx_file_position_t **outputfiles) { @@ -2273,7 +2273,7 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part, void read_checkpoint_state(const char *fn, int *simulation_part, - gmx_large_int_t *step, double *t, t_state *state) + gmx_int64_t *step, double *t, t_state *state) { t_fileio *fp; @@ -2293,7 +2293,7 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr) * this will all go away for 5.0. */ t_state state; int simulation_part; - gmx_large_int_t step; + gmx_int64_t step; double t; init_state(&state, 0, 0, 0, 0, 0); @@ -2303,8 +2303,8 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr) fr->natoms = state.natoms; fr->bTitle = FALSE; fr->bStep = TRUE; - fr->step = gmx_large_int_to_int(step, - "conversion of checkpoint to trajectory"); + fr->step = gmx_int64_to_int(step, + "conversion of checkpoint to trajectory"); fr->bTime = TRUE; fr->time = t; fr->bLambda = TRUE; @@ -2339,7 +2339,7 @@ void list_checkpoint(const char *fn, FILE *out) char *version, *btime, *buser, *bhost, *fprog, *ftime; int double_prec; int eIntegrator, simulation_part, nppnodes, npme; - gmx_large_int_t step; + gmx_int64_t step; double t; ivec dd_nc; t_state state; @@ -2425,13 +2425,13 @@ static gmx_bool exist_output_file(const char *fnm_cp, int nfile, const t_filenm /* This routine cannot print tons of data, since it is called before the log file is opened. */ gmx_bool read_checkpoint_simulation_part(const char *filename, int *simulation_part, - gmx_large_int_t *cpt_step, t_commrec *cr, + gmx_int64_t *cpt_step, t_commrec *cr, gmx_bool bAppendReq, int nfile, const t_filenm fnm[], const char *part_suffix, gmx_bool *bAddPart) { t_fileio *fp; - gmx_large_int_t step = 0; + gmx_int64_t step = 0; double t; /* This next line is nasty because the sub-structures of t_state * cannot be assumed to be zeroed (or even initialized in ways the diff --git a/src/gromacs/gmxlib/main.cpp b/src/gromacs/gmxlib/main.cpp index c56df9da57..98ad830e86 100644 --- a/src/gromacs/gmxlib/main.cpp +++ b/src/gromacs/gmxlib/main.cpp @@ -165,10 +165,10 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val, } void check_multi_large_int(FILE *log, const gmx_multisim_t *ms, - gmx_large_int_t val, const char *name, + gmx_int64_t val, const char *name, gmx_bool bQuiet) { - gmx_large_int_t *ibuf; + gmx_int64_t *ibuf; int p; gmx_bool bCompatible; @@ -210,7 +210,7 @@ void check_multi_large_int(FILE *log, const gmx_multisim_t *ms, char strbuf[255]; /* first make the format string */ snprintf(strbuf, 255, " subsystem %%d: %s\n", - gmx_large_int_pfmt); + "%" GMX_PRId64); fprintf(log, strbuf, p, ibuf[p]); } } diff --git a/src/gromacs/gmxlib/maths.c b/src/gromacs/gmxlib/maths.c index 794f3cc84a..8cdeecd000 100644 --- a/src/gromacs/gmxlib/maths.c +++ b/src/gromacs/gmxlib/maths.c @@ -756,11 +756,11 @@ gmx_bool gmx_isnan(real x) } gmx_bool -check_int_multiply_for_overflow(gmx_large_int_t a, - gmx_large_int_t b, - gmx_large_int_t *result) +check_int_multiply_for_overflow(gmx_int64_t a, + gmx_int64_t b, + gmx_int64_t *result) { - gmx_large_int_t sign = 1; + gmx_int64_t sign = 1; if ((0 == a) || (0 == b)) { *result = 0; @@ -776,9 +776,9 @@ check_int_multiply_for_overflow(gmx_large_int_t a, b = -b; sign = -sign; } - if (GMX_LARGE_INT_MAX / b < a) + if (GMX_INT64_MAX / b < a) { - *result = (sign > 0) ? GMX_LARGE_INT_MAX : GMX_LARGE_INT_MIN; + *result = (sign > 0) ? GMX_INT64_MAX : GMX_INT64_MIN; return FALSE; } *result = sign * a * b; diff --git a/src/gromacs/gmxlib/network.c b/src/gromacs/gmxlib/network.c index f14338822a..bf3e71c8ff 100644 --- a/src/gromacs/gmxlib/network.c +++ b/src/gromacs/gmxlib/network.c @@ -706,7 +706,7 @@ void gmx_sumi(int gmx_unused nr, int gmx_unused r[], const t_commrec gmx_unused #endif } -void gmx_sumli(int gmx_unused nr, gmx_large_int_t gmx_unused r[], const t_commrec gmx_unused *cr) +void gmx_sumli(int gmx_unused nr, gmx_int64_t gmx_unused r[], const t_commrec gmx_unused *cr) { #ifndef GMX_MPI gmx_call("gmx_sumli"); @@ -717,23 +717,23 @@ void gmx_sumli(int gmx_unused nr, gmx_large_int_t gmx_unused r[], const t_commre /* Use two step summing */ if (cr->nc.rank_intra == 0) { - MPI_Reduce(MPI_IN_PLACE, r, nr, GMX_MPI_LARGE_INT, MPI_SUM, 0, + MPI_Reduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra); /* Sum with the buffers reversed */ - MPI_Allreduce(MPI_IN_PLACE, r, nr, GMX_MPI_LARGE_INT, MPI_SUM, + MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, cr->nc.comm_inter); } else { /* This is here because of the silly MPI specification that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */ - MPI_Reduce(r, NULL, nr, GMX_MPI_LARGE_INT, MPI_SUM, 0, cr->nc.comm_intra); + MPI_Reduce(r, NULL, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra); } - MPI_Bcast(r, nr, GMX_MPI_LARGE_INT, 0, cr->nc.comm_intra); + MPI_Bcast(r, nr, MPI_INT64_T, 0, cr->nc.comm_intra); } else { - MPI_Allreduce(MPI_IN_PLACE, r, nr, GMX_MPI_LARGE_INT, MPI_SUM, cr->mpi_comm_mygroup); + MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, cr->mpi_comm_mygroup); } #else int i; @@ -746,19 +746,19 @@ void gmx_sumli(int gmx_unused nr, gmx_large_int_t gmx_unused r[], const t_commre if (cr->nc.bUse) { /* Use two step summing */ - MPI_Allreduce(r, cr->mpb->libuf, nr, GMX_MPI_LARGE_INT, MPI_SUM, + MPI_Allreduce(r, cr->mpb->libuf, nr, MPI_INT64_T, MPI_SUM, cr->nc.comm_intra); if (cr->nc.rank_intra == 0) { /* Sum with the buffers reversed */ - MPI_Allreduce(cr->mpb->libuf, r, nr, GMX_MPI_LARGE_INT, MPI_SUM, + MPI_Allreduce(cr->mpb->libuf, r, nr, MPI_INT64_T, MPI_SUM, cr->nc.comm_inter); } - MPI_Bcast(r, nr, GMX_MPI_LARGE_INT, 0, cr->nc.comm_intra); + MPI_Bcast(r, nr, MPI_INT64_T, 0, cr->nc.comm_intra); } else { - MPI_Allreduce(r, cr->mpb->libuf, nr, GMX_MPI_LARGE_INT, MPI_SUM, + MPI_Allreduce(r, cr->mpb->libuf, nr, MPI_INT64_T, MPI_SUM, cr->mpi_comm_mygroup); for (i = 0; i < nr; i++) { @@ -860,13 +860,13 @@ void gmx_sumi_sim(int gmx_unused nr, int gmx_unused r[], const gmx_multisim_t gm #endif } -void gmx_sumli_sim(int gmx_unused nr, gmx_large_int_t gmx_unused r[], const gmx_multisim_t gmx_unused *ms) +void gmx_sumli_sim(int gmx_unused nr, gmx_int64_t gmx_unused r[], const gmx_multisim_t gmx_unused *ms) { #ifndef GMX_MPI gmx_call("gmx_sumli_sim"); #else #if defined(MPI_IN_PLACE_EXISTS) - MPI_Allreduce(MPI_IN_PLACE, r, nr, GMX_MPI_LARGE_INT, MPI_SUM, + MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, ms->mpi_comm_masters); #else /* this is thread-unsafe, but it will do for now: */ @@ -877,7 +877,7 @@ void gmx_sumli_sim(int gmx_unused nr, gmx_large_int_t gmx_unused r[], const gmx_ ms->mpb->libuf_alloc = nr; srenew(ms->mpb->libuf, ms->mpb->libuf_alloc); } - MPI_Allreduce(r, ms->mpb->libuf, nr, GMX_MPI_LARGE_INT, MPI_SUM, + MPI_Allreduce(r, ms->mpb->libuf, nr, MPI_INT64_T, MPI_SUM, ms->mpi_comm_masters); for (i = 0; i < nr; i++) { diff --git a/src/gromacs/gmxlib/nrnb.c b/src/gromacs/gmxlib/nrnb.c index 748785e5dd..7b0a7cb029 100644 --- a/src/gromacs/gmxlib/nrnb.c +++ b/src/gromacs/gmxlib/nrnb.c @@ -384,7 +384,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop) } void print_perf(FILE *out, double time_per_thread, double time_per_node, - gmx_large_int_t nsteps, real delta_t, + gmx_int64_t nsteps, real delta_t, double nbfs, double mflop) { real wallclocktime; diff --git a/src/gromacs/gmxlib/readinp.c b/src/gromacs/gmxlib/readinp.c index 8e007072ef..9875d87a83 100644 --- a/src/gromacs/gmxlib/readinp.c +++ b/src/gromacs/gmxlib/readinp.c @@ -396,26 +396,26 @@ int get_eint(int *ninp, t_inpfile **inp, const char *name, int def, } } -gmx_large_int_t get_egmx_large_int(int *ninp, t_inpfile **inp, - const char *name, gmx_large_int_t def, - warninp_t wi) +gmx_int64_t get_eint64(int *ninp, t_inpfile **inp, + const char *name, gmx_int64_t def, + warninp_t wi) { char buf[32], *ptr, warn_buf[STRLEN]; int ii; - gmx_large_int_t ret; + gmx_int64_t ret; ii = get_einp(ninp, inp, name); if (ii == -1) { - sprintf(buf, gmx_large_int_pfmt, def); + sprintf(buf, "%"GMX_PRId64, def); (*inp)[(*ninp)-1].value = strdup(buf); return def; } else { - ret = str_to_large_int_t((*inp)[ii].value, &ptr); + ret = str_to_int64_t((*inp)[ii].value, &ptr); if (ptr == (*inp)[ii].value) { sprintf(warn_buf, "Right hand side '%s' for parameter '%s' in parameter file is not an integer value\n", (*inp)[ii].value, (*inp)[ii].name); diff --git a/src/gromacs/gmxlib/smalloc.c b/src/gromacs/gmxlib/smalloc.c index c5cccd5a99..d1337d78d8 100644 --- a/src/gromacs/gmxlib/smalloc.c +++ b/src/gromacs/gmxlib/smalloc.c @@ -105,9 +105,9 @@ static void log_action(int bMal, const char *what, const char *file, int line, } #endif -static char *gmx_large_int_str(gmx_large_int_t i, char *buf) +static char *gmx_large_int_str(gmx_int64_t i, char *buf) { - sprintf(buf, gmx_large_int_pfmt, i); + sprintf(buf, "%"GMX_PRId64, i); return buf; } @@ -129,7 +129,7 @@ void *save_malloc(const char *name, const char *file, int line, size_t size) gmx_fatal(errno, __FILE__, __LINE__, "Not enough memory. Failed to malloc %s bytes for %s\n" "(called from file %s, line %d)", - gmx_large_int_str((gmx_large_int_t)size, cbuf), + gmx_large_int_str((gmx_int64_t)size, cbuf), name, file, line); } (void) memset(p, 0, size); @@ -169,10 +169,10 @@ void *save_calloc(const char *name, const char *file, int line, if ((p = malloc((size_t)nelem*(size_t)elsize)) == NULL) { gmx_fatal(errno, __FILE__, __LINE__, - "Not enough memory. Failed to calloc %"gmx_large_int_fmt - " elements of size %"gmx_large_int_fmt + "Not enough memory. Failed to calloc %"GMX_PRId64 + " elements of size %"GMX_PRId64 " for %s\n(called from file %s, line %d)", - (gmx_large_int_t)nelem, (gmx_large_int_t)elsize, + (gmx_int64_t)nelem, (gmx_int64_t)elsize, name, file, line); } memset(p, 0, (size_t) (nelem * elsize)); @@ -180,10 +180,10 @@ void *save_calloc(const char *name, const char *file, int line, if ((p = calloc((size_t)nelem, (size_t)elsize)) == NULL) { gmx_fatal(errno, __FILE__, __LINE__, - "Not enough memory. Failed to calloc %"gmx_large_int_fmt - " elements of size %"gmx_large_int_fmt + "Not enough memory. Failed to calloc %"GMX_PRId64 + " elements of size %"GMX_PRId64 " for %s\n(called from file %s, line %d)", - (gmx_large_int_t)nelem, (gmx_large_int_t)elsize, name, file, line); + (gmx_int64_t)nelem, (gmx_int64_t)elsize, name, file, line); } #endif } @@ -231,7 +231,7 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr, gmx_fatal(errno, __FILE__, __LINE__, "Not enough memory. Failed to realloc %s bytes for %s, %s=%x\n" "(called from file %s, line %d)", - gmx_large_int_str((gmx_large_int_t)size, cbuf), + gmx_large_int_str((gmx_int64_t)size, cbuf), name, name, ptr, file, line); } #ifdef DEBUG diff --git a/src/gromacs/gmxlib/string2.c b/src/gromacs/gmxlib/string2.c index f40e2a2319..22a84adb50 100644 --- a/src/gromacs/gmxlib/string2.c +++ b/src/gromacs/gmxlib/string2.c @@ -621,11 +621,11 @@ char **split(char sep, const char *str) } -gmx_large_int_t -str_to_large_int_t(const char *str, char **endptr) +gmx_int64_t +str_to_int64_t(const char *str, char **endptr) { int sign = 1; - gmx_large_int_t val = 0; + gmx_int64_t val = 0; char ch; const char *p; diff --git a/src/gromacs/gmxlib/thread_mpi/type.c b/src/gromacs/gmxlib/thread_mpi/type.c index 6390705d8c..8c9e7ff66f 100644 --- a/src/gromacs/gmxlib/thread_mpi/type.c +++ b/src/gromacs/gmxlib/thread_mpi/type.c @@ -151,6 +151,15 @@ #define INTTYPE 1 #include "tmpi_ops.h" +#ifdef _MSC_VER +#define TYPE __int64 +#else +#define TYPE int64_t +#endif +#define TYPENM INT64_T +#define INTTYPE 1 +#include "tmpi_ops.h" + /* These are the fundamental data types. They exist as global variables */ tmpi_dt tmpi_char = {sizeof(char), oplist_CHAR, 0, NULL, TRUE}; @@ -174,7 +183,7 @@ tmpi_dt tmpi_double = {sizeof(double), oplist_DOUBLE, 0, NULL, TRU tmpi_dt tmpi_l_double = {sizeof(long double), oplist_L_DOUBLE, 0, NULL, TRUE}; tmpi_dt tmpi_byte = {sizeof(char), oplist_CHAR, 0, NULL, TRUE}; tmpi_dt tmpi_pointer = {sizeof(void*), NULL, 0, NULL, TRUE}; - +tmpi_dt tmpi_int64_t = {8, oplist_INT64_T, 0, NULL, TRUE}; /* the variable types as they are referred to from MPI */ @@ -204,6 +213,7 @@ const tMPI_Datatype TMPI_BYTE = &tmpi_byte; const tMPI_Datatype TMPI_POINTER = &tmpi_pointer; +const tMPI_Datatype TMPI_INT64_T = &tmpi_int64_t; diff --git a/src/gromacs/gmxlib/txtdump.c b/src/gromacs/gmxlib/txtdump.c index b1e3acff6f..44b2d85f0b 100644 --- a/src/gromacs/gmxlib/txtdump.c +++ b/src/gromacs/gmxlib/txtdump.c @@ -336,7 +336,7 @@ static void pr_int(FILE *fp, int indent, const char *title, int i) fprintf(fp, "%-20s = %d\n", title, i); } -static void pr_gmx_large_int(FILE *fp, int indent, const char *title, gmx_large_int_t i) +static void pr_gmx_large_int(FILE *fp, int indent, const char *title, gmx_int64_t i) { char buf[STEPSTRSIZE]; diff --git a/src/gromacs/gmxlib/typedefs.c b/src/gromacs/gmxlib/typedefs.c index 9fe3cb08ea..3be1ea2cf0 100644 --- a/src/gromacs/gmxlib/typedefs.c +++ b/src/gromacs/gmxlib/typedefs.c @@ -52,7 +52,7 @@ -static gmx_bool bOverAllocDD = FALSE; +static gmx_bool bOverAllocDD = FALSE; static tMPI_Thread_mutex_t over_alloc_mutex = TMPI_THREAD_MUTEX_INITIALIZER; @@ -77,7 +77,7 @@ int over_alloc_dd(int n) } } -int gmx_large_int_to_int(gmx_large_int_t step, const char *warn) +int gmx_int64_to_int(gmx_int64_t step, const char *warn) { int i; @@ -87,16 +87,16 @@ int gmx_large_int_to_int(gmx_large_int_t step, const char *warn) { fprintf(stderr, "\nWARNING during %s:\n", warn); fprintf(stderr, "step value "); - fprintf(stderr, gmx_large_int_pfmt, step); + fprintf(stderr, "%"GMX_PRId64, step); fprintf(stderr, " does not fit in int, converted to %d\n\n", i); } return i; } -char *gmx_step_str(gmx_large_int_t i, char *buf) +char *gmx_step_str(gmx_int64_t i, char *buf) { - sprintf(buf, gmx_large_int_pfmt, i); + sprintf(buf, "%"GMX_PRId64, i); return buf; } @@ -464,12 +464,12 @@ void done_inputrec(t_inputrec *ir) static void zero_history(history_t *hist) { - hist->disre_initf = 0; - hist->ndisrepairs = 0; + hist->disre_initf = 0; + hist->ndisrepairs = 0; hist->disre_rm3tav = NULL; - hist->orire_initf = 0; - hist->norire_Dtav = 0; - hist->orire_Dtav = NULL; + hist->orire_initf = 0; + hist->norire_Dtav = 0; + hist->orire_Dtav = NULL; } static void zero_ekinstate(ekinstate_t *eks) @@ -617,7 +617,7 @@ void init_state(t_state *state, int natoms, int ngtc, int nnhpres, int nhchainle zero_history(&state->hist); zero_ekinstate(&state->ekinstate); init_energyhistory(&state->enerhist); - init_df_history(&state->dfhist,nlambda); + init_df_history(&state->dfhist, nlambda); state->ddp_count = 0; state->ddp_count_cg_gl = 0; state->cg_gl = NULL; @@ -964,8 +964,8 @@ extern void copy_df_history(df_history_t *df_dest, df_history_t *df_source) /* Currently, there should not be any difference in nlambda between the two, but this is included for completeness for potential later functionality */ - df_dest->nlambda = df_source->nlambda; - df_dest->bEquil = df_source->bEquil; + df_dest->nlambda = df_source->nlambda; + df_dest->bEquil = df_source->bEquil; df_dest->wl_delta = df_source->wl_delta; for (i = 0; i < df_dest->nlambda; i++) @@ -982,10 +982,10 @@ extern void copy_df_history(df_history_t *df_dest, df_history_t *df_source) { for (j = 0; j < df_dest->nlambda; j++) { - df_dest->accum_p[i][j] = df_source->accum_p[i][j]; - df_dest->accum_m[i][j] = df_source->accum_m[i][j]; - df_dest->accum_p2[i][j] = df_source->accum_p2[i][j]; - df_dest->accum_m2[i][j] = df_source->accum_m2[i][j]; + df_dest->accum_p[i][j] = df_source->accum_p[i][j]; + df_dest->accum_m[i][j] = df_source->accum_m[i][j]; + df_dest->accum_p2[i][j] = df_source->accum_p2[i][j]; + df_dest->accum_m2[i][j] = df_source->accum_m2[i][j]; df_dest->Tij[i][j] = df_source->Tij[i][j]; df_dest->Tij_empirical[i][j] = df_source->Tij_empirical[i][j]; } @@ -1005,7 +1005,7 @@ void done_df_history(df_history_t *dfhist) sfree(dfhist->sum_minvar); sfree(dfhist->sum_variance); - for (i=0;inlambda;i++) + for (i = 0; i < dfhist->nlambda; i++) { sfree(dfhist->Tij[i]); sfree(dfhist->Tij_empirical[i]); diff --git a/src/gromacs/legacyheaders/bondf.h b/src/gromacs/legacyheaders/bondf.h index 6893ccbc83..4b9a0b87cf 100644 --- a/src/gromacs/legacyheaders/bondf.h +++ b/src/gromacs/legacyheaders/bondf.h @@ -64,7 +64,7 @@ void calc_bonds(FILE *fplog, const gmx_multisim_t *ms, t_fcdata *fcd, int *ddgatindex, t_atomtypes *atype, gmx_genborn_t *born, int force_flags, - gmx_bool bPrintSepPot, gmx_large_int_t step); + gmx_bool bPrintSepPot, gmx_int64_t step); /* * The function calc_bonds() calculates all bonded force interactions. * The "bonds" are specified as follows: diff --git a/src/gromacs/legacyheaders/checkpoint.h b/src/gromacs/legacyheaders/checkpoint.h index 40df46de2a..18c3670021 100644 --- a/src/gromacs/legacyheaders/checkpoint.h +++ b/src/gromacs/legacyheaders/checkpoint.h @@ -56,7 +56,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep, FILE *fplog, t_commrec *cr, int eIntegrator, int simulation_part, gmx_bool bExpanded, int elamstats, - gmx_large_int_t step, double t, + gmx_int64_t step, double t, t_state *state); /* Loads a checkpoint from fn for run continuation. @@ -80,7 +80,7 @@ void load_checkpoint(const char *fn, FILE **fplog, * number of nodes was read. */ void read_checkpoint_state(const char *fn, int *simulation_part, - gmx_large_int_t *step, double *t, t_state *state); + gmx_int64_t *step, double *t, t_state *state); /* Read everything that can be stored in t_trxframe from a checkpoint file */ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr); @@ -99,7 +99,7 @@ void list_checkpoint(const char *fn, FILE *out); * needs to be added to the output file name. */ gmx_bool read_checkpoint_simulation_part(const char *filename, int *simulation_part, - gmx_large_int_t *step, t_commrec *cr, + gmx_int64_t *step, t_commrec *cr, gmx_bool bAppendReq, int nfile, const t_filenm fnm[], const char *part_suffix, gmx_bool *bAddPart); diff --git a/src/gromacs/legacyheaders/constr.h b/src/gromacs/legacyheaders/constr.h index cc2dbfa6a9..7c456db692 100644 --- a/src/gromacs/legacyheaders/constr.h +++ b/src/gromacs/legacyheaders/constr.h @@ -137,7 +137,7 @@ gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner, t_inputrec *ir, gmx_ekindata_t *ekind, t_commrec *cr, - gmx_large_int_t step, int delta_step, + gmx_int64_t step, int delta_step, t_mdatoms *md, rvec *x, rvec *xprime, rvec *min_proj, gmx_bool bMolPBC, matrix box, @@ -252,7 +252,7 @@ real constr_r_max(FILE *fplog, gmx_mtop_t *mtop, t_inputrec *ir); gmx_bool constrain_lincs(FILE *log, gmx_bool bLog, gmx_bool bEner, t_inputrec *ir, - gmx_large_int_t step, + gmx_int64_t step, gmx_lincsdata_t lincsd, t_mdatoms *md, t_commrec *cr, rvec *x, rvec *xprime, rvec *min_proj, diff --git a/src/gromacs/legacyheaders/domdec.h b/src/gromacs/legacyheaders/domdec.h index 4ee0d63529..1b449748f7 100644 --- a/src/gromacs/legacyheaders/domdec.h +++ b/src/gromacs/legacyheaders/domdec.h @@ -173,7 +173,7 @@ void dd_atom_sum_real(gmx_domdec_t *dd, real v[]); /* Sum the contributions to a real for each atom over the neighboring cells. */ void dd_partition_system(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_commrec *cr, gmx_bool bMasterState, int nstglobalcomm, @@ -272,7 +272,7 @@ void dd_bonded_cg_distance(FILE *fplog, gmx_mtop_t *mtop, gmx_bool bBCheck, real *r_2b, real *r_mb); -void write_dd_pdb(const char *fn, gmx_large_int_t step, const char *title, +void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title, gmx_mtop_t *mtop, t_commrec *cr, int natoms, rvec x[], matrix box); diff --git a/src/gromacs/legacyheaders/ebin.h b/src/gromacs/legacyheaders/ebin.h index c57cb316c7..d3fe4d32e6 100644 --- a/src/gromacs/legacyheaders/ebin.h +++ b/src/gromacs/legacyheaders/ebin.h @@ -49,11 +49,11 @@ extern "C" { typedef struct { int nener; gmx_enxnm_t *enm; - gmx_large_int_t nsteps; - gmx_large_int_t nsum; + gmx_int64_t nsteps; + gmx_int64_t nsum; t_energy *e; - gmx_large_int_t nsteps_sim; - gmx_large_int_t nsum_sim; + gmx_int64_t nsteps_sim; + gmx_int64_t nsum_sim; t_energy *e_sim; } t_ebin; diff --git a/src/gromacs/legacyheaders/edsam.h b/src/gromacs/legacyheaders/edsam.h index 1a4468fbe1..497488c6cb 100644 --- a/src/gromacs/legacyheaders/edsam.h +++ b/src/gromacs/legacyheaders/edsam.h @@ -42,7 +42,7 @@ extern "C" { #endif -void do_edsam(t_inputrec *ir, gmx_large_int_t step, +void do_edsam(t_inputrec *ir, gmx_int64_t step, t_commrec *cr, rvec xs[], rvec v[], matrix box, gmx_edsam_t ed); /* Essential dynamics constraints, called from constrain() */ @@ -60,7 +60,7 @@ void dd_make_local_ed_indices(gmx_domdec_t *dd, gmx_edsam_t ed); * Should be called at every domain decomposition. */ void do_flood(t_commrec *cr, t_inputrec *ir, rvec x[], rvec force[], gmx_edsam_t ed, - matrix box, gmx_large_int_t step, gmx_bool bNS); + matrix box, gmx_int64_t step, gmx_bool bNS); /* Flooding - called from do_force() */ #ifdef __cplusplus diff --git a/src/gromacs/legacyheaders/force.h b/src/gromacs/legacyheaders/force.h index 9f7834f43a..f7bb5c2e86 100644 --- a/src/gromacs/legacyheaders/force.h +++ b/src/gromacs/legacyheaders/force.h @@ -204,7 +204,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, extern void do_force(FILE *log, t_commrec *cr, t_inputrec *inputrec, - gmx_large_int_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, + gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, gmx_localtop_t *top, gmx_groups_t *groups, matrix box, rvec x[], history_t *hist, @@ -241,7 +241,7 @@ void ns(FILE *fplog, /* Call the neighborsearcher */ extern void do_force_lowlevel(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_forcerec *fr, t_inputrec *ir, t_idef *idef, diff --git a/src/gromacs/legacyheaders/main.h b/src/gromacs/legacyheaders/main.h index 73c717f2c6..c7c7d4c09b 100644 --- a/src/gromacs/legacyheaders/main.h +++ b/src/gromacs/legacyheaders/main.h @@ -64,7 +64,7 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val, const char *name, gmx_bool bQuiet); void check_multi_large_int(FILE *log, const gmx_multisim_t *ms, - gmx_large_int_t val, const char *name, + gmx_int64_t val, const char *name, gmx_bool bQuiet); /* Check if val is the same on all processors for a mdrun -multi run * The string name is used to print to the log file and in a fatal error diff --git a/src/gromacs/legacyheaders/maths.h b/src/gromacs/legacyheaders/maths.h index efbfdaebbe..d39810c2f8 100644 --- a/src/gromacs/legacyheaders/maths.h +++ b/src/gromacs/legacyheaders/maths.h @@ -166,9 +166,9 @@ gmx_log2(real x) * Returns true when overflow did not occur. */ gmx_bool -check_int_multiply_for_overflow(gmx_large_int_t a, - gmx_large_int_t b, - gmx_large_int_t *result); +check_int_multiply_for_overflow(gmx_int64_t a, + gmx_int64_t b, + gmx_int64_t *result); static int gmx_greatest_common_divisor(int p, int q) { @@ -176,8 +176,8 @@ static int gmx_greatest_common_divisor(int p, int q) while (q != 0) { tmp = q; - q = p % q; - p = tmp; + q = p % q; + p = tmp; } return p; } diff --git a/src/gromacs/legacyheaders/md_support.h b/src/gromacs/legacyheaders/md_support.h index eeea4d4288..ad0389d51f 100644 --- a/src/gromacs/legacyheaders/md_support.h +++ b/src/gromacs/legacyheaders/md_support.h @@ -87,8 +87,8 @@ void check_nst_param(FILE *fplog, t_commrec *cr, /* check which of the multisim simulations has the shortest number of steps and return that number of nsteps */ -gmx_large_int_t get_multisim_nsteps(const t_commrec *cr, - gmx_large_int_t nsteps); +gmx_int64_t get_multisim_nsteps(const t_commrec *cr, + gmx_int64_t nsteps); void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr, gmx_bool *bNotLastFrame); @@ -98,7 +98,7 @@ real compute_conserved_from_auxiliary(t_inputrec *ir, t_state *state, t_extmass *MassQ); /* set the lambda values at each step of mdrun when they change */ -void set_current_lambdas(gmx_large_int_t step, t_lambda *fepvals, gmx_bool bRerunMD, +void set_current_lambdas(gmx_int64_t step, t_lambda *fepvals, gmx_bool bRerunMD, t_trxframe *rerun_fr, t_state *state_global, t_state *state, double lam0[]); int multisim_min(const gmx_multisim_t *ms, int nmin, int n); diff --git a/src/gromacs/legacyheaders/mdebin.h b/src/gromacs/legacyheaders/mdebin.h index 932bbf7aa9..8bb1146626 100644 --- a/src/gromacs/legacyheaders/mdebin.h +++ b/src/gromacs/legacyheaders/mdebin.h @@ -142,11 +142,11 @@ void upd_mdebin(t_mdebin *md, void upd_mdebin_step(t_mdebin *md); /* Updates only the step count in md */ -void print_ebin_header(FILE *log, gmx_large_int_t steps, double time, real lamb); +void print_ebin_header(FILE *log, gmx_int64_t steps, double time, real lamb); void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR, FILE *log, - gmx_large_int_t step, double time, + gmx_int64_t step, double time, int mode, gmx_bool bCompact, t_mdebin *md, t_fcdata *fcd, gmx_groups_t *groups, t_grpopts *opts); diff --git a/src/gromacs/legacyheaders/mdrun.h b/src/gromacs/legacyheaders/mdrun.h index c321d5fbdd..9713feb0c0 100644 --- a/src/gromacs/legacyheaders/mdrun.h +++ b/src/gromacs/legacyheaders/mdrun.h @@ -87,7 +87,7 @@ enum { * used in runner.c and md.c. * (These variables should be stored in the tpx file.) */ -extern gmx_large_int_t deform_init_init_step_tpx; +extern gmx_int64_t deform_init_init_step_tpx; extern matrix deform_init_box_tpx; extern tMPI_Thread_mutex_t deform_init_box_mutex; @@ -150,11 +150,11 @@ void init_expanded_ensemble(gmx_bool bStateFromCP, t_inputrec *ir, gmx_rng_t *mc int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd, t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist, - gmx_large_int_t step, gmx_rng_t mcrng, + gmx_int64_t step, gmx_rng_t mcrng, rvec *v, t_mdatoms *mdatoms); void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist, - int fep_state, int frequency, gmx_large_int_t step); + int fep_state, int frequency, gmx_int64_t step); void get_mc_state(gmx_rng_t rng, t_state *state); @@ -179,7 +179,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt, real rdd, real rconstr, const char *dddlb_opt, real dlb_scale, const char *ddcsx, const char *ddcsy, const char *ddcsz, const char *nbpu_opt, int nstlist_cmdline, - gmx_large_int_t nsteps_cmdline, int nstepout, int resetstep, + gmx_int64_t nsteps_cmdline, int nstepout, int resetstep, int nmultisim, int repl_ex_nst, int repl_ex_nex, int repl_ex_seed, real pforce, real cpt_period, real max_hours, const char *deviceOptions, unsigned long Flags); diff --git a/src/gromacs/legacyheaders/network.h b/src/gromacs/legacyheaders/network.h index a903c2ccae..d0654a96d6 100644 --- a/src/gromacs/legacyheaders/network.h +++ b/src/gromacs/legacyheaders/network.h @@ -109,7 +109,7 @@ void gmx_bcast_sim(int nbytes, void *b, const t_commrec *cr); void gmx_sumi(int nr, int r[], const t_commrec *cr); /* Calculate the global sum of an array of ints */ -void gmx_sumli(int nr, gmx_large_int_t r[], const t_commrec *cr); +void gmx_sumli(int nr, gmx_int64_t r[], const t_commrec *cr); /* Calculate the global sum of an array of large ints */ void gmx_sumf(int nr, float r[], const t_commrec *cr); @@ -127,7 +127,7 @@ void gmx_sumd_comm(int nr, double r[], MPI_Comm mpi_comm); void gmx_sumi_sim(int nr, int r[], const gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of ints */ -void gmx_sumli_sim(int nr, gmx_large_int_t r[], const gmx_multisim_t *ms); +void gmx_sumli_sim(int nr, gmx_int64_t r[], const gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of large ints */ void gmx_sumf_sim(int nr, float r[], const gmx_multisim_t *ms); diff --git a/src/gromacs/legacyheaders/nrnb.h b/src/gromacs/legacyheaders/nrnb.h index 14b90e1477..d0d66cfafe 100644 --- a/src/gromacs/legacyheaders/nrnb.h +++ b/src/gromacs/legacyheaders/nrnb.h @@ -66,7 +66,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop); */ void print_perf(FILE *out, double nodetime, double realtime, - gmx_large_int_t nsteps, real delta_t, + gmx_int64_t nsteps, real delta_t, double nbfs, double mflop); /* Prints the performance, nbfs and mflop come from print_flop */ diff --git a/src/gromacs/legacyheaders/pme.h b/src/gromacs/legacyheaders/pme.h index 5969123a49..b560d2b791 100644 --- a/src/gromacs/legacyheaders/pme.h +++ b/src/gromacs/legacyheaders/pme.h @@ -162,7 +162,7 @@ void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x, gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj, real lambda_q, real lambda_lj, gmx_bool bEnerVir, int pme_flags, - gmx_large_int_t step); + gmx_int64_t step); /* Send the coordinates to our PME-only node and request a PME calculation */ void gmx_pme_send_finish(t_commrec *cr); @@ -171,7 +171,7 @@ void gmx_pme_send_finish(t_commrec *cr); void gmx_pme_send_switchgrid(t_commrec *cr, ivec grid_size, real ewaldcoeff_q, real ewaldcoeff_lj); /* Tell our PME-only node to switch to a new grid size */ -void gmx_pme_send_resetcounters(t_commrec *cr, gmx_large_int_t step); +void gmx_pme_send_resetcounters(t_commrec *cr, gmx_int64_t step); /* Tell our PME-only node to reset all cycle and flop counters */ void gmx_pme_receive_f(t_commrec *cr, @@ -199,7 +199,7 @@ int gmx_pme_recv_params_coords(gmx_pme_pp_t pme_pp, gmx_bool *bFreeEnergy_q, gmx_bool *bFreeEnergy_lj, real *lambda_q, real *lambda_lj, gmx_bool *bEnerVir, int *pme_flags, - gmx_large_int_t *step, + gmx_int64_t *step, ivec grid_size, real *ewaldcoeff_q, real *ewaldcoeff_lj); ; /* With return value: diff --git a/src/gromacs/legacyheaders/pull.h b/src/gromacs/legacyheaders/pull.h index 4decb3c3e4..8b9df4707b 100644 --- a/src/gromacs/legacyheaders/pull.h +++ b/src/gromacs/legacyheaders/pull.h @@ -92,7 +92,7 @@ void init_pull(FILE *fplog, void finish_pull(t_pull *pull); /* Print the pull output (x and/or f) */ -void pull_print_output(t_pull *pull, gmx_large_int_t step, double time); +void pull_print_output(t_pull *pull, gmx_int64_t step, double time); /* In pullutil.c */ diff --git a/src/gromacs/legacyheaders/pull_rotation.h b/src/gromacs/legacyheaders/pull_rotation.h index a24cd1528d..d3ff050ff7 100644 --- a/src/gromacs/legacyheaders/pull_rotation.h +++ b/src/gromacs/legacyheaders/pull_rotation.h @@ -107,7 +107,7 @@ extern void dd_make_local_rotation_groups(gmx_domdec_t *dd, t_rot *rot); * local arrays have to be updated (masses, shifts) */ extern void do_rotation(t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], real t, - gmx_large_int_t step, gmx_wallcycle_t wcycle, gmx_bool bNS); + gmx_int64_t step, gmx_wallcycle_t wcycle, gmx_bool bNS); /*! \brief Add the enforced rotation forces to the official force array. @@ -126,7 +126,7 @@ extern void do_rotation(t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], rea * \param step The time step, used for output. * \param t Time, used for output. */ -extern real add_rot_forces(t_rot *rot, rvec f[], t_commrec *cr, gmx_large_int_t step, real t); +extern real add_rot_forces(t_rot *rot, rvec f[], t_commrec *cr, gmx_int64_t step, real t); /*! \brief Close the enforced rotation output files. diff --git a/src/gromacs/legacyheaders/readinp.h b/src/gromacs/legacyheaders/readinp.h index 31fd5c31cf..053c9ad063 100644 --- a/src/gromacs/legacyheaders/readinp.h +++ b/src/gromacs/legacyheaders/readinp.h @@ -73,9 +73,9 @@ void replace_inp_entry(int ninp, t_inpfile *inp, int get_eint(int *ninp, t_inpfile **inp, const char *name, int def, warninp_t wi); -gmx_large_int_t get_egmx_large_int(int *ninp, t_inpfile **inp, - const char *name, gmx_large_int_t def, - warninp_t); +gmx_int64_t get_eint64(int *ninp, t_inpfile **inp, + const char *name, gmx_int64_t def, + warninp_t); double get_ereal(int *ninp, t_inpfile **inp, const char *name, double def, warninp_t wi); @@ -98,7 +98,7 @@ int get_eenum(int *ninp, t_inpfile **inp, const char *name, const char **defs); #define STYPE(name, var, def) if ((tmp = get_estr(&ninp, &inp, name, def)) != NULL) strcpy(var, tmp) #define STYPENC(name, def) get_estr(&ninp, &inp, name, def) #define ITYPE(name, var, def) var = get_eint(&ninp, &inp, name, def, wi) -#define STEPTYPE(name, var, def) var = get_egmx_large_int(&ninp, &inp, name, def, wi) +#define STEPTYPE(name, var, def) var = get_eint64(&ninp, &inp, name, def, wi) #define RTYPE(name, var, def) var = get_ereal(&ninp, &inp, name, def, wi) #define ETYPE(name, var, defs) var = get_eenum(&ninp, &inp, name, defs) #define EETYPE(name, var, defs) var = get_eeenum(&ninp, &inp, name, defs, wi) diff --git a/src/gromacs/legacyheaders/shellfc.h b/src/gromacs/legacyheaders/shellfc.h index 8e2419e7f8..0298dd608d 100644 --- a/src/gromacs/legacyheaders/shellfc.h +++ b/src/gromacs/legacyheaders/shellfc.h @@ -52,7 +52,7 @@ void make_local_shells(t_commrec *cr, t_mdatoms *md, /* Optimize shell positions */ int relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose, - gmx_large_int_t mdstep, t_inputrec *inputrec, + gmx_int64_t mdstep, t_inputrec *inputrec, gmx_bool bDoNS, int force_flags, gmx_localtop_t *top, gmx_constr_t constr, diff --git a/src/gromacs/legacyheaders/sim_util.h b/src/gromacs/legacyheaders/sim_util.h index 07d3bf666c..adb59d75c0 100644 --- a/src/gromacs/legacyheaders/sim_util.h +++ b/src/gromacs/legacyheaders/sim_util.h @@ -77,13 +77,13 @@ void global_stat(FILE *log, gmx_global_stat_t gs, gmx_bool bSumEkinhOld, int flags); /* Communicate statistics over cr->mpi_comm_mysim */ -int do_per_step(gmx_large_int_t step, gmx_large_int_t nstep); +int do_per_step(gmx_int64_t step, gmx_int64_t nstep); /* Return TRUE if io should be done */ /* ROUTINES from sim_util.c */ void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting, - gmx_large_int_t step, t_inputrec *ir, t_commrec *cr); + gmx_int64_t step, t_inputrec *ir, t_commrec *cr); void print_date_and_time(FILE *log, int pid, const char *title, const gmx_walltime_accounting_t walltime_accounting); @@ -98,7 +98,7 @@ void finish_run(FILE *log, t_commrec *cr, void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr); void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr, - gmx_large_int_t step, int natoms, + gmx_int64_t step, int natoms, matrix box, real lambda, tensor pres, tensor virial, real *prescorr, real *enercorr, real *dvdlcorr); diff --git a/src/gromacs/legacyheaders/string2.h b/src/gromacs/legacyheaders/string2.h index e4e51a179e..5df39f7955 100644 --- a/src/gromacs/legacyheaders/string2.h +++ b/src/gromacs/legacyheaders/string2.h @@ -208,7 +208,7 @@ char *wrap_lines(const char *buf, int line_width, int indent, char **split(char sep, const char *str); /*! \brief - * Convert a string to gmx_large_int_t. + * Convert a string to gmx_int64_t. * * This method works as the standard library function strtol(), except that it * does not support different bases. @@ -219,7 +219,7 @@ char **split(char sep, const char *str); * - If an overflow occurs, returns zero and \p *endptr will equal \p str. * errno is still set to ERANGE. */ -gmx_large_int_t str_to_large_int_t(const char *str, char **endptr); +gmx_int64_t str_to_int64_t(const char *str, char **endptr); #ifdef GMX_NATIVE_WINDOWS #define snprintf _snprintf diff --git a/src/gromacs/legacyheaders/thread_mpi/mpi_bindings.h b/src/gromacs/legacyheaders/thread_mpi/mpi_bindings.h index a03a73cc33..419ffb64a2 100644 --- a/src/gromacs/legacyheaders/thread_mpi/mpi_bindings.h +++ b/src/gromacs/legacyheaders/thread_mpi/mpi_bindings.h @@ -92,7 +92,7 @@ typedef tMPI_Op MPI_Op; #define MPI_LONG_DOUBLE TMPI_LONG_DOUBLE #define MPI_WCHAR TMPI_WCHAR #define MPI_BYTE TMPI_BYTE - +#define MPI_INT64_T TMPI_INT64_T #define MPI_SUCCESS TMPI_SUCCESS diff --git a/src/gromacs/legacyheaders/thread_mpi/tmpi.h b/src/gromacs/legacyheaders/thread_mpi/tmpi.h index d5f0e4bf4d..38af58fe24 100644 --- a/src/gromacs/legacyheaders/thread_mpi/tmpi.h +++ b/src/gromacs/legacyheaders/thread_mpi/tmpi.h @@ -168,6 +168,9 @@ TMPI_EXPORT extern const tMPI_Datatype TMPI_POINTER; /**< pointer (thread_mpi specific) */ +TMPI_EXPORT +extern const tMPI_Datatype TMPI_INT64_T; /**< int64_t */ + /*! \} */ diff --git a/src/gromacs/legacyheaders/typedefs.h b/src/gromacs/legacyheaders/typedefs.h index d3963b3db7..6d45e44bde 100644 --- a/src/gromacs/legacyheaders/typedefs.h +++ b/src/gromacs/legacyheaders/typedefs.h @@ -103,8 +103,8 @@ int over_alloc_dd(int n); /* Over allocation for large data types: complex structs */ #define over_alloc_large(n) (int)(OVER_ALLOC_FAC*(n) + 1000) -int gmx_large_int_to_int(gmx_large_int_t step, const char *warn); -/* Convert a gmx_large_int_t value to int. +int gmx_int64_to_int(gmx_int64_t step, const char *warn); +/* Convert a gmx_int64_t value to int. * If warn!=NULL a warning message will be written * to stderr when step does not fit in an int, * the first line is: @@ -113,10 +113,10 @@ int gmx_large_int_to_int(gmx_large_int_t step, const char *warn); #define STEPSTRSIZE 22 -char *gmx_step_str(gmx_large_int_t i, char *buf); -/* Prints a gmx_large_int_t value in buf and returns the pointer to buf. +char *gmx_step_str(gmx_int64_t i, char *buf); +/* Prints a gmx_int64_t value in buf and returns the pointer to buf. * buf should be large enough to contain i: STEPSTRSIZE (22) chars. - * When multiple gmx_large_int_t values are printed in the same printf call, + * When multiple gmx_int64_t values are printed in the same printf call, * be sure to call gmx_step_str with different buffers. */ diff --git a/src/gromacs/legacyheaders/types/commrec.h b/src/gromacs/legacyheaders/types/commrec.h index 5e3926c857..93efed42e8 100644 --- a/src/gromacs/legacyheaders/types/commrec.h +++ b/src/gromacs/legacyheaders/types/commrec.h @@ -119,7 +119,7 @@ typedef struct { int *ibuf; /* for ints */ int ibuf_alloc; - gmx_large_int_t *libuf; + gmx_int64_t *libuf; int libuf_alloc; float *fbuf; /* for floats */ @@ -215,7 +215,7 @@ typedef struct { gmx_domdec_comm_p_t comm; /* The partioning count, to keep track of the state */ - gmx_large_int_t ddp_count; + gmx_int64_t ddp_count; /* gmx_pme_recv_f buffer */ diff --git a/src/gromacs/legacyheaders/types/inputrec.h b/src/gromacs/legacyheaders/types/inputrec.h index c773cbb547..54fa1dfaff 100644 --- a/src/gromacs/legacyheaders/types/inputrec.h +++ b/src/gromacs/legacyheaders/types/inputrec.h @@ -292,9 +292,9 @@ typedef struct { typedef struct { int eI; /* Integration method */ - gmx_large_int_t nsteps; /* number of steps to be taken */ + gmx_int64_t nsteps; /* number of steps to be taken */ int simulation_part; /* Used in checkpointing to separate chunks */ - gmx_large_int_t init_step; /* start at a stepcount >0 (used w. tpbconv) */ + gmx_int64_t init_step; /* start at a stepcount >0 (used w. tpbconv) */ int nstcalcenergy; /* frequency of energy calc. and T/P coupl. upd. */ int cutoff_scheme; /* group or verlet cutoffs */ int ns_type; /* which ns method should we use? */ diff --git a/src/gromacs/legacyheaders/types/nlistheuristics.h b/src/gromacs/legacyheaders/types/nlistheuristics.h index 41db81a45f..07fcd641e2 100644 --- a/src/gromacs/legacyheaders/types/nlistheuristics.h +++ b/src/gromacs/legacyheaders/types/nlistheuristics.h @@ -46,9 +46,9 @@ extern "C" { typedef struct { gmx_bool bGStatEveryStep; - gmx_large_int_t step_ns; - gmx_large_int_t step_nscheck; - gmx_large_int_t nns; + gmx_int64_t step_ns; + gmx_int64_t step_nscheck; + gmx_int64_t nns; matrix scale_tot; int nabnsb; double s1; @@ -58,14 +58,14 @@ typedef struct { double lt_runav2; } gmx_nlheur_t; -void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_large_int_t step); +void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_int64_t step); void init_nlistheuristics(gmx_nlheur_t *nlh, - gmx_bool bGStatEveryStep, gmx_large_int_t step); + gmx_bool bGStatEveryStep, gmx_int64_t step); -void update_nliststatistics(gmx_nlheur_t *nlh, gmx_large_int_t step); +void update_nliststatistics(gmx_nlheur_t *nlh, gmx_int64_t step); -void set_nlistheuristics(gmx_nlheur_t *nlh, gmx_bool bReset, gmx_large_int_t step); +void set_nlistheuristics(gmx_nlheur_t *nlh, gmx_bool bReset, gmx_int64_t step); #ifdef __cplusplus } diff --git a/src/gromacs/legacyheaders/types/simple.h b/src/gromacs/legacyheaders/types/simple.h index a58ca74fd8..55d77aff5d 100644 --- a/src/gromacs/legacyheaders/types/simple.h +++ b/src/gromacs/legacyheaders/types/simple.h @@ -51,6 +51,12 @@ /* Information about integer data type sizes */ #include +#define __STDC_LIMIT_MACROS +#include +#ifndef _MSC_VER +#define __STDC_FORMAT_MACROS +#include +#endif #ifdef __cplusplus extern "C" { @@ -154,68 +160,51 @@ typedef int ivec[DIM]; typedef int imatrix[DIM][DIM]; +#ifdef _MSC_VER +typedef __int32 gmx_int32_t; +#define GMX_PRId32 "I32d" +#define GMX_SCNd32 "I32d" -/* For the step count type gmx_large_int_t we aim for 8 bytes (64bit), - * but we might only be able to get 4 bytes (32bit). - * - * We first try to find a type without reyling on any SIZEOF_XXX defines. - * - * Avoid using "long int" if we can. This type is really dangerous, - * since the width frequently depends on compiler options, and they - * might not be set correctly when (buggy) Cmake is detecting things. - * Instead, start by looking for "long long", and just go down if we - * have to (rarely on new systems). /EL 20100810 - */ -#if ( (defined SIZEOF_LONG_LONG_INT && SIZEOF_LONG_LONG_INT == 8) || (defined LLONG_MAX && LLONG_MAX == 9223372036854775807LL) ) - -/* Long long int is 64 bit */ -typedef long long int gmx_large_int_t; -#define gmx_large_int_fmt "lld" -#define gmx_large_int_pfmt "%lld" -#define SIZEOF_GMX_LARGE_INT 8 -#define GMX_LARGE_INT_MAX 9223372036854775807LL -#define GMX_LARGE_INT_MIN (-GMX_LARGE_INT_MAX - 1LL) -#define GMX_MPI_LARGE_INT MPI_LONG_LONG_INT - -#elif ( (defined SIZEOF_LONG_INT && SIZEOF_LONG_INT == 8) || (defined LONG_MAX && LONG_MAX == 9223372036854775807L) ) - -/* Long int is 64 bit */ -typedef long int gmx_large_int_t; -#define gmx_large_int_fmt "ld" -#define gmx_large_int_pfmt "%ld" -#define SIZEOF_GMX_LARGE_INT 8 -#define GMX_LARGE_INT_MAX 9223372036854775807LL -#define GMX_LARGE_INT_MIN (-GMX_LARGE_INT_MAX - 1LL) -#define GMX_MPI_LARGE_INT MPI_LONG_INT - -#elif ( (defined SIZEOF_INT && SIZEOF_INT == 8) || (defined INT_MAX && INT_MAX == 9223372036854775807L) ) - -/* int is 64 bit */ -typedef int gmx_large_int_t; -#define gmx_large_int_fmt "d" -#define gmx_large_int_pfmt "%d" -#define SIZEOF_GMX_LARGE_INT 8 -#define GMX_LARGE_INT_MAX 9223372036854775807LL -#define GMX_LARGE_INT_MIN (-GMX_LARGE_INT_MAX - 1LL) -#define GMX_MPI_LARGE_INT MPI_INT - -#elif ( (defined INT_MAX && INT_MAX == 2147483647) || (defined SIZEOF_INT && SIZEOF_INT == 4) ) - -/* None of the above worked, try a 32 bit integer */ -typedef int gmx_large_int_t; -#define gmx_large_int_fmt "d" -#define gmx_large_int_pfmt "%d" -#define SIZEOF_GMX_LARGE_INT 4 -#define GMX_LARGE_INT_MAX 2147483647 -#define GMX_LARGE_INT_MIN (-GMX_LARGE_INT_MAX - 1) -#define GMX_MPI_LARGE_INT MPI_INT +typedef __int64 gmx_int64_t; +#define GMX_PRId64 "I64d" +#define GMX_SCNd64 "I64d" + +typedef unsigned __int32 gmx_uint32_t; +#define GMX_PRIu32 "U32d" +#define GMX_SCNu32 "U32d" +typedef unsigned __int64 gmx_uint64_t; +#define GMX_PRIu64 "U64d" +#define GMX_SCNu64 "U64d" #else +typedef int32_t gmx_int32_t; +#define GMX_PRId32 PRId32 +#define GMX_SCNd32 SCNd32 -#error "Cannot find any 32 or 64 bit integer data type. Please extend the gromacs simple.h file!" +typedef int64_t gmx_int64_t; +#define GMX_PRId64 PRId64 +#define GMX_SCNd64 SCNd64 +typedef uint32_t gmx_uint32_t; +#define GMX_PRIu32 PRIu32 +#define GMX_SCNu32 SCNu32 + +typedef uint64_t gmx_uint64_t; +#define GMX_PRIu64 PRIu64 +#define GMX_SCNu64 SCNu64 #endif +#define GMX_INT32_MAX INT32_MAX +#define GMX_INT32_MIN INT32_MIN + +#define GMX_INT64_MAX INT64_MAX +#define GMX_INT64_MIN INT64_MIN + +#define GMX_UINT32_MAX UINT32_MAX +#define GMX_UINT32_MIN UINT32_MIN + +#define GMX_UINT64_MAX UINT64_MAX +#define GMX_UINT64_MIN UINT64_MIN #ifndef gmx_inline /* config.h tests for inline definitions and should work on a much wider range diff --git a/src/gromacs/legacyheaders/types/state.h b/src/gromacs/legacyheaders/types/state.h index 92fe106dd0..2d434e71cb 100644 --- a/src/gromacs/legacyheaders/types/state.h +++ b/src/gromacs/legacyheaders/types/state.h @@ -143,13 +143,13 @@ typedef struct typedef struct { - gmx_large_int_t nsteps; /* The number of steps in the history */ - gmx_large_int_t nsum; /* The nr. of steps in the ener_ave and ener_sum */ + gmx_int64_t nsteps; /* The number of steps in the history */ + gmx_int64_t nsum; /* The nr. of steps in the ener_ave and ener_sum */ double * ener_ave; /* Energy term history sum to get fluctuations */ double * ener_sum; /* Energy term history sum to get fluctuations */ int nener; /* Number of energy terms in two previous arrays */ - gmx_large_int_t nsteps_sim; /* The number of steps in ener_sum_sim */ - gmx_large_int_t nsum_sim; /* The number of frames in ener_sum_sim */ + gmx_int64_t nsteps_sim; /* The number of steps in ener_sum_sim */ + gmx_int64_t nsum_sim; /* The number of frames in ener_sum_sim */ double * ener_sum_sim; /* Energy term history sum of the whole sim */ delta_h_history_t *dht; /* The BAR energy differences */ diff --git a/src/gromacs/legacyheaders/update.h b/src/gromacs/legacyheaders/update.h index a035acf91a..02136afd12 100644 --- a/src/gromacs/legacyheaders/update.h +++ b/src/gromacs/legacyheaders/update.h @@ -64,9 +64,9 @@ void set_stochd_state(gmx_update_t sd, t_state *state); * as a reference state for simulations with box deformation. */ void set_deform_reference_box(gmx_update_t upd, - gmx_large_int_t step, matrix box); + gmx_int64_t step, matrix box); -void update_tcouple(gmx_large_int_t step, +void update_tcouple(gmx_int64_t step, t_inputrec *inputrec, t_state *state, gmx_ekindata_t *ekind, @@ -76,7 +76,7 @@ void update_tcouple(gmx_large_int_t step, ); void update_pcouple(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_inputrec *inputrec, t_state *state, matrix pcoupl_mu, @@ -84,7 +84,7 @@ void update_pcouple(FILE *fplog, gmx_bool bInitStep); void update_coords(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, t_state *state, @@ -105,10 +105,10 @@ void update_coords(FILE *fplog, /* Return TRUE if OK, FALSE in case of Shake Error */ -extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_large_int_t step, t_mdatoms *md, t_state *state, gmx_update_t upd, t_idef *idef, gmx_constr_t constr); +extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, t_mdatoms *md, t_state *state, gmx_update_t upd, t_idef *idef, gmx_constr_t constr); void update_constraints(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, real *dvdlambda, /* FEP stuff */ t_inputrec *inputrec, /* input record and box stuff */ gmx_ekindata_t *ekind, @@ -131,7 +131,7 @@ void update_constraints(FILE *fplog, /* Return TRUE if OK, FALSE in case of Shake Error */ void update_box(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, t_state *state, @@ -182,7 +182,7 @@ t_state *init_bufstate(const t_state *template_state); void destroy_bufstate(t_state *state); -void trotter_update(t_inputrec *ir, gmx_large_int_t step, gmx_ekindata_t *ekind, +void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind, gmx_enerdata_t *enerd, t_state *state, tensor vir, t_mdatoms *md, t_extmass *MassQ, int **trotter_seqlist, int trotter_seqno); @@ -218,13 +218,13 @@ real calc_pres(int ePBC, int nwall, matrix box, tensor ekin, tensor vir, * The unit of pressure is bar. */ -void parrinellorahman_pcoupl(FILE *fplog, gmx_large_int_t step, +void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step, t_inputrec *ir, real dt, tensor pres, tensor box, tensor box_rel, tensor boxv, tensor M, matrix mu, gmx_bool bFirstStep); -void berendsen_pcoupl(FILE *fplog, gmx_large_int_t step, +void berendsen_pcoupl(FILE *fplog, gmx_int64_t step, t_inputrec *ir, real dt, tensor pres, matrix box, matrix mu); diff --git a/src/gromacs/mdlib/clincs.c b/src/gromacs/mdlib/clincs.c index b2f48afca2..240c3d5f6e 100644 --- a/src/gromacs/mdlib/clincs.c +++ b/src/gromacs/mdlib/clincs.c @@ -1471,7 +1471,7 @@ static void cconerr(gmx_domdec_t *dd, gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner, t_inputrec *ir, - gmx_large_int_t step, + gmx_int64_t step, struct gmx_lincsdata *lincsd, t_mdatoms *md, t_commrec *cr, rvec *x, rvec *xprime, rvec *min_proj, diff --git a/src/gromacs/mdlib/constr.c b/src/gromacs/mdlib/constr.c index 695015bcd0..af425d5e06 100644 --- a/src/gromacs/mdlib/constr.c +++ b/src/gromacs/mdlib/constr.c @@ -265,7 +265,7 @@ static void write_constr_pdb(const char *fn, const char *title, gmx_fio_fclose(out); } -static void dump_confs(FILE *fplog, gmx_large_int_t step, gmx_mtop_t *mtop, +static void dump_confs(FILE *fplog, gmx_int64_t step, gmx_mtop_t *mtop, int start, int homenr, t_commrec *cr, rvec x[], rvec xprime[], matrix box) { @@ -307,7 +307,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner, struct gmx_constr *constr, t_idef *idef, t_inputrec *ir, gmx_ekindata_t *ekind, t_commrec *cr, - gmx_large_int_t step, int delta_step, + gmx_int64_t step, int delta_step, t_mdatoms *md, rvec *x, rvec *xprime, rvec *min_proj, gmx_bool bMolPBC, matrix box, @@ -583,7 +583,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner, { char buf[256]; sprintf(buf, - "\nstep " gmx_large_int_pfmt ": Water molecule starting at atom %d can not be " + "\nstep " "%"GMX_PRId64 ": Water molecule starting at atom %d can not be " "settled.\nCheck for bad contacts and/or reduce the timestep if appropriate.\n", step, ddglatnr(cr->dd, settle->iatoms[settle_error*(1+NRAL(F_SETTLE))+1])); if (fplog) diff --git a/src/gromacs/mdlib/coupling.c b/src/gromacs/mdlib/coupling.c index bd20652e75..62c3b0bc88 100644 --- a/src/gromacs/mdlib/coupling.c +++ b/src/gromacs/mdlib/coupling.c @@ -326,7 +326,7 @@ real calc_temp(real ekin, real nrdf) } } -void parrinellorahman_pcoupl(FILE *fplog, gmx_large_int_t step, +void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step, t_inputrec *ir, real dt, tensor pres, tensor box, tensor box_rel, tensor boxv, tensor M, matrix mu, gmx_bool bFirstStep) @@ -524,7 +524,7 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_large_int_t step, mmul_ur0(invbox, t1, mu); } -void berendsen_pcoupl(FILE *fplog, gmx_large_int_t step, +void berendsen_pcoupl(FILE *fplog, gmx_int64_t step, t_inputrec *ir, real dt, tensor pres, matrix box, matrix mu) { @@ -964,7 +964,7 @@ void destroy_bufstate(t_state *state) sfree(state); } -void trotter_update(t_inputrec *ir, gmx_large_int_t step, gmx_ekindata_t *ekind, +void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind, gmx_enerdata_t *enerd, t_state *state, tensor vir, t_mdatoms *md, t_extmass *MassQ, int **trotter_seqlist, int trotter_seqno) @@ -973,7 +973,7 @@ void trotter_update(t_inputrec *ir, gmx_large_int_t step, gmx_ekindata_t *ekind, int n, i, j, d, ntgrp, ngtc, gc = 0; t_grp_tcstat *tcstat; t_grpopts *opts; - gmx_large_int_t step_eff; + gmx_int64_t step_eff; real ecorr, pcorr, dvdlcorr; real bmass, qmass, reft, kT, dt, nd; tensor dumpres, dumvir; diff --git a/src/gromacs/mdlib/domdec.c b/src/gromacs/mdlib/domdec.c index ef1bd7e9a4..6e4cc689cb 100644 --- a/src/gromacs/mdlib/domdec.c +++ b/src/gromacs/mdlib/domdec.c @@ -399,7 +399,7 @@ typedef struct gmx_domdec_comm double load_pme; /* The last partition step */ - gmx_large_int_t partition_step; + gmx_int64_t partition_step; /* Debugging */ int nstDDDump; @@ -1971,7 +1971,7 @@ static char dim2char(int dim) return c; } -static void write_dd_grid_pdb(const char *fn, gmx_large_int_t step, +static void write_dd_grid_pdb(const char *fn, gmx_int64_t step, gmx_domdec_t *dd, matrix box, gmx_ddbox_t *ddbox) { rvec grid_s[2], *grid_r = NULL, cx, r; @@ -2060,7 +2060,7 @@ static void write_dd_grid_pdb(const char *fn, gmx_large_int_t step, } } -void write_dd_pdb(const char *fn, gmx_large_int_t step, const char *title, +void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title, gmx_mtop_t *mtop, t_commrec *cr, int natoms, rvec x[], matrix box) { @@ -2828,7 +2828,7 @@ static real grid_jump_limit(gmx_domdec_comm_t *comm, real cutoff, return grid_jump_limit; } -static gmx_bool check_grid_jump(gmx_large_int_t step, +static gmx_bool check_grid_jump(gmx_int64_t step, gmx_domdec_t *dd, real cutoff, gmx_ddbox_t *ddbox, @@ -3241,7 +3241,7 @@ static void set_dd_cell_sizes_slb(gmx_domdec_t *dd, gmx_ddbox_t *ddbox, static void dd_cell_sizes_dlb_root_enforce_limits(gmx_domdec_t *dd, int d, int dim, gmx_domdec_root_t *root, gmx_ddbox_t *ddbox, - gmx_bool bUniform, gmx_large_int_t step, real cellsize_limit_f, int range[]) + gmx_bool bUniform, gmx_int64_t step, real cellsize_limit_f, int range[]) { gmx_domdec_comm_t *comm; int ncd, i, j, nmin, nmin_old; @@ -3452,7 +3452,7 @@ static void dd_cell_sizes_dlb_root_enforce_limits(gmx_domdec_t *dd, static void set_dd_cell_sizes_dlb_root(gmx_domdec_t *dd, int d, int dim, gmx_domdec_root_t *root, gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_large_int_t step) + gmx_bool bUniform, gmx_int64_t step) { gmx_domdec_comm_t *comm; int ncd, d1, i, j, pos; @@ -3677,7 +3677,7 @@ static void distribute_dd_cell_sizes_dlb(gmx_domdec_t *dd, static void set_dd_cell_sizes_dlb_change(gmx_domdec_t *dd, gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_large_int_t step) + gmx_bool bUniform, gmx_int64_t step) { gmx_domdec_comm_t *comm; int d, dim, d1; @@ -3737,7 +3737,7 @@ static void set_dd_cell_sizes_dlb_nochange(gmx_domdec_t *dd, gmx_ddbox_t *ddbox) static void set_dd_cell_sizes_dlb(gmx_domdec_t *dd, gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_bool bDoDLB, gmx_large_int_t step, + gmx_bool bUniform, gmx_bool bDoDLB, gmx_int64_t step, gmx_wallcycle_t wcycle) { gmx_domdec_comm_t *comm; @@ -3807,7 +3807,7 @@ static void realloc_comm_ind(gmx_domdec_t *dd, ivec npulse) static void set_dd_cell_sizes(gmx_domdec_t *dd, gmx_ddbox_t *ddbox, gmx_bool bDynamicBox, - gmx_bool bUniform, gmx_bool bDoDLB, gmx_large_int_t step, + gmx_bool bUniform, gmx_bool bDoDLB, gmx_int64_t step, gmx_wallcycle_t wcycle) { gmx_domdec_comm_t *comm; @@ -3847,7 +3847,7 @@ static void set_dd_cell_sizes(gmx_domdec_t *dd, static void comm_dd_ns_cell_sizes(gmx_domdec_t *dd, gmx_ddbox_t *ddbox, rvec cell_ns_x0, rvec cell_ns_x1, - gmx_large_int_t step) + gmx_int64_t step) { gmx_domdec_comm_t *comm; int dim_ind, dim; @@ -3923,7 +3923,7 @@ static void check_screw_box(matrix box) } } -static void distribute_cg(FILE *fplog, gmx_large_int_t step, +static void distribute_cg(FILE *fplog, gmx_int64_t step, matrix box, ivec tric_dir, t_block *cgs, rvec pos[], gmx_domdec_t *dd) { @@ -4088,7 +4088,7 @@ static void distribute_cg(FILE *fplog, gmx_large_int_t step, } } -static void get_cg_distribution(FILE *fplog, gmx_large_int_t step, gmx_domdec_t *dd, +static void get_cg_distribution(FILE *fplog, gmx_int64_t step, gmx_domdec_t *dd, t_block *cgs, matrix box, gmx_ddbox_t *ddbox, rvec pos[]) { @@ -4356,7 +4356,7 @@ static void clear_and_mark_ind(int ncg, int *move, static void print_cg_move(FILE *fplog, gmx_domdec_t *dd, - gmx_large_int_t step, int cg, int dim, int dir, + gmx_int64_t step, int cg, int dim, int dir, gmx_bool bHaveLimitdAndCMOld, real limitd, rvec cm_old, rvec cm_new, real pos_d) { @@ -4395,7 +4395,7 @@ static void print_cg_move(FILE *fplog, static void cg_move_error(FILE *fplog, gmx_domdec_t *dd, - gmx_large_int_t step, int cg, int dim, int dir, + gmx_int64_t step, int cg, int dim, int dir, gmx_bool bHaveLimitdAndCMOld, real limitd, rvec cm_old, rvec cm_new, real pos_d) { @@ -4463,7 +4463,7 @@ static int *get_moved(gmx_domdec_comm_t *comm, int natoms) return comm->moved; } -static void calc_cg_move(FILE *fplog, gmx_large_int_t step, +static void calc_cg_move(FILE *fplog, gmx_int64_t step, gmx_domdec_t *dd, t_state *state, ivec tric_dir, matrix tcm, @@ -4638,7 +4638,7 @@ static void calc_cg_move(FILE *fplog, gmx_large_int_t step, } } -static void dd_redistribute_cg(FILE *fplog, gmx_large_int_t step, +static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step, gmx_domdec_t *dd, ivec tric_dir, t_state *state, rvec **f, t_forcerec *fr, @@ -5567,7 +5567,7 @@ float dd_pme_f_ratio(gmx_domdec_t *dd) } } -static void dd_print_load(FILE *fplog, gmx_domdec_t *dd, gmx_large_int_t step) +static void dd_print_load(FILE *fplog, gmx_domdec_t *dd, gmx_int64_t step) { int flags, d; char buf[22]; @@ -7080,7 +7080,7 @@ static void set_dlb_limits(gmx_domdec_t *dd) } -static void turn_on_dlb(FILE *fplog, t_commrec *cr, gmx_large_int_t step) +static void turn_on_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step) { gmx_domdec_t *dd; gmx_domdec_comm_t *comm; @@ -9274,7 +9274,7 @@ void print_dd_statistics(t_commrec *cr, t_inputrec *ir, FILE *fplog) } void dd_partition_system(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_commrec *cr, gmx_bool bMasterState, int nstglobalcomm, @@ -9297,7 +9297,7 @@ void dd_partition_system(FILE *fplog, gmx_domdec_comm_t *comm; gmx_ddbox_t ddbox = {0}; t_block *cgs_gl; - gmx_large_int_t step_pcoupl; + gmx_int64_t step_pcoupl; rvec cell_ns_x0, cell_ns_x1; int i, j, n, ncgindex_set, ncg_home_old = -1, ncg_moved, nat_f_novirsum; gmx_bool bBoxChanged, bNStGlobalComm, bDoDLB, bCheckDLB, bTurnOnDLB, bLogLoad; diff --git a/src/gromacs/mdlib/domdec_setup.c b/src/gromacs/mdlib/domdec_setup.c index 10b45e5a81..76023e73ff 100644 --- a/src/gromacs/mdlib/domdec_setup.c +++ b/src/gromacs/mdlib/domdec_setup.c @@ -663,7 +663,7 @@ real dd_choose_grid(FILE *fplog, real cellsize_limit, real cutoff_dd, gmx_bool bInterCGBondeds) { - gmx_large_int_t nnodes_div, ldiv; + gmx_int64_t nnodes_div, ldiv; real limit; if (MASTER(cr)) diff --git a/src/gromacs/mdlib/edsam.c b/src/gromacs/mdlib/edsam.c index e27b2bdc3d..d0bccbc811 100644 --- a/src/gromacs/mdlib/edsam.c +++ b/src/gromacs/mdlib/edsam.c @@ -792,7 +792,7 @@ static void write_edo_flood(t_edpar *edi, FILE *fp, real rmsd) /* From flood.xproj compute the Vfl(x) at this point */ -static real flood_energy(t_edpar *edi, gmx_large_int_t step) +static real flood_energy(t_edpar *edi, gmx_int64_t step) { /* compute flooding energy Vfl Vfl = Efl * exp( - \frac {kT} {2Efl alpha^2} * sum_i { \lambda_i c_i^2 } ) @@ -940,7 +940,7 @@ static void do_single_flood( rvec x[], rvec force[], t_edpar *edi, - gmx_large_int_t step, + gmx_int64_t step, matrix box, t_commrec *cr, gmx_bool bNS) /* Are we in a neighbor searching step? */ @@ -1047,7 +1047,7 @@ extern void do_flood( rvec force[], /* forcefield forces, to these the flooding forces are added */ gmx_edsam_t ed, /* ed data structure contains all ED and flooding groups */ matrix box, /* the box */ - gmx_large_int_t step, /* The relative time step since ir->init_step is already subtracted */ + gmx_int64_t step, /* The relative time step since ir->init_step is already subtracted */ gmx_bool bNS) /* Are we in a neighbor searching step? */ { t_edpar *edi; @@ -1940,7 +1940,7 @@ static inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec } -static void do_linfix(rvec *xcoll, t_edpar *edi, gmx_large_int_t step) +static void do_linfix(rvec *xcoll, t_edpar *edi, gmx_int64_t step) { int i, j; real proj, add; @@ -2190,7 +2190,7 @@ static void do_radcon(rvec *xcoll, t_edpar *edi) } -static void ed_apply_constraints(rvec *xcoll, t_edpar *edi, gmx_large_int_t step) +static void ed_apply_constraints(rvec *xcoll, t_edpar *edi, gmx_int64_t step) { int i; @@ -2985,7 +2985,7 @@ void init_edsam(gmx_mtop_t *mtop, /* global topology */ void do_edsam(t_inputrec *ir, - gmx_large_int_t step, + gmx_int64_t step, t_commrec *cr, rvec xs[], /* The local current positions on this processor */ rvec v[], /* The velocities */ diff --git a/src/gromacs/mdlib/expanded.c b/src/gromacs/mdlib/expanded.c index 4a8f1ba91b..d9511ae6ac 100644 --- a/src/gromacs/mdlib/expanded.c +++ b/src/gromacs/mdlib/expanded.c @@ -93,7 +93,7 @@ extern void init_expanded_ensemble(gmx_bool bStateFromCP, t_inputrec *ir, gmx_rn *mcrng = gmx_rng_init(ir->expandedvals->lmc_seed); if (!bStateFromCP) { - init_df_history_weights(dfhist,ir->expandedvals,ir->fepvals->n_lambda); + init_df_history_weights(dfhist, ir->expandedvals, ir->fepvals->n_lambda); } } @@ -261,7 +261,7 @@ static gmx_bool CheckHistogramRatios(int nhisto, real *histo, real ratio) return bIfFlat; } -static gmx_bool CheckIfDoneEquilibrating(int nlim, t_expanded *expand, df_history_t *dfhist, gmx_large_int_t step) +static gmx_bool CheckIfDoneEquilibrating(int nlim, t_expanded *expand, df_history_t *dfhist, gmx_int64_t step) { int i, totalsamples; @@ -363,7 +363,7 @@ static gmx_bool CheckIfDoneEquilibrating(int nlim, t_expanded *expand, df_histor } static gmx_bool UpdateWeights(int nlim, t_expanded *expand, df_history_t *dfhist, - int fep_state, real *scaled_lamee, real *weighted_lamee, gmx_large_int_t step) + int fep_state, real *scaled_lamee, real *weighted_lamee, gmx_int64_t step) { real maxdiff = 0.000000001; gmx_bool bSufficientSamples; @@ -376,7 +376,7 @@ static gmx_bool UpdateWeights(int nlim, t_expanded *expand, df_history_t *dfhist real clam_varm, clam_varp, clam_weightsm, clam_weightsp, clam_minvar; real *lam_weights, *lam_minvar_corr, *lam_variance, *lam_dg; double *p_k; - double pks = 0; + double pks = 0; real *numweighted_lamee, *logfrac; int *nonzero; real chi_m1_0, chi_p1_0, chi_m2_0, chi_p2_0, chi_p1_m1, chi_p2_m1, chi_m1_p1, chi_m2_p1; @@ -922,7 +922,7 @@ static int ChooseNewLambda(int nlim, t_expanded *expand, df_history_t *dfhist, i if (lamnew > maxfep) { /* it's possible some rounding is failing */ - if (gmx_within_tol(remainder[fep_state],0,50*GMX_DOUBLE_EPS)) + if (gmx_within_tol(remainder[fep_state], 0, 50*GMX_DOUBLE_EPS)) { /* numerical rounding error -- no state other than the original has weight */ lamnew = fep_state; @@ -1027,7 +1027,7 @@ static int ChooseNewLambda(int nlim, t_expanded *expand, df_history_t *dfhist, i /* print out the weights to the log, along with current state */ extern void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist, - int fep_state, int frequency, gmx_large_int_t step) + int fep_state, int frequency, gmx_int64_t step) { int nlim, i, ifep, jfep; real dw, dg, dv, dm, Tprint; @@ -1209,7 +1209,7 @@ extern void set_mc_state(gmx_rng_t rng, t_state *state) extern int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd, t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist, - gmx_large_int_t step, gmx_rng_t mcrng, + gmx_int64_t step, gmx_rng_t mcrng, rvec *v, t_mdatoms *mdatoms) /* Note that the state variable is only needed for simulated tempering, not Hamiltonian expanded ensemble. May be able to remove it after integrator refactoring. */ diff --git a/src/gromacs/mdlib/force.c b/src/gromacs/mdlib/force.c index e4173975ed..c328a7eddb 100644 --- a/src/gromacs/mdlib/force.c +++ b/src/gromacs/mdlib/force.c @@ -143,7 +143,7 @@ void gmx_print_sepdvdl(FILE *fplog, const char *s, real v, real dvdlambda) fprintf(fplog, " %-30s V %12.5e dVdl %12.5e\n", s, v, dvdlambda); } -void do_force_lowlevel(FILE *fplog, gmx_large_int_t step, +void do_force_lowlevel(FILE *fplog, gmx_int64_t step, t_forcerec *fr, t_inputrec *ir, t_idef *idef, t_commrec *cr, t_nrnb *nrnb, gmx_wallcycle_t wcycle, diff --git a/src/gromacs/mdlib/md_support.c b/src/gromacs/mdlib/md_support.c index 1a3e7dd36e..d60e052d9f 100644 --- a/src/gromacs/mdlib/md_support.c +++ b/src/gromacs/mdlib/md_support.c @@ -56,14 +56,14 @@ gmx_bool gs_simlocal[eglsNR] = { TRUE, FALSE, FALSE, TRUE }; /* check which of the multisim simulations has the shortest number of steps and return that number of nsteps */ -gmx_large_int_t get_multisim_nsteps(const t_commrec *cr, - gmx_large_int_t nsteps) +gmx_int64_t get_multisim_nsteps(const t_commrec *cr, + gmx_int64_t nsteps) { - gmx_large_int_t steps_out; + gmx_int64_t steps_out; - if MASTER(cr) + if (MASTER(cr)) { - gmx_large_int_t *buf; + gmx_int64_t *buf; int s; snew(buf, cr->ms->nsim); @@ -86,12 +86,12 @@ gmx_large_int_t get_multisim_nsteps(const t_commrec *cr, if (steps_out >= 0 && steps_out < nsteps) { char strbuf[255]; - snprintf(strbuf, 255, "Will stop simulation %%d after %s steps (another simulation will end then).\n", gmx_large_int_pfmt); + snprintf(strbuf, 255, "Will stop simulation %%d after %s steps (another simulation will end then).\n", "%"GMX_PRId64); fprintf(stderr, strbuf, cr->ms->sim, steps_out); } } /* broadcast to non-masters */ - gmx_bcast(sizeof(gmx_large_int_t), &steps_out, cr); + gmx_bcast(sizeof(gmx_int64_t), &steps_out, cr); return steps_out; } @@ -507,7 +507,7 @@ void check_nst_param(FILE *fplog, t_commrec *cr, } } -void set_current_lambdas(gmx_large_int_t step, t_lambda *fepvals, gmx_bool bRerunMD, +void set_current_lambdas(gmx_int64_t step, t_lambda *fepvals, gmx_bool bRerunMD, t_trxframe *rerun_fr, t_state *state_global, t_state *state, double lam0[]) /* find the current lambdas. If rerunning, we either read in a state, or a lambda value, requiring different logic. */ @@ -518,7 +518,7 @@ void set_current_lambdas(gmx_large_int_t step, t_lambda *fepvals, gmx_bool bReru { if (rerun_fr->bLambda) { - if (fepvals->delta_lambda==0) + if (fepvals->delta_lambda == 0) { state_global->lambda[efptFEP] = rerun_fr->lambda; for (i = 0; i < efptNR; i++) @@ -581,7 +581,8 @@ void set_current_lambdas(gmx_large_int_t step, t_lambda *fepvals, gmx_bool bReru } else { - if (state->fep_state > 0) { + if (state->fep_state > 0) + { state_global->fep_state = state->fep_state; /* state->fep is the one updated by bExpanded */ for (i = 0; i < efptNR; i++) { diff --git a/src/gromacs/mdlib/mdebin.c b/src/gromacs/mdlib/mdebin.c index 51e22f3c00..e93537b986 100644 --- a/src/gromacs/mdlib/mdebin.c +++ b/src/gromacs/mdlib/mdebin.c @@ -1302,7 +1302,7 @@ static void pprint(FILE *log, const char *s, t_mdebin *md) fprintf(log, "\n"); } -void print_ebin_header(FILE *log, gmx_large_int_t steps, double time, real lambda) +void print_ebin_header(FILE *log, gmx_int64_t steps, double time, real lambda) { char buf[22]; @@ -1313,7 +1313,7 @@ void print_ebin_header(FILE *log, gmx_large_int_t steps, double time, real lambd void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR, FILE *log, - gmx_large_int_t step, double time, + gmx_int64_t step, double time, int mode, gmx_bool bCompact, t_mdebin *md, t_fcdata *fcd, gmx_groups_t *groups, t_grpopts *opts) diff --git a/src/gromacs/mdlib/mdebin_bar.c b/src/gromacs/mdlib/mdebin_bar.c index a1803f7af2..e4a722be31 100644 --- a/src/gromacs/mdlib/mdebin_bar.c +++ b/src/gromacs/mdlib/mdebin_bar.c @@ -159,7 +159,7 @@ static void mde_delta_h_make_hist(t_mde_delta_h *dh, int hi, gmx_bool invert) Get this start value in number of histogram dxs from zero, as an integer.*/ - dh->x0[hi] = (gmx_large_int_t)floor(min_dh/dx); + dh->x0[hi] = (gmx_int64_t)floor(min_dh/dx); min_dh_hist = (dh->x0[hi])*dx; max_dh_hist = (dh->x0[hi] + dh->nbins + 1)*dx; diff --git a/src/gromacs/mdlib/mdebin_bar.h b/src/gromacs/mdlib/mdebin_bar.h index 85435ba186..90c85b58e4 100644 --- a/src/gromacs/mdlib/mdebin_bar.h +++ b/src/gromacs/mdlib/mdebin_bar.h @@ -63,8 +63,8 @@ typedef struct double dx; /* the histogram spacing in kJ/mol. This is the same for the two histograms? */ unsigned int nbins; /* the number of bins in the histograms*/ - gmx_large_int_t x0[2]; /* the starting point in units of spacing - of the histogram */ + gmx_int64_t x0[2]; /* the starting point in units of spacing + of the histogram */ unsigned int maxbin[2]; /* highest bin number with data */ int type; /* the block type according to dhbtDH, etc. */ @@ -74,8 +74,8 @@ typedef struct int nlambda; /* length of the lambda vector */ gmx_bool written; /* whether this data has already been written out */ - gmx_large_int_t subblock_meta_l[5]; /* metadata for an mdebin subblock for - I/O: for histogram counts, etc.*/ + gmx_int64_t subblock_meta_l[5]; /* metadata for an mdebin subblock for + I/O: for histogram counts, etc.*/ double *subblock_meta_d; /* metadata subblock for I/O, used for communicating doubles (i.e. the lambda vector) */ diff --git a/src/gromacs/mdlib/minimize.c b/src/gromacs/mdlib/minimize.c index 20f82a3407..09083dc693 100644 --- a/src/gromacs/mdlib/minimize.c +++ b/src/gromacs/mdlib/minimize.c @@ -169,7 +169,7 @@ static void warn_step(FILE *fp, real ftol, gmx_bool bLastStep, gmx_bool bConstra static void print_converged(FILE *fp, const char *alg, real ftol, - gmx_large_int_t count, gmx_bool bDone, gmx_large_int_t nsteps, + gmx_int64_t count, gmx_bool bDone, gmx_int64_t nsteps, real epot, real fmax, int nfmax, real fnorm) { char buf[STEPSTRSIZE]; @@ -500,7 +500,7 @@ static void write_em_traj(FILE *fplog, t_commrec *cr, gmx_mdoutf_t *outf, gmx_bool bX, gmx_bool bF, const char *confout, gmx_mtop_t *top_global, - t_inputrec *ir, gmx_large_int_t step, + t_inputrec *ir, gmx_int64_t step, em_state_t *state, t_state *state_global, rvec *f_global) { @@ -545,7 +545,7 @@ static void do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md, em_state_t *ems1, real a, rvec *f, em_state_t *ems2, gmx_constr_t constr, gmx_localtop_t *top, t_nrnb *nrnb, gmx_wallcycle_t wcycle, - gmx_large_int_t count) + gmx_int64_t count) { t_state *s1, *s2; @@ -689,7 +689,7 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr, t_graph *graph, t_mdatoms *mdatoms, t_forcerec *fr, rvec mu_tot, gmx_enerdata_t *enerd, tensor vir, tensor pres, - gmx_large_int_t count, gmx_bool bFirst) + gmx_int64_t count, gmx_bool bFirst) { real t; gmx_bool bNS; @@ -2609,7 +2609,7 @@ double do_nm(FILE *fplog, t_commrec *cr, rvec mu_tot; rvec *fneg, *dfdx; gmx_bool bSparse; /* use sparse matrix storage format */ - size_t sz=0; + size_t sz = 0; gmx_sparsematrix_t * sparse_matrix = NULL; real * full_matrix = NULL; em_state_t * state_work; diff --git a/src/gromacs/mdlib/nlistheuristics.c b/src/gromacs/mdlib/nlistheuristics.c index ea662d4da1..57e95efeff 100644 --- a/src/gromacs/mdlib/nlistheuristics.c +++ b/src/gromacs/mdlib/nlistheuristics.c @@ -42,7 +42,7 @@ #include "gmx_fatal.h" #include "vec.h" -void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_large_int_t step) +void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_int64_t step) { nlh->lt_runav = 0; nlh->lt_runav2 = 0; @@ -50,7 +50,7 @@ void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_large_int_t step) } void init_nlistheuristics(gmx_nlheur_t *nlh, - gmx_bool bGStatEveryStep, gmx_large_int_t step) + gmx_bool bGStatEveryStep, gmx_int64_t step) { nlh->bGStatEveryStep = bGStatEveryStep; nlh->nns = 0; @@ -62,9 +62,9 @@ void init_nlistheuristics(gmx_nlheur_t *nlh, reset_nlistheuristics(nlh, step); } -void update_nliststatistics(gmx_nlheur_t *nlh, gmx_large_int_t step) +void update_nliststatistics(gmx_nlheur_t *nlh, gmx_int64_t step) { - gmx_large_int_t nl_lt; + gmx_int64_t nl_lt; char sbuf[STEPSTRSIZE], sbuf2[STEPSTRSIZE]; /* Determine the neighbor list life time */ @@ -112,7 +112,7 @@ void update_nliststatistics(gmx_nlheur_t *nlh, gmx_large_int_t step) } } -void set_nlistheuristics(gmx_nlheur_t *nlh, gmx_bool bReset, gmx_large_int_t step) +void set_nlistheuristics(gmx_nlheur_t *nlh, gmx_bool bReset, gmx_int64_t step) { int d; diff --git a/src/gromacs/mdlib/pme.c b/src/gromacs/mdlib/pme.c index e9e976d748..acce761510 100644 --- a/src/gromacs/mdlib/pme.c +++ b/src/gromacs/mdlib/pme.c @@ -4546,7 +4546,7 @@ void gmx_pme_calc_energy(gmx_pme_t pme, int n, rvec *x, real *q, real *V) static void reset_pmeonly_counters(gmx_wallcycle_t wcycle, gmx_walltime_accounting_t walltime_accounting, t_nrnb *nrnb, t_inputrec *ir, - gmx_large_int_t step) + gmx_int64_t step) { /* Reset all the counters related to performance over the run */ wallcycle_stop(wcycle, ewcRUN); @@ -4622,7 +4622,7 @@ int gmx_pmeonly(gmx_pme_t pme, int count; gmx_bool bEnerVir; int pme_flags; - gmx_large_int_t step, step_rel; + gmx_int64_t step, step_rel; ivec grid_switch; /* This data will only use with PME tuning, i.e. switching PME grids */ diff --git a/src/gromacs/mdlib/pme_pp.c b/src/gromacs/mdlib/pme_pp.c index 65b64ca26e..c9cf63deaa 100644 --- a/src/gromacs/mdlib/pme_pp.c +++ b/src/gromacs/mdlib/pme_pp.c @@ -116,7 +116,7 @@ typedef struct gmx_pme_comm_n_box { real lambda_q; real lambda_lj; int flags; - gmx_large_int_t step; + gmx_int64_t step; ivec grid_size; /* For PME grid tuning */ real ewaldcoeff_q; /* For PME grid tuning */ real ewaldcoeff_lj; @@ -178,7 +178,7 @@ static void gmx_pme_send_params_coords(t_commrec *cr, int flags, matrix box, rvec gmx_unused *x, real lambda_q, real lambda_lj, int maxshift_x, int maxshift_y, - gmx_large_int_t step) + gmx_int64_t step) { gmx_domdec_t *dd; gmx_pme_comm_n_box_t *cnb; @@ -317,7 +317,7 @@ void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x, gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj, real lambda_q, real lambda_lj, gmx_bool bEnerVir, int pme_flags, - gmx_large_int_t step) + gmx_int64_t step) { int flags; @@ -370,7 +370,7 @@ void gmx_pme_send_switchgrid(t_commrec gmx_unused *cr, #endif } -void gmx_pme_send_resetcounters(t_commrec gmx_unused *cr, gmx_large_int_t gmx_unused step) +void gmx_pme_send_resetcounters(t_commrec gmx_unused *cr, gmx_int64_t gmx_unused step) { #ifdef GMX_MPI gmx_pme_comm_n_box_t cnb; @@ -407,7 +407,7 @@ int gmx_pme_recv_params_coords(struct gmx_pme_pp *pme_pp, real gmx_unused *lambda_lj, gmx_bool gmx_unused *bEnerVir, int *pme_flags, - gmx_large_int_t gmx_unused *step, + gmx_int64_t gmx_unused *step, ivec gmx_unused grid_size, real gmx_unused *ewaldcoeff_q, real gmx_unused *ewaldcoeff_lj) diff --git a/src/gromacs/mdlib/pull.c b/src/gromacs/mdlib/pull.c index 25a7024cdc..9e39e5f80e 100644 --- a/src/gromacs/mdlib/pull.c +++ b/src/gromacs/mdlib/pull.c @@ -106,7 +106,7 @@ static void pull_print_x(FILE *out, t_pull *pull, double t) } else { - pull_print_group_x(out, pull->dim, &pull->group[pcrd->group[0]]); + pull_print_group_x(out, pull->dim, &pull->group[pcrd->group[0]]); } } pull_print_coord_dr(out, pull->dim, pcrd); @@ -127,7 +127,7 @@ static void pull_print_f(FILE *out, t_pull *pull, double t) fprintf(out, "\n"); } -void pull_print_output(t_pull *pull, gmx_large_int_t step, double time) +void pull_print_output(t_pull *pull, gmx_int64_t step, double time) { if ((pull->nstxout != 0) && (step % pull->nstxout == 0)) { @@ -373,8 +373,8 @@ void get_pull_coord_distance(const t_pull *pull, const t_pbc *pbc, double t, dvec dr, double *dev) { - static gmx_bool bWarned = FALSE; /* TODO: this should be fixed for thread-safety, - but is fairly benign */ + static gmx_bool bWarned = FALSE; /* TODO: this should be fixed for thread-safety, + but is fairly benign */ const t_pull_coord *pcrd; int m; double ref, drs, inpr; @@ -444,19 +444,19 @@ static void do_constraint(t_pull *pull, t_pbc *pbc, double dt, double t) { - dvec *r_ij; /* x[i] com of i in prev. step. Obeys constr. -> r_ij[i] */ - dvec unc_ij; /* xp[i] com of i this step, before constr. -> unc_ij */ - dvec *rnew; /* current 'new' positions of the groups */ - double *dr_tot; /* the total update of the coords */ - double ref; - dvec vec; - double d0, inpr; - double lambda, rm, mass, invdt = 0; - gmx_bool bConverged_all, bConverged = FALSE; - int niter = 0, g, c, ii, j, m, max_iter = 100; - double a; - dvec f; /* the pull force */ - dvec tmp, tmp3; + dvec *r_ij; /* x[i] com of i in prev. step. Obeys constr. -> r_ij[i] */ + dvec unc_ij; /* xp[i] com of i this step, before constr. -> unc_ij */ + dvec *rnew; /* current 'new' positions of the groups */ + double *dr_tot; /* the total update of the coords */ + double ref; + dvec vec; + double d0, inpr; + double lambda, rm, mass, invdt = 0; + gmx_bool bConverged_all, bConverged = FALSE; + int niter = 0, g, c, ii, j, m, max_iter = 100; + double a; + dvec f; /* the pull force */ + dvec tmp, tmp3; t_pull_group *pdyna, *pgrp0, *pgrp1; t_pull_coord *pcrd; @@ -1141,7 +1141,7 @@ void init_pull(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[], bAbs = TRUE; } } - + fprintf(fplog, "\nWill apply %s COM pulling in geometry '%s'\n", EPULLTYPE(ir->ePull), EPULLGEOM(pull->eGeom)); fprintf(fplog, "with %d pull coordinate%s and %d group%s\n", diff --git a/src/gromacs/mdlib/pull_rotation.c b/src/gromacs/mdlib/pull_rotation.c index bb026b80c2..00dc82c0c5 100644 --- a/src/gromacs/mdlib/pull_rotation.c +++ b/src/gromacs/mdlib/pull_rotation.c @@ -309,19 +309,19 @@ static real get_fitangle(t_rotgrp *rotg, gmx_enfrotgrp_t erg) /* Reduce potential angle fit data for this group at this time step? */ -static gmx_inline gmx_bool bPotAngle(t_rot *rot, t_rotgrp *rotg, gmx_large_int_t step) +static gmx_inline gmx_bool bPotAngle(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step) { return ( (erotgFitPOT == rotg->eFittype) && (do_per_step(step, rot->nstsout) || do_per_step(step, rot->nstrout)) ); } /* Reduce slab torqe data for this group at this time step? */ -static gmx_inline gmx_bool bSlabTau(t_rot *rot, t_rotgrp *rotg, gmx_large_int_t step) +static gmx_inline gmx_bool bSlabTau(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step) { return ( (ISFLEX(rotg)) && do_per_step(step, rot->nstsout) ); } /* Output rotation energy, torques, etc. for each rotation group */ -static void reduce_output(t_commrec *cr, t_rot *rot, real t, gmx_large_int_t step) +static void reduce_output(t_commrec *cr, t_rot *rot, real t, gmx_int64_t step) { int g, i, islab, nslabs = 0; int count; /* MPI element counter */ @@ -480,7 +480,7 @@ static void reduce_output(t_commrec *cr, t_rot *rot, real t, gmx_large_int_t ste /* Add the forces from enforced rotation potential to the local forces. * Should be called after the SR forces have been evaluated */ -extern real add_rot_forces(t_rot *rot, rvec f[], t_commrec *cr, gmx_large_int_t step, real t) +extern real add_rot_forces(t_rot *rot, rvec f[], t_commrec *cr, gmx_int64_t step, real t) { int g, l, ii; t_rotgrp *rotg; @@ -1963,13 +1963,13 @@ static real do_flex2_lowlevel( /* Subtract the slab center from xj */ rvec_sub(xj, xcn, tmpvec2); /* tmpvec2 = xj - xcn */ - + /* In rare cases, when an atom position coincides with a slab center - * (tmpvec2 == 0) we cannot compute the vector product for sjn. - * However, since the atom is located directly on the pivot, this - * slab's contribution to the force on that atom will be zero + * (tmpvec2 == 0) we cannot compute the vector product for sjn. + * However, since the atom is located directly on the pivot, this + * slab's contribution to the force on that atom will be zero * anyway. Therefore, we directly move on to the next slab. */ - if ( 0 == norm(tmpvec2) ) + if (0 == norm(tmpvec2) ) { continue; } @@ -2204,11 +2204,11 @@ static real do_flex_lowlevel( rvec_sub(xj, xcn, xj_xcn); /* xj_xcn = xj - xcn */ /* In rare cases, when an atom position coincides with a slab center - * (xj_xcn == 0) we cannot compute the vector product for qjn. - * However, since the atom is located directly on the pivot, this - * slab's contribution to the force on that atom will be zero + * (xj_xcn == 0) we cannot compute the vector product for qjn. + * However, since the atom is located directly on the pivot, this + * slab's contribution to the force on that atom will be zero * anyway. Therefore, we directly move on to the next slab. */ - if ( 0 == norm(xj_xcn) ) + if (0 == norm(xj_xcn) ) { continue; } @@ -3531,10 +3531,10 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg, } #endif } - + if (bColl) { - /* Save the original (whole) set of positions in xc_old such that at later + /* Save the original (whole) set of positions in xc_old such that at later * steps the rotation group can always be made whole again. If the simulation is * restarted, we compute the starting reference positions (given the time) * and assume that the correct PBC image of each position is the one nearest @@ -3550,7 +3550,7 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg, { ii = rotg->ind[i]; - /* Subtract pivot, rotate, and add pivot again. This will yield the + /* Subtract pivot, rotate, and add pivot again. This will yield the * reference position for time t */ rvec_sub(rotg->x_ref[i], erg->xc_ref_center, coord); mvmul(erg->rotmat, coord, xref); @@ -3906,7 +3906,7 @@ extern void do_rotation( matrix box, rvec x[], real t, - gmx_large_int_t step, + gmx_int64_t step, gmx_wallcycle_t wcycle, gmx_bool bNS) { diff --git a/src/gromacs/mdlib/shellfc.c b/src/gromacs/mdlib/shellfc.c index 7c558e6526..6a735da82b 100644 --- a/src/gromacs/mdlib/shellfc.c +++ b/src/gromacs/mdlib/shellfc.c @@ -748,7 +748,7 @@ static void decrease_step_size(int nshell, t_shell s[]) } } -static void print_epot(FILE *fp, gmx_large_int_t mdstep, int count, real epot, real df, +static void print_epot(FILE *fp, gmx_int64_t mdstep, int count, real epot, real df, int ndir, real sf_dir) { char buf[22]; @@ -833,7 +833,7 @@ static void dump_shells(FILE *fp, rvec x[], rvec f[], real ftol, int ns, t_shell static void init_adir(FILE *log, gmx_shellfc_t shfc, gmx_constr_t constr, t_idef *idef, t_inputrec *ir, t_commrec *cr, int dd_ac1, - gmx_large_int_t step, t_mdatoms *md, int start, int end, + gmx_int64_t step, t_mdatoms *md, int start, int end, rvec *x_old, rvec *x_init, rvec *x, rvec *f, rvec *acc_dir, gmx_bool bMolPBC, matrix box, @@ -915,7 +915,7 @@ static void init_adir(FILE *log, gmx_shellfc_t shfc, } int relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose, - gmx_large_int_t mdstep, t_inputrec *inputrec, + gmx_int64_t mdstep, t_inputrec *inputrec, gmx_bool bDoNS, int force_flags, gmx_localtop_t *top, gmx_constr_t constr, diff --git a/src/gromacs/mdlib/sim_util.c b/src/gromacs/mdlib/sim_util.c index 3148dc3f07..86243251c7 100644 --- a/src/gromacs/mdlib/sim_util.c +++ b/src/gromacs/mdlib/sim_util.c @@ -94,7 +94,7 @@ void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting, - gmx_large_int_t step, + gmx_int64_t step, t_inputrec *ir, t_commrec gmx_unused *cr) { @@ -423,7 +423,7 @@ static void pme_receive_force_ener(FILE *fplog, } static void print_large_forces(FILE *fp, t_mdatoms *md, t_commrec *cr, - gmx_large_int_t step, real pforce, rvec *x, rvec *f) + gmx_int64_t step, real pforce, rvec *x, rvec *f) { int i; real pf2, fn2; @@ -444,7 +444,7 @@ static void print_large_forces(FILE *fp, t_mdatoms *md, t_commrec *cr, } static void post_process_forces(t_commrec *cr, - gmx_large_int_t step, + gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, gmx_localtop_t *top, matrix box, rvec x[], @@ -638,7 +638,7 @@ static void do_nb_verlet(t_forcerec *fr, void do_force_cutsVERLET(FILE *fplog, t_commrec *cr, t_inputrec *inputrec, - gmx_large_int_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, + gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, gmx_localtop_t *top, gmx_groups_t gmx_unused *groups, matrix box, rvec x[], history_t *hist, @@ -1382,7 +1382,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr, void do_force_cutsGROUP(FILE *fplog, t_commrec *cr, t_inputrec *inputrec, - gmx_large_int_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, + gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, gmx_localtop_t *top, gmx_groups_t *groups, matrix box, rvec x[], history_t *hist, @@ -1903,7 +1903,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr, void do_force(FILE *fplog, t_commrec *cr, t_inputrec *inputrec, - gmx_large_int_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, + gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, gmx_localtop_t *top, gmx_groups_t *groups, matrix box, rvec x[], history_t *hist, @@ -1969,7 +1969,7 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr, t_forcerec *fr, gmx_localtop_t *top) { int i, m, start, end; - gmx_large_int_t step; + gmx_int64_t step; real dt = ir->delta_t; real dvdl_dum; rvec *savex; @@ -2279,7 +2279,7 @@ void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr) } void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr, - gmx_large_int_t step, int natoms, + gmx_int64_t step, int natoms, matrix box, real lambda, tensor pres, tensor virial, real *prescorr, real *enercorr, real *dvdlcorr) { diff --git a/src/gromacs/mdlib/stat.c b/src/gromacs/mdlib/stat.c index 4a086ee806..23a09035a1 100644 --- a/src/gromacs/mdlib/stat.c +++ b/src/gromacs/mdlib/stat.c @@ -416,7 +416,7 @@ void global_stat(FILE *fplog, gmx_global_stat_t gs, where(); } -int do_per_step(gmx_large_int_t step, gmx_large_int_t nstep) +int do_per_step(gmx_int64_t step, gmx_int64_t nstep) { if (nstep != 0) { @@ -427,4 +427,3 @@ int do_per_step(gmx_large_int_t step, gmx_large_int_t nstep) return 0; } } - diff --git a/src/gromacs/mdlib/update.c b/src/gromacs/mdlib/update.c index c28bcfe2d6..52fed76017 100644 --- a/src/gromacs/mdlib/update.c +++ b/src/gromacs/mdlib/update.c @@ -122,7 +122,7 @@ typedef struct gmx_update gmx_bool randatom_list_init; /* Variables for the deform algorithm */ - gmx_large_int_t deformref_step; + gmx_int64_t deformref_step; matrix deformref_box; } t_gmx_update; @@ -1265,7 +1265,7 @@ void restore_ekinstate_from_state(t_commrec *cr, } } -void set_deform_reference_box(gmx_update_t upd, gmx_large_int_t step, matrix box) +void set_deform_reference_box(gmx_update_t upd, gmx_int64_t step, matrix box) { upd->deformref_step = step; copy_mat(box, upd->deformref_box); @@ -1273,7 +1273,7 @@ void set_deform_reference_box(gmx_update_t upd, gmx_large_int_t step, matrix box static void deform(gmx_update_t upd, int start, int homenr, rvec x[], matrix box, matrix *scale_tot, - const t_inputrec *ir, gmx_large_int_t step) + const t_inputrec *ir, gmx_int64_t step) { matrix bnew, invbox, mu; real elapsed_time; @@ -1333,7 +1333,7 @@ static void combine_forces(int nstcalclr, gmx_constr_t constr, t_inputrec *ir, t_mdatoms *md, t_idef *idef, t_commrec *cr, - gmx_large_int_t step, + gmx_int64_t step, t_state *state, gmx_bool bMolPBC, int start, int nrend, rvec f[], rvec f_lr[], @@ -1372,7 +1372,7 @@ static void combine_forces(int nstcalclr, } } -void update_tcouple(gmx_large_int_t step, +void update_tcouple(gmx_int64_t step, t_inputrec *inputrec, t_state *state, gmx_ekindata_t *ekind, @@ -1442,7 +1442,7 @@ void update_tcouple(gmx_large_int_t step, } void update_pcouple(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_inputrec *inputrec, t_state *state, matrix pcoupl_mu, @@ -1512,7 +1512,7 @@ static rvec *get_xprime(const t_state *state, gmx_update_t upd) } void update_constraints(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, real *dvdlambda, /* the contribution to be added to the bonded interactions */ t_inputrec *inputrec, /* input record and box stuff */ gmx_ekindata_t *ekind, @@ -1710,7 +1710,7 @@ void update_constraints(FILE *fplog, } void update_box(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, t_state *state, @@ -1815,7 +1815,7 @@ void update_box(FILE *fplog, } void update_coords(FILE *fplog, - gmx_large_int_t step, + gmx_int64_t step, t_inputrec *inputrec, /* input record and box stuff */ t_mdatoms *md, t_state *state, @@ -2066,7 +2066,7 @@ void correct_ekin(FILE *log, int start, int end, rvec v[], rvec vcm, real mass[] mv[XX], mv[YY], mv[ZZ]); } -extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_large_int_t step, t_mdatoms *md, t_state *state, gmx_update_t upd, t_idef *idef, gmx_constr_t constr) +extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, t_mdatoms *md, t_state *state, gmx_update_t upd, t_idef *idef, gmx_constr_t constr) { int i; diff --git a/src/gromacs/selection/scanner.cpp b/src/gromacs/selection/scanner.cpp index 0d025c9878..bd42f4c9f6 100644 --- a/src/gromacs/selection/scanner.cpp +++ b/src/gromacs/selection/scanner.cpp @@ -1,6 +1,13 @@ #line 2 "scanner.cpp" +#line 50 "scanner.l" +// Required before flex definitions, since it includes . +// Otherwise, compilers not strictly C99 get macro redefinition errors, +// since flex defines INT64_MAX etc. in such cases. +#include "gromacs/legacyheaders/types/simple.h" + -#line 4 "scanner.cpp" + +#line 11 "scanner.cpp" #define YY_INT_ALIGNED short int @@ -499,7 +506,7 @@ static yyconst flex_int16_t yy_chk[191] = /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013, 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. @@ -544,15 +551,16 @@ static yyconst flex_int16_t yy_chk[191] = * * \ingroup module_selection */ -#line 50 "scanner.l" + +#line 56 "scanner.l" #include "gromacs/legacyheaders/string2.h" #include "parser.h" #include "scanner.h" #include "scanner_internal.h" -/* This macro is here to make the actions a bit shorter, since nearly every - * action needs this call. */ +// This macro makes the actions a bit shorter, since nearly every action needs +// this call. #define ADD_TOKEN _gmx_sel_lexer_add_token(yytext, yyleng, state) #define YY_NO_UNISTD_H 1 @@ -560,7 +568,7 @@ static yyconst flex_int16_t yy_chk[191] = -#line 564 "scanner.cpp" +#line 572 "scanner.cpp" #define INITIAL 0 #define matchof 1 @@ -789,7 +797,7 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 85 "scanner.l" +#line 91 "scanner.l" @@ -823,7 +831,7 @@ YY_DECL } -#line 827 "scanner.cpp" +#line 835 "scanner.cpp" if ( !yyg->yy_init ) { @@ -904,34 +912,34 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 118 "scanner.l" +#line 124 "scanner.l" YY_BREAK case 2: YY_RULE_SETUP -#line 119 "scanner.l" +#line 125 "scanner.l" { yylval->i = strtol(yytext, NULL, 10); ADD_TOKEN; return TOK_INT; } YY_BREAK case 3: YY_RULE_SETUP -#line 120 "scanner.l" +#line 126 "scanner.l" { yylval->r = strtod(yytext, NULL); ADD_TOKEN; return TOK_REAL; } YY_BREAK case 4: YY_RULE_SETUP -#line 121 "scanner.l" +#line 127 "scanner.l" { yylval->str = gmx_strndup(yytext+1, yyleng-2); ADD_TOKEN; return STR; } YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP -#line 123 "scanner.l" +#line 129 "scanner.l" { _gmx_sel_lexer_add_token(" ", 1, state); } YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 124 "scanner.l" +#line 130 "scanner.l" { if (yytext[0] == ';' || state->bInteractive) { @@ -946,122 +954,122 @@ YY_RULE_SETUP } YY_BREAK case YY_STATE_EOF(cmdstart): -#line 137 "scanner.l" +#line 143 "scanner.l" { state->bCmdStart = true; yyterminate(); } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(matchof): case YY_STATE_EOF(matchbool): case YY_STATE_EOF(help): -#line 138 "scanner.l" +#line 144 "scanner.l" { state->bCmdStart = true; return CMD_SEP; } YY_BREAK case 7: YY_RULE_SETUP -#line 140 "scanner.l" +#line 146 "scanner.l" { if (YYSTATE == cmdstart) { BEGIN(help); } return HELP; } YY_BREAK case 8: YY_RULE_SETUP -#line 142 "scanner.l" +#line 148 "scanner.l" YY_BREAK case 9: YY_RULE_SETUP -#line 143 "scanner.l" +#line 149 "scanner.l" { yylval->str = gmx_strndup(yytext, yyleng); return HELP_TOPIC; } YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 144 "scanner.l" +#line 150 "scanner.l" { state->bCmdStart = true; return CMD_SEP; } YY_BREAK case 11: YY_RULE_SETUP -#line 145 "scanner.l" +#line 151 "scanner.l" { return INVALID; } YY_BREAK case 12: YY_RULE_SETUP -#line 149 "scanner.l" +#line 155 "scanner.l" { ADD_TOKEN; yylval->i = 1; return TOK_INT; } YY_BREAK case 13: YY_RULE_SETUP -#line 150 "scanner.l" +#line 156 "scanner.l" { ADD_TOKEN; yylval->i = 0; return TOK_INT; } YY_BREAK case 14: YY_RULE_SETUP -#line 152 "scanner.l" +#line 158 "scanner.l" { ADD_TOKEN; return GROUP; } YY_BREAK case 15: YY_RULE_SETUP -#line 153 "scanner.l" +#line 159 "scanner.l" { ADD_TOKEN; return TO; } YY_BREAK case 16: YY_RULE_SETUP -#line 154 "scanner.l" +#line 160 "scanner.l" { ADD_TOKEN; BEGIN(0); return OF; } YY_BREAK case 17: YY_RULE_SETUP -#line 155 "scanner.l" +#line 161 "scanner.l" { ADD_TOKEN; return AND; } YY_BREAK case 18: YY_RULE_SETUP -#line 156 "scanner.l" +#line 162 "scanner.l" { ADD_TOKEN; return OR; } YY_BREAK case 19: YY_RULE_SETUP -#line 157 "scanner.l" +#line 163 "scanner.l" { ADD_TOKEN; return XOR; } YY_BREAK case 20: YY_RULE_SETUP -#line 158 "scanner.l" +#line 164 "scanner.l" { ADD_TOKEN; return NOT; } YY_BREAK case 21: YY_RULE_SETUP -#line 159 "scanner.l" +#line 165 "scanner.l" { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; } YY_BREAK case 22: YY_RULE_SETUP -#line 161 "scanner.l" +#line 167 "scanner.l" { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); } YY_BREAK case 23: YY_RULE_SETUP -#line 163 "scanner.l" +#line 169 "scanner.l" { _gmx_sel_lexer_add_token(" ", 1, state); } YY_BREAK case 24: YY_RULE_SETUP -#line 164 "scanner.l" +#line 170 "scanner.l" { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; } YY_BREAK case 25: YY_RULE_SETUP -#line 165 "scanner.l" +#line 171 "scanner.l" { ADD_TOKEN; return yytext[0]; } YY_BREAK case 26: YY_RULE_SETUP -#line 166 "scanner.l" +#line 172 "scanner.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1065 "scanner.cpp" +#line 1073 "scanner.cpp" case YY_END_OF_BUFFER: { @@ -2212,4 +2220,4 @@ void _gmx_sel_yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 166 "scanner.l" +#line 172 "scanner.l" diff --git a/src/gromacs/selection/scanner.l b/src/gromacs/selection/scanner.l index 617df5fc04..f200acd045 100644 --- a/src/gromacs/selection/scanner.l +++ b/src/gromacs/selection/scanner.l @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013, 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. @@ -46,6 +46,12 @@ * * \ingroup module_selection */ +%top{ +// Required before flex definitions, since it includes . +// Otherwise, compilers not strictly C99 get macro redefinition errors, +// since flex defines INT32_MAX etc. in such cases. +#include "gromacs/legacyheaders/types/simple.h" +} %{ #include "gromacs/legacyheaders/string2.h" @@ -53,8 +59,8 @@ #include "scanner.h" #include "scanner_internal.h" -/* This macro is here to make the actions a bit shorter, since nearly every - * action needs this call. */ +// This macro makes the actions a bit shorter, since nearly every action needs +// this call. #define ADD_TOKEN _gmx_sel_lexer_add_token(yytext, yyleng, state) %} diff --git a/src/gromacs/selection/scanner_flex.h b/src/gromacs/selection/scanner_flex.h index e3e1e291dc..b2c9e5c663 100644 --- a/src/gromacs/selection/scanner_flex.h +++ b/src/gromacs/selection/scanner_flex.h @@ -3,8 +3,15 @@ #define _gmx_sel_yyIN_HEADER 1 #line 6 "scanner_flex.h" +#line 50 "scanner.l" +// Required before flex definitions, since it includes . +// Otherwise, compilers not strictly C99 get macro redefinition errors, +// since flex defines INT64_MAX etc. in such cases. +#include "gromacs/legacyheaders/types/simple.h" -#line 8 "scanner_flex.h" + + +#line 15 "scanner_flex.h" #define YY_INT_ALIGNED short int @@ -334,8 +341,8 @@ extern int _gmx_sel_yylex (yyscan_t yyscanner); #undef YY_DECL #endif -#line 166 "scanner.l" +#line 172 "scanner.l" -#line 340 "scanner_flex.h" +#line 347 "scanner_flex.h" #undef _gmx_sel_yyIN_HEADER #endif /* _gmx_sel_yyHEADER_H */ diff --git a/src/gromacs/timing/wallcycle.c b/src/gromacs/timing/wallcycle.c index 7a591540b9..04220d0965 100644 --- a/src/gromacs/timing/wallcycle.c +++ b/src/gromacs/timing/wallcycle.c @@ -78,7 +78,7 @@ typedef struct gmx_wallcycle #endif int ewc_prev; gmx_cycles_t cycle_prev; - gmx_large_int_t reset_counters; + gmx_int64_t reset_counters; #ifdef GMX_MPI MPI_Comm mpi_comm_mygroup; #endif @@ -822,7 +822,7 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime, } } -extern gmx_large_int_t wcycle_get_reset_counters(gmx_wallcycle_t wc) +extern gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc) { if (wc == NULL) { @@ -832,7 +832,7 @@ extern gmx_large_int_t wcycle_get_reset_counters(gmx_wallcycle_t wc) return wc->reset_counters; } -extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_large_int_t reset_counters) +extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_counters) { if (wc == NULL) { diff --git a/src/gromacs/timing/wallcycle.h b/src/gromacs/timing/wallcycle.h index 6ede8f370f..c83bc88279 100644 --- a/src/gromacs/timing/wallcycle.h +++ b/src/gromacs/timing/wallcycle.h @@ -93,10 +93,10 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime, gmx_wallcycle_t wc, wallclock_gpu_t *gpu_t); /* Print the cycle and time accounting */ -gmx_large_int_t wcycle_get_reset_counters(gmx_wallcycle_t wc); +gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc); /* Return reset_counters from wc struct */ -void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_large_int_t reset_counters); +void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_counters); /* Set reset_counters */ void wallcycle_sub_start(gmx_wallcycle_t wc, int ewcs); diff --git a/src/gromacs/timing/walltime_accounting.c b/src/gromacs/timing/walltime_accounting.c index f7ccc4f18d..b52d3e979a 100644 --- a/src/gromacs/timing/walltime_accounting.c +++ b/src/gromacs/timing/walltime_accounting.c @@ -82,7 +82,7 @@ typedef struct gmx_walltime_accounting { * with respect to parallelism implementation. */ int numOpenMPThreads; //! Set by integrators to report the amount of work they did - gmx_large_int_t nsteps_done; + gmx_int64_t nsteps_done; } t_gmx_walltime_accounting; /*! \brief Calls system timing routines (e.g. clock_gettime) to get @@ -184,7 +184,7 @@ walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accountin void walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t walltime_accounting, - gmx_large_int_t nsteps_done) + gmx_int64_t nsteps_done) { walltime_accounting->nsteps_done = nsteps_done; } diff --git a/src/gromacs/timing/walltime_accounting.h b/src/gromacs/timing/walltime_accounting.h index 1a75b27267..641393a0dd 100644 --- a/src/gromacs/timing/walltime_accounting.h +++ b/src/gromacs/timing/walltime_accounting.h @@ -96,7 +96,7 @@ walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accountin * TODO consider whether this should get done in walltime_accounting_end */ void walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t walltime_accounting, - gmx_large_int_t nsteps_done); + gmx_int64_t nsteps_done); /*! \brief Calls system timing routines (e.g. clock_gettime) to get the * (fractional) number of seconds elapsed since the epoch. diff --git a/src/programs/gmx/tpbcmp.c b/src/programs/gmx/tpbcmp.c index 62ead989b2..ede4e5836a 100644 --- a/src/programs/gmx/tpbcmp.c +++ b/src/programs/gmx/tpbcmp.c @@ -71,14 +71,14 @@ static void cmp_int(FILE *fp, const char *s, int index, int i1, int i2) } } -static void cmp_gmx_large_int(FILE *fp, const char *s, gmx_large_int_t i1, gmx_large_int_t i2) +static void cmp_gmx_large_int(FILE *fp, const char *s, gmx_int64_t i1, gmx_int64_t i2) { if (i1 != i2) { fprintf(fp, "%s (", s); - fprintf(fp, gmx_large_int_pfmt, i1); + fprintf(fp, "%"GMX_PRId64, i1); fprintf(fp, " - "); - fprintf(fp, gmx_large_int_pfmt, i2); + fprintf(fp, "%"GMX_PRId64, i2); fprintf(fp, ")\n"); } } diff --git a/src/programs/gmx/tpbconv.c b/src/programs/gmx/tpbconv.c index 21600282e1..880efc2054 100644 --- a/src/programs/gmx/tpbconv.c +++ b/src/programs/gmx/tpbconv.c @@ -353,7 +353,7 @@ int gmx_tpbconv(int argc, char *argv[]) ener_file_t fp_ener = NULL; t_trnheader head; int i; - gmx_large_int_t nsteps_req, run_step, frame; + gmx_int64_t nsteps_req, run_step, frame; double run_t, state_t; gmx_bool bOK, bNsteps, bExtend, bUntil, bTime, bTraj; gmx_bool bFrame, bUse, bSel, bNeedEner, bReadEner, bScanEner, bFepState; @@ -413,7 +413,7 @@ int gmx_tpbconv(int argc, char *argv[]) return 0; } - /* Convert int to gmx_large_int_t */ + /* Convert int to gmx_int64_t */ nsteps_req = nsteps_req_int; bNsteps = opt2parg_bSet("-nsteps", asize(pa), pa); bExtend = opt2parg_bSet("-extend", asize(pa), pa); @@ -556,7 +556,7 @@ int gmx_tpbconv(int argc, char *argv[]) if (bFrame || !bOK) { sprintf(buf, "\r%s %s frame %s%s: step %s%s time %s", - "%s", "%s", "%6", gmx_large_int_fmt, "%6", gmx_large_int_fmt, " %8.3f"); + "%s", "%s", "%6", GMX_PRId64, "%6", GMX_PRId64, " %8.3f"); fprintf(stderr, buf, bUse ? "Read " : "Skipped", ftp2ext(fn2ftp(frame_fn)), frame, head.step, head.t); @@ -616,7 +616,7 @@ int gmx_tpbconv(int argc, char *argv[]) /* Determine total number of steps remaining */ if (bExtend) { - ir->nsteps = ir->nsteps - (run_step - ir->init_step) + (gmx_large_int_t)(extend_t/ir->delta_t + 0.5); + ir->nsteps = ir->nsteps - (run_step - ir->init_step) + (gmx_int64_t)(extend_t/ir->delta_t + 0.5); printf("Extending remaining runtime of by %g ps (now %s steps)\n", extend_t, gmx_step_str(ir->nsteps, buf)); } @@ -626,7 +626,7 @@ int gmx_tpbconv(int argc, char *argv[]) gmx_step_str(ir->nsteps, buf), gmx_step_str(run_step, buf2), run_t, until_t); - ir->nsteps = (gmx_large_int_t)((until_t - run_t)/ir->delta_t + 0.5); + ir->nsteps = (gmx_int64_t)((until_t - run_t)/ir->delta_t + 0.5); printf("Extending remaining runtime until %g ps (now %s steps)\n", until_t, gmx_step_str(ir->nsteps, buf)); } @@ -680,7 +680,7 @@ int gmx_tpbconv(int argc, char *argv[]) } state_t = ir->init_t + ir->init_step*ir->delta_t; - sprintf(buf, "Writing statusfile with starting step %s%s and length %s%s steps...\n", "%10", gmx_large_int_fmt, "%10", gmx_large_int_fmt); + sprintf(buf, "Writing statusfile with starting step %s%s and length %s%s steps...\n", "%10", GMX_PRId64, "%10", GMX_PRId64); fprintf(stderr, buf, ir->init_step, ir->nsteps); fprintf(stderr, " time %10.3f and length %10.3f ps\n", state_t, ir->nsteps*ir->delta_t); diff --git a/src/programs/mdrun/md.c b/src/programs/mdrun/md.c index eeda69ca85..1adeb20d7c 100644 --- a/src/programs/mdrun/md.c +++ b/src/programs/mdrun/md.c @@ -100,8 +100,8 @@ #endif static void reset_all_counters(FILE *fplog, t_commrec *cr, - gmx_large_int_t step, - gmx_large_int_t *step_rel, t_inputrec *ir, + gmx_int64_t step, + gmx_int64_t *step_rel, t_inputrec *ir, gmx_wallcycle_t wcycle, t_nrnb *nrnb, gmx_walltime_accounting_t walltime_accounting, nbnxn_cuda_ptr_t cu_nbv) @@ -150,7 +150,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], gmx_walltime_accounting_t walltime_accounting) { gmx_mdoutf_t *outf; - gmx_large_int_t step, step_rel; + gmx_int64_t step, step_rel; double elapsed_time; double t, t0, lam0[efptNR]; gmx_bool bGStatEveryStep, bGStat, bCalcVir, bCalcEner; @@ -213,9 +213,9 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], char sbuf[STEPSTRSIZE], sbuf2[STEPSTRSIZE]; int handled_stop_condition = gmx_stop_cond_none; /* compare to get_stop_condition*/ gmx_iterate_t iterate; - gmx_large_int_t multisim_nsteps = -1; /* number of steps to do before first multisim - simulation stops. If equal to zero, don't - communicate any more between multisims.*/ + gmx_int64_t multisim_nsteps = -1; /* number of steps to do before first multisim + simulation stops. If equal to zero, don't + communicate any more between multisims.*/ /* PME load balancing data for GPU kernels */ pme_load_balancing_t pme_loadbal = NULL; double cycles_pmes; diff --git a/src/programs/mdrun/mdrun.cpp b/src/programs/mdrun/mdrun.cpp index 67d7a13f2a..b2d3421ea1 100644 --- a/src/programs/mdrun/mdrun.cpp +++ b/src/programs/mdrun/mdrun.cpp @@ -438,7 +438,7 @@ int gmx_mdrun(int argc, char *argv[]) int repl_ex_nex = 0; int nstepout = 100; int resetstep = -1; - gmx_large_int_t nsteps = -2; /* the value -2 means that the mdp option will be used */ + gmx_int64_t nsteps = -2; /* the value -2 means that the mdp option will be used */ rvec realddxyz = {0, 0, 0}; const char *ddno_opt[ddnoNR+1] = diff --git a/src/programs/mdrun/pme_loadbal.c b/src/programs/mdrun/pme_loadbal.c index 876c788142..c900adf90c 100644 --- a/src/programs/mdrun/pme_loadbal.c +++ b/src/programs/mdrun/pme_loadbal.c @@ -373,7 +373,7 @@ static int pme_loadbal_end(pme_load_balancing_t pme_lb) } static void print_loadbal_limited(FILE *fp_err, FILE *fp_log, - gmx_large_int_t step, + gmx_int64_t step, pme_load_balancing_t pme_lb) { char buf[STRLEN], sbuf[22]; @@ -433,7 +433,7 @@ gmx_bool pme_load_balance(pme_load_balancing_t pme_lb, interaction_const_t *ic, nonbonded_verlet_t *nbv, gmx_pme_t *pmedata, - gmx_large_int_t step) + gmx_int64_t step) { gmx_bool OK; pme_setup_t *set; diff --git a/src/programs/mdrun/pme_loadbal.h b/src/programs/mdrun/pme_loadbal.h index 35b80c9686..f2b9f0152b 100644 --- a/src/programs/mdrun/pme_loadbal.h +++ b/src/programs/mdrun/pme_loadbal.h @@ -66,7 +66,7 @@ gmx_bool pme_load_balance(pme_load_balancing_t pme_lb, interaction_const_t *ic, nonbonded_verlet_t *nbv, gmx_pme_t *pmedata, - gmx_large_int_t step); + gmx_int64_t step); /* Restart the PME load balancing discarding all timings gathered up till now */ void restart_pme_loadbal(pme_load_balancing_t pme_lb, int n); diff --git a/src/programs/mdrun/repl_ex.c b/src/programs/mdrun/repl_ex.c index f124697d05..0b954a8b5d 100644 --- a/src/programs/mdrun/repl_ex.c +++ b/src/programs/mdrun/repl_ex.c @@ -889,7 +889,7 @@ test_for_replica_exchange(FILE *fplog, struct gmx_repl_ex *re, gmx_enerdata_t *enerd, real vol, - gmx_large_int_t step, + gmx_int64_t step, real time) { int m, i, j, a, b, ap, bp, i0, i1, tmp; @@ -903,7 +903,7 @@ test_for_replica_exchange(FILE *fplog, gmx_bool bVol = FALSE; bMultiEx = (re->nex > 1); /* multiple exchanges at each state */ - fprintf(fplog, "Replica exchange at step " gmx_large_int_pfmt " time %g\n", step, time); + fprintf(fplog, "Replica exchange at step " "%"GMX_PRId64 " time %g\n", step, time); if (re->bNPT) { @@ -1294,7 +1294,7 @@ prepare_to_do_exchange(FILE *fplog, gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *re, t_state *state, gmx_enerdata_t *enerd, - t_state *state_local, gmx_large_int_t step, real time) + t_state *state_local, gmx_int64_t step, real time) { int i, j; int replica_id = 0; diff --git a/src/programs/mdrun/repl_ex.h b/src/programs/mdrun/repl_ex.h index 20cad21c8e..e8d718dfbe 100644 --- a/src/programs/mdrun/repl_ex.h +++ b/src/programs/mdrun/repl_ex.h @@ -56,7 +56,7 @@ extern gmx_bool replica_exchange(FILE *fplog, gmx_repl_ex_t re, t_state *state, gmx_enerdata_t *enerd, t_state *state_local, - gmx_large_int_t step, real time); + gmx_int64_t step, real time); /* Attempts replica exchange, should be called on all nodes. * Returns TRUE if this state has been exchanged. * When running each replica in parallel, diff --git a/src/programs/mdrun/runner.c b/src/programs/mdrun/runner.c index cb094bb692..45754b4f43 100644 --- a/src/programs/mdrun/runner.c +++ b/src/programs/mdrun/runner.c @@ -102,7 +102,7 @@ typedef struct { /* The array should match the eI array in include/types/enums.h */ const gmx_intp_t integrator[eiNR] = { {do_md}, {do_steep}, {do_cg}, {do_md}, {do_md}, {do_nm}, {do_lbfgs}, {do_tpi}, {do_tpi}, {do_md}, {do_md}, {do_md}}; -gmx_large_int_t deform_init_init_step_tpx; +gmx_int64_t deform_init_init_step_tpx; matrix deform_init_box_tpx; tMPI_Thread_mutex_t deform_init_box_mutex = TMPI_THREAD_MUTEX_INITIALIZER; @@ -130,7 +130,7 @@ struct mdrunner_arglist const char *ddcsz; const char *nbpu_opt; int nstlist_cmdline; - gmx_large_int_t nsteps_cmdline; + gmx_int64_t nsteps_cmdline; int nstepout; int resetstep; int nmultisim; @@ -192,7 +192,7 @@ static t_commrec *mdrunner_start_threads(gmx_hw_opt_t *hw_opt, const char *dddlb_opt, real dlb_scale, const char *ddcsx, const char *ddcsy, const char *ddcsz, const char *nbpu_opt, int nstlist_cmdline, - gmx_large_int_t nsteps_cmdline, + gmx_int64_t nsteps_cmdline, int nstepout, int resetstep, int nmultisim, int repl_ex_nst, int repl_ex_nex, int repl_ex_seed, real pforce, real cpt_period, real max_hours, @@ -215,40 +215,40 @@ static t_commrec *mdrunner_start_threads(gmx_hw_opt_t *hw_opt, /* fill the data structure to pass as void pointer to thread start fn */ /* hw_opt contains pointers, which should all be NULL at this stage */ - mda->hw_opt = *hw_opt; - mda->fplog = fplog; - mda->cr = cr; - mda->nfile = nfile; - mda->fnm = fnmn; - mda->oenv = oenv; - mda->bVerbose = bVerbose; - mda->bCompact = bCompact; - mda->nstglobalcomm = nstglobalcomm; - mda->ddxyz[XX] = ddxyz[XX]; - mda->ddxyz[YY] = ddxyz[YY]; - mda->ddxyz[ZZ] = ddxyz[ZZ]; - mda->dd_node_order = dd_node_order; - mda->rdd = rdd; - mda->rconstr = rconstr; - mda->dddlb_opt = dddlb_opt; - mda->dlb_scale = dlb_scale; - mda->ddcsx = ddcsx; - mda->ddcsy = ddcsy; - mda->ddcsz = ddcsz; - mda->nbpu_opt = nbpu_opt; - mda->nstlist_cmdline= nstlist_cmdline; - mda->nsteps_cmdline = nsteps_cmdline; - mda->nstepout = nstepout; - mda->resetstep = resetstep; - mda->nmultisim = nmultisim; - mda->repl_ex_nst = repl_ex_nst; - mda->repl_ex_nex = repl_ex_nex; - mda->repl_ex_seed = repl_ex_seed; - mda->pforce = pforce; - mda->cpt_period = cpt_period; - mda->max_hours = max_hours; - mda->deviceOptions = deviceOptions; - mda->Flags = Flags; + mda->hw_opt = *hw_opt; + mda->fplog = fplog; + mda->cr = cr; + mda->nfile = nfile; + mda->fnm = fnmn; + mda->oenv = oenv; + mda->bVerbose = bVerbose; + mda->bCompact = bCompact; + mda->nstglobalcomm = nstglobalcomm; + mda->ddxyz[XX] = ddxyz[XX]; + mda->ddxyz[YY] = ddxyz[YY]; + mda->ddxyz[ZZ] = ddxyz[ZZ]; + mda->dd_node_order = dd_node_order; + mda->rdd = rdd; + mda->rconstr = rconstr; + mda->dddlb_opt = dddlb_opt; + mda->dlb_scale = dlb_scale; + mda->ddcsx = ddcsx; + mda->ddcsy = ddcsy; + mda->ddcsz = ddcsz; + mda->nbpu_opt = nbpu_opt; + mda->nstlist_cmdline = nstlist_cmdline; + mda->nsteps_cmdline = nsteps_cmdline; + mda->nstepout = nstepout; + mda->resetstep = resetstep; + mda->nmultisim = nmultisim; + mda->repl_ex_nst = repl_ex_nst; + mda->repl_ex_nex = repl_ex_nex; + mda->repl_ex_seed = repl_ex_seed; + mda->pforce = pforce; + mda->cpt_period = cpt_period; + mda->max_hours = max_hours; + mda->deviceOptions = deviceOptions; + mda->Flags = Flags; /* now spawn new threads that start mdrunner_start_fn(), while the main thread returns, we set thread affinity later */ @@ -474,7 +474,7 @@ static int get_nthreads_mpi(const gmx_hw_info_t *hwinfo, */ static const int nbnxn_reference_nstlist = 10; /* The values to try when switching */ -const int nstlist_try[] = { 20, 25, 40 }; +const int nstlist_try[] = { 20, 25, 40 }; #define NNSTL sizeof(nstlist_try)/sizeof(nstlist_try[0]) /* Increase nstlist until the non-bonded cost increases more than listfac_ok, * but never more than listfac_max. @@ -793,7 +793,7 @@ static void convert_to_verlet_scheme(FILE *fplog, } else { - ir->verletbuf_tol = -1; + ir->verletbuf_tol = -1; ir->rlist = 1.05*max(ir->rvdw, ir->rcoulomb); } @@ -957,7 +957,7 @@ static void check_and_update_hw_opt_2(gmx_hw_opt_t *hw_opt, /* Override the value in inputrec with value passed on the command line (if any) */ static void override_nsteps_cmdline(FILE *fplog, - gmx_large_int_t nsteps_cmdline, + gmx_int64_t nsteps_cmdline, t_inputrec *ir, const t_commrec *cr) { @@ -1038,7 +1038,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt, const char *dddlb_opt, real dlb_scale, const char *ddcsx, const char *ddcsy, const char *ddcsz, const char *nbpu_opt, int nstlist_cmdline, - gmx_large_int_t nsteps_cmdline, int nstepout, int resetstep, + gmx_int64_t nsteps_cmdline, int nstepout, int resetstep, int gmx_unused nmultisim, int repl_ex_nst, int repl_ex_nex, int repl_ex_seed, real pforce, real cpt_period, real max_hours, const char *deviceOptions, unsigned long Flags) @@ -1068,7 +1068,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt, int list; gmx_walltime_accounting_t walltime_accounting = NULL; int rc; - gmx_large_int_t reset_counters; + gmx_int64_t reset_counters; gmx_edsam_t ed = NULL; t_commrec *cr_old = cr; int nthreads_pme = 1; -- 2.22.0