From 6efaa579de8c6f0ab1e2a4da55f7da5fb4c2eff3 Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Thu, 29 May 2014 07:25:07 +0300 Subject: [PATCH] Remove more uses of typedefs.h - Replace typedefs.h with individual headers and/or forward declarations, with focus on headers and code outside gmxlib/mdlib/gmxana/gmxpreprocess. - Remove unused dlb.h. - Fix some source files that were relying on transitive includes. Change-Id: Icf32798d664f6753eb0c0cb2a88e178bc21c9d78 --- src/gromacs/fileio/confio.c | 9 ++- src/gromacs/fileio/enxio.c | 15 ++-- src/gromacs/fileio/mdoutf.h | 2 +- src/gromacs/fileio/pdbio.c | 17 +++-- src/gromacs/fileio/trxio.c | 5 +- src/gromacs/fileio/trxio.h | 20 ++--- src/gromacs/fileio/xdrd.c | 5 +- src/gromacs/fileio/xtcio.c | 13 ++-- src/gromacs/fileio/xvgr.cpp | 1 - src/gromacs/gmxana/gmx_clustsize.c | 1 - src/gromacs/gmxana/gmx_dyecoupl.c | 16 ++-- src/gromacs/gmxana/gmx_dyndom.c | 1 + src/gromacs/gmxana/gmx_morph.c | 9 ++- src/gromacs/gmxana/gmx_rdf.c | 1 - src/gromacs/gmxana/gmx_saxs.c | 15 +--- src/gromacs/gmxana/sfactor.h | 10 +-- src/gromacs/gmxlib/conformation-utilities.h | 4 +- src/gromacs/gmxlib/dlb.h | 46 ------------ src/gromacs/gmxlib/splitter.c | 4 +- src/gromacs/gmxlib/topsort.h | 12 +-- src/gromacs/legacyheaders/calcgrid.h | 11 ++- src/gromacs/legacyheaders/calcmu.h | 8 +- src/gromacs/legacyheaders/chargegroup.h | 12 ++- src/gromacs/legacyheaders/ebin.h | 3 +- src/gromacs/legacyheaders/gmx_ga2la.h | 2 +- src/gromacs/legacyheaders/gmx_hash.h | 6 +- src/gromacs/legacyheaders/gmx_omp_nthreads.h | 7 +- .../legacyheaders/gmx_thread_affinity.h | 17 +++-- src/gromacs/legacyheaders/md_logging.h | 7 +- src/gromacs/legacyheaders/mdatoms.h | 13 +++- src/gromacs/legacyheaders/mtop_util.h | 75 +++++++++++-------- src/gromacs/legacyheaders/mvdata.h | 12 ++- src/gromacs/legacyheaders/network.h | 43 ++++++----- src/gromacs/legacyheaders/perf_est.h | 12 ++- src/gromacs/legacyheaders/rbin.h | 6 +- src/gromacs/legacyheaders/readinp.h | 2 +- src/gromacs/legacyheaders/sighandler.h | 4 +- src/gromacs/legacyheaders/splitter.h | 10 ++- src/gromacs/legacyheaders/vcm.h | 9 ++- src/gromacs/legacyheaders/warninp.h | 4 +- src/gromacs/mdlib/init.c | 1 - src/gromacs/selection/tests/toputils.cpp | 1 + src/gromacs/tools/convert_tpr.c | 15 ++-- .../trajectoryanalysis/modules/select.cpp | 2 + .../trajectoryanalysis/runnercommon.cpp | 2 + 45 files changed, 262 insertions(+), 228 deletions(-) delete mode 100644 src/gromacs/gmxlib/dlb.h diff --git a/src/gromacs/fileio/confio.c b/src/gromacs/fileio/confio.c index ee227624c1..8f3495b052 100644 --- a/src/gromacs/fileio/confio.c +++ b/src/gromacs/fileio/confio.c @@ -34,17 +34,18 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#include "confio.h" + #ifdef HAVE_CONFIG_H #include #endif #include #include +#include #include "typedefs.h" #include "macros.h" -#include "confio.h" -#include "gromacs/math/vec.h" #include "gromacs/utility/futil.h" #include "xdrf.h" #include "filenm.h" @@ -52,10 +53,12 @@ #include "tpxio.h" #include "trxio.h" #include "copyrite.h" -#include "gromacs/pbcutil/pbc.h" #include "mtop_util.h" #include "gmxfio.h" +#include "gromacs/fileio/trx.h" +#include "gromacs/math/vec.h" +#include "gromacs/pbcutil/pbc.h" #include "gromacs/topology/symtab.h" #include "gromacs/topology/topology.h" #include "gromacs/utility/cstringutil.h" diff --git a/src/gromacs/fileio/enxio.c b/src/gromacs/fileio/enxio.c index 0548c4673f..46ef9eaa11 100644 --- a/src/gromacs/fileio/enxio.c +++ b/src/gromacs/fileio/enxio.c @@ -34,6 +34,8 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#include "enxio.h" + #ifdef HAVE_CONFIG_H #include #endif @@ -42,13 +44,11 @@ #include #include "gromacs/utility/futil.h" -#include "gmxfio.h" -#include "enxio.h" -#include "gromacs/math/vec.h" -#include "xdrf.h" #include "macros.h" -#include "typedefs.h" +#include "gromacs/fileio/gmxfio.h" +#include "gromacs/fileio/xdrf.h" +#include "gromacs/math/vec.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/topology/topology.h" #include "gromacs/utility/fatalerror.h" @@ -925,7 +925,6 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr) int i, b; gmx_bool bRead, bOK, bOK1, bSane; real tmp1, tmp2, rdum; - char buf[22]; /*int d_size;*/ bOK = TRUE; @@ -978,9 +977,9 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr) { fprintf(stderr, "\nWARNING: there may be something wrong with energy file %s\n", gmx_fio_getname(ef->fio)); - fprintf(stderr, "Found: step=%s, nre=%d, nblock=%d, time=%g.\n" + fprintf(stderr, "Found: step=%"GMX_PRId64 ", nre=%d, nblock=%d, time=%g.\n" "Trying to skip frame expect a crash though\n", - gmx_step_str(fr->step, buf), fr->nre, fr->nblock, fr->t); + fr->step, fr->nre, fr->nblock, fr->t); } if (bRead && fr->nre > fr->e_alloc) { diff --git a/src/gromacs/fileio/mdoutf.h b/src/gromacs/fileio/mdoutf.h index 243920ea90..3372db38d9 100644 --- a/src/gromacs/fileio/mdoutf.h +++ b/src/gromacs/fileio/mdoutf.h @@ -86,7 +86,7 @@ void done_mdoutf(gmx_mdoutf_t of); void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr, gmx_mdoutf_t of, int mdof_flags, - gmx_mtop_t *top_global, + struct gmx_mtop_t *top_global, gmx_int64_t step, double t, t_state *state_local, t_state *state_global, rvec *f_local, rvec *f_global); diff --git a/src/gromacs/fileio/pdbio.c b/src/gromacs/fileio/pdbio.c index 7c085a48ba..58de0aaf67 100644 --- a/src/gromacs/fileio/pdbio.c +++ b/src/gromacs/fileio/pdbio.c @@ -34,6 +34,8 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#include "pdbio.h" + #ifdef HAVE_CONFIG_H #include #endif @@ -42,17 +44,18 @@ #include #include -#include "typedefs.h" -#include "pdbio.h" -#include "copyrite.h" +#include "gromacs/legacyheaders/atomprop.h" +#include "gromacs/legacyheaders/copyrite.h" +#include "gromacs/legacyheaders/types/ifunc.h" +#include "gromacs/legacyheaders/typedefs.h" #include "gromacs/utility/futil.h" -#include "atomprop.h" -#include "gromacs/math/units.h" -#include "gromacs/pbcutil/pbc.h" -#include "gmxfio.h" +#include "gromacs/fileio/gmxfio.h" +#include "gromacs/math/units.h" #include "gromacs/math/vec.h" +#include "gromacs/pbcutil/pbc.h" #include "gromacs/topology/symtab.h" +#include "gromacs/topology/topology.h" #include "gromacs/utility/cstringutil.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" diff --git a/src/gromacs/fileio/trxio.c b/src/gromacs/fileio/trxio.c index 25569abb44..4372e7edb1 100644 --- a/src/gromacs/fileio/trxio.c +++ b/src/gromacs/fileio/trxio.c @@ -43,11 +43,9 @@ #include #include -#include "typedefs.h" #ifdef GMX_USE_PLUGINS #include "vmdio.h" #endif -#include "gromacs/utility/smalloc.h" #include "gmxfio.h" #include "trxio.h" #include "tpxio.h" @@ -64,7 +62,10 @@ #include "xdrf.h" #include "gromacs/fileio/timecontrol.h" +#include "gromacs/fileio/trx.h" +#include "gromacs/topology/atoms.h" #include "gromacs/utility/fatalerror.h" +#include "gromacs/utility/smalloc.h" /* defines for frame counter output */ #define SKIP1 10 diff --git a/src/gromacs/fileio/trxio.h b/src/gromacs/fileio/trxio.h index 3f7305984c..dab739a34a 100644 --- a/src/gromacs/fileio/trxio.h +++ b/src/gromacs/fileio/trxio.h @@ -54,6 +54,8 @@ extern "C" { struct gmx_mtop_t; struct t_atoms; +struct t_topology; +struct t_trxframe; /* a dedicated status type contains fp, etc. */ typedef struct t_trxstatus t_trxstatus; @@ -71,23 +73,23 @@ int prec2ndec(real prec); * 1/(nm) */ real ndec2prec(int ndec); -void clear_trxframe(t_trxframe *fr, gmx_bool bFirst); +void clear_trxframe(struct t_trxframe *fr, gmx_bool bFirst); /* Set all content gmx_booleans to FALSE. * When bFirst = TRUE, set natoms=-1, all pointers to NULL * and all data to zero. */ -void set_trxframe_ePBC(t_trxframe *fr, int ePBC); +void set_trxframe_ePBC(struct t_trxframe *fr, int ePBC); /* Set the type of periodic boundary conditions, ePBC=-1 is not set */ int nframes_read(t_trxstatus *status); /* Returns the number of frames read from the trajectory */ -int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind, +int write_trxframe_indexed(t_trxstatus *status, struct t_trxframe *fr, int nind, const atom_id *ind, gmx_conect gc); /* Write an indexed frame to a TRX file, see write_trxframe. gc may be NULL */ -int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc); +int write_trxframe(t_trxstatus *status, struct t_trxframe *fr, gmx_conect gc); /* Write a frame to a TRX file. * Only entries for which the gmx_boolean is TRUE will be written, * except for step, time, lambda and/or box, which may not be @@ -132,8 +134,8 @@ void trjtools_gmx_prepare_tng_writing(const char *filename, * tng_trajectory_t are encapsulated, so client trajectory-writing * code with a t_trxstatus can't just call the TNG writing * function. */ -void write_tng_frame(t_trxstatus *status, - t_trxframe *fr); +void write_tng_frame(t_trxstatus *status, + struct t_trxframe *fr); void close_trx(t_trxstatus *status); /* Close trj file as opened with read_first_x, read_frist_frame @@ -202,7 +204,7 @@ int check_times(real t); #define FRAME_NOT_OK (HEADER_NOT_OK | DATA_NOT_OK) int read_first_frame(const output_env_t oenv, t_trxstatus **status, - const char *fn, t_trxframe *fr, int flags); + const char *fn, struct t_trxframe *fr, int flags); /* Read the first frame which is in accordance with flags, which are * defined further up in this file. * Returns natoms when succeeded, 0 otherwise. @@ -212,7 +214,7 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status, */ gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status, - t_trxframe *fr); + struct t_trxframe *fr); /* Reads the next frame which is in accordance with fr->flags. * Returns TRUE when succeeded, FALSE otherwise. */ @@ -239,7 +241,7 @@ void close_trj(t_trxstatus *status); void rewind_trj(t_trxstatus *status); /* Rewind trj file as opened with read_first_x */ -t_topology *read_top(const char *fn, int *ePBC); +struct t_topology *read_top(const char *fn, int *ePBC); /* Extract a topology data structure from a topology file. * If ePBC!=NULL *ePBC gives the pbc type. */ diff --git a/src/gromacs/fileio/xdrd.c b/src/gromacs/fileio/xdrd.c index 682e68cdd8..2dd1f39b91 100644 --- a/src/gromacs/fileio/xdrd.c +++ b/src/gromacs/fileio/xdrd.c @@ -34,12 +34,13 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#include "xdrf.h" + #ifdef HAVE_CONFIG_H #include #endif -#include "typedefs.h" -#include "xdrf.h" +#include "gromacs/math/vectypes.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" diff --git a/src/gromacs/fileio/xtcio.c b/src/gromacs/fileio/xtcio.c index b1ebf54d1e..af57ca9da4 100644 --- a/src/gromacs/fileio/xtcio.c +++ b/src/gromacs/fileio/xtcio.c @@ -34,19 +34,20 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#include "xtcio.h" + #ifdef HAVE_CONFIG_H #include #endif #include -#include "typedefs.h" -#include "xdrf.h" -#include "gmxfio.h" -#include "xtcio.h" -#include "gromacs/utility/smalloc.h" + +#include "gromacs/fileio/gmxfio.h" +#include "gromacs/fileio/xdrf.h" #include "gromacs/math/vec.h" -#include "gromacs/utility/futil.h" #include "gromacs/utility/fatalerror.h" +#include "gromacs/utility/futil.h" +#include "gromacs/utility/smalloc.h" #define XTC_MAGIC 1995 diff --git a/src/gromacs/fileio/xvgr.cpp b/src/gromacs/fileio/xvgr.cpp index 0027b30cca..49081481fa 100644 --- a/src/gromacs/fileio/xvgr.cpp +++ b/src/gromacs/fileio/xvgr.cpp @@ -50,7 +50,6 @@ #include "gromacs/legacyheaders/copyrite.h" #include "gromacs/legacyheaders/oenv.h" -#include "gromacs/legacyheaders/typedefs.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/math/vec.h" diff --git a/src/gromacs/gmxana/gmx_clustsize.c b/src/gromacs/gmxana/gmx_clustsize.c index 0d7848b8b9..990dd923f4 100644 --- a/src/gromacs/gmxana/gmx_clustsize.c +++ b/src/gromacs/gmxana/gmx_clustsize.c @@ -51,7 +51,6 @@ #include "gromacs/fileio/trxio.h" #include "index.h" #include "gromacs/utility/smalloc.h" -#include "calcgrid.h" #include "nrnb.h" #include "gromacs/math/units.h" #include "coulomb.h" diff --git a/src/gromacs/gmxana/gmx_dyecoupl.c b/src/gromacs/gmxana/gmx_dyecoupl.c index 0268c879be..7e8934f6c6 100644 --- a/src/gromacs/gmxana/gmx_dyecoupl.c +++ b/src/gromacs/gmxana/gmx_dyecoupl.c @@ -35,14 +35,15 @@ #include "copyrite.h" #include "gromacs/fileio/filenm.h" #include "macros.h" -#include "gromacs/pbcutil/pbc.h" -#include "gromacs/utility/smalloc.h" -#include "gromacs/commandline/pargs.h" #include "gromacs/math/vec.h" -#include "gromacs/fileio/xvgr.h" -#include "gromacs/fileio/trxio.h" +#include "gromacs/commandline/pargs.h" +#include "gromacs/fileio/trx.h" +#include "gromacs/fileio/trxio.h" +#include "gromacs/fileio/xvgr.h" +#include "gromacs/pbcutil/pbc.h" #include "gromacs/utility/fatalerror.h" +#include "gromacs/utility/smalloc.h" int gmx_dyecoupl(int argc, char *argv[]) { @@ -98,7 +99,6 @@ int gmx_dyecoupl(int argc, char *argv[]) int ndon, nacc; atom_id *donindex, *accindex; char *grpnm; - t_atoms *atoms = NULL; t_trxstatus *status; t_trxframe fr; @@ -162,10 +162,10 @@ int gmx_dyecoupl(int argc, char *argv[]) } printf("Select group with donor atom pairs defining the transition moment\n"); - get_index(atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm); + get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm); printf("Select group with acceptor atom pairs defining the transition moment\n"); - get_index(atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm); + get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm); /*check if groups are identical*/ grident = TRUE; diff --git a/src/gromacs/gmxana/gmx_dyndom.c b/src/gromacs/gmxana/gmx_dyndom.c index 52b6eb7134..9106fa66f4 100644 --- a/src/gromacs/gmxana/gmx_dyndom.c +++ b/src/gromacs/gmxana/gmx_dyndom.c @@ -48,6 +48,7 @@ #include "gromacs/commandline/pargs.h" #include "gromacs/math/3dtransforms.h" #include "gromacs/math/vec.h" +#include "gromacs/topology/atoms.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" diff --git a/src/gromacs/gmxana/gmx_morph.c b/src/gromacs/gmxana/gmx_morph.c index 6ad9c8fe79..dadb1590f9 100644 --- a/src/gromacs/gmxana/gmx_morph.c +++ b/src/gromacs/gmxana/gmx_morph.c @@ -38,18 +38,19 @@ #include #endif -#include "gromacs/commandline/pargs.h" -#include "gromacs/utility/smalloc.h" #include "macros.h" #include "gromacs/fileio/confio.h" -#include "gromacs/fileio/xvgr.h" #include "viewit.h" #include "index.h" #include "gmx_ana.h" -#include "gromacs/utility/fatalerror.h" #include "gromacs/fileio/trxio.h" +#include "gromacs/commandline/pargs.h" +#include "gromacs/fileio/xvgr.h" #include "gromacs/math/do_fit.h" +#include "gromacs/topology/atoms.h" +#include "gromacs/utility/fatalerror.h" +#include "gromacs/utility/smalloc.h" static real dointerp(int n, rvec x1[], rvec x2[], rvec xx[], int I, int N, real first, real last) diff --git a/src/gromacs/gmxana/gmx_rdf.c b/src/gromacs/gmxana/gmx_rdf.c index 7da7f011aa..58c755afa1 100644 --- a/src/gromacs/gmxana/gmx_rdf.c +++ b/src/gromacs/gmxana/gmx_rdf.c @@ -50,7 +50,6 @@ #include "gromacs/fileio/tpxio.h" #include "gromacs/fileio/trxio.h" #include "index.h" -#include "calcgrid.h" #include "nrnb.h" #include "coulomb.h" #include "gstat.h" diff --git a/src/gromacs/gmxana/gmx_saxs.c b/src/gromacs/gmxana/gmx_saxs.c index e11f097458..91f2ede879 100644 --- a/src/gromacs/gmxana/gmx_saxs.c +++ b/src/gromacs/gmxana/gmx_saxs.c @@ -41,23 +41,14 @@ #include -#include "typedefs.h" #include "macros.h" -#include "gromacs/math/vec.h" #include "copyrite.h" -#include "gromacs/utility/futil.h" -#include "gromacs/commandline/pargs.h" -#include "gromacs/fileio/tpxio.h" -#include "index.h" -#include "gromacs/utility/smalloc.h" -#include "calcgrid.h" -#include "nrnb.h" -#include "coulomb.h" -#include "gstat.h" #include "gmx_ana.h" -#include "names.h" #include "sfactor.h" +#include "gromacs/commandline/pargs.h" +#include "gromacs/utility/smalloc.h" + int gmx_saxs(int argc, char *argv[]) { const char *desc[] = { diff --git a/src/gromacs/gmxana/sfactor.h b/src/gromacs/gmxana/sfactor.h index 8bdb91fa93..6eae788116 100644 --- a/src/gromacs/gmxana/sfactor.h +++ b/src/gromacs/gmxana/sfactor.h @@ -34,22 +34,20 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ - #ifndef _sfactor_h #define _sfactor_h - #include "index.h" #include "types/simple.h" #include "../math/gmxcomplex.h" #include "oenv.h" - - #ifdef __cplusplus extern "C" { #endif +struct t_topology; +struct t_trxframe; typedef struct gmx_structurefactors gmx_structurefactors_t; @@ -79,8 +77,8 @@ double CMSF (gmx_structurefactors_t *gsf, int type, int nh, double lambda, doubl int return_atom_type (const char *name, gmx_structurefactors_t *gsf); -void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, atom_id * index, - int isize, t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf); +void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, atom_id * index, + int isize, struct t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf); int do_scattering_intensity (const char* fnTPS, const char* fnNDX, const char* fnXVG, const char *fnTRX, diff --git a/src/gromacs/gmxlib/conformation-utilities.h b/src/gromacs/gmxlib/conformation-utilities.h index 38024be62a..8aa337b69c 100644 --- a/src/gromacs/gmxlib/conformation-utilities.h +++ b/src/gromacs/gmxlib/conformation-utilities.h @@ -37,7 +37,9 @@ #ifndef GMX_CONFORMATION_UTILITIES_H #define GMX_CONFORMATION_UTILITIES_H -#include "typedefs.h" +#include "../math/vectypes.h" +#include "../utility/basedefinitions.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/gmxlib/dlb.h b/src/gromacs/gmxlib/dlb.h deleted file mode 100644 index b730bd1473..0000000000 --- a/src/gromacs/gmxlib/dlb.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * Copyright (c) 1991-2000, University of Groningen, The Netherlands. - * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010, 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. - * - * GROMACS is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ - -#ifndef _dlb_h -#define _dlb_h - -#include "typedefs.h" - -extern void count_nb(t_commrec *cr, t_nsborder *nsb, t_block *cgs, int nns, - int nlr, t_idef *idef, int ngner); - -#endif /* _dlb_h */ diff --git a/src/gromacs/gmxlib/splitter.c b/src/gromacs/gmxlib/splitter.c index 8298cf954a..a3797c49f4 100644 --- a/src/gromacs/gmxlib/splitter.c +++ b/src/gromacs/gmxlib/splitter.c @@ -45,8 +45,10 @@ #include #include "macros.h" -#include "gromacs/pbcutil/mshift.h" +#include "gromacs/pbcutil/mshift.h" +#include "gromacs/topology/block.h" +#include "gromacs/topology/idef.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" diff --git a/src/gromacs/gmxlib/topsort.h b/src/gromacs/gmxlib/topsort.h index 890df3bde1..74c287838b 100644 --- a/src/gromacs/gmxlib/topsort.h +++ b/src/gromacs/gmxlib/topsort.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2008,2009,2010,2013, by the GROMACS development team, led by + * Copyright (c) 2008,2009,2010,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -35,21 +35,23 @@ #ifndef _topsort_h #define _topsort_h - -#include "typedefs.h" +#include "../utility/basedefinitions.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { #endif +struct gmx_mtop_t; +struct t_idef; /* Returns if there are perturbed bonded interactions */ -gmx_bool gmx_mtop_bondeds_free_energy(const gmx_mtop_t *mtop); +gmx_bool gmx_mtop_bondeds_free_energy(const struct gmx_mtop_t *mtop); /* Sort all the bonded ilists in idef to have the perturbed ones at the end * and set nr_nr_nonperturbed in ilist. */ -void gmx_sort_ilist_fe(t_idef *idef, const real *qA, const real *qB); +void gmx_sort_ilist_fe(struct t_idef *idef, const real *qA, const real *qB); #ifdef __cplusplus } diff --git a/src/gromacs/legacyheaders/calcgrid.h b/src/gromacs/legacyheaders/calcgrid.h index 91ecbe659c..1c6450387c 100644 --- a/src/gromacs/legacyheaders/calcgrid.h +++ b/src/gromacs/legacyheaders/calcgrid.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010, by the GROMACS development team, led by + * Copyright (c) 2010,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -34,8 +34,13 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#ifndef GMX_LEGACYHEADERS_CALCGRID_H +#define GMX_LEGACYHEADERS_CALCGRID_H -#include "typedefs.h" +#include + +#include "../math/vectypes.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { @@ -52,3 +57,5 @@ real calc_grid(FILE *fp, #ifdef __cplusplus } #endif + +#endif diff --git a/src/gromacs/legacyheaders/calcmu.h b/src/gromacs/legacyheaders/calcmu.h index 40f73b0b6b..f72bbfdb04 100644 --- a/src/gromacs/legacyheaders/calcmu.h +++ b/src/gromacs/legacyheaders/calcmu.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010, by the GROMACS development team, led by + * Copyright (c) 2010,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -34,13 +34,13 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ - #ifndef _calcmu_h #define _calcmu_h +#include -#include "typedefs.h" -#include "network.h" +#include "../math/vectypes.h" +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/chargegroup.h b/src/gromacs/legacyheaders/chargegroup.h index 44a429fe57..417917fc65 100644 --- a/src/gromacs/legacyheaders/chargegroup.h +++ b/src/gromacs/legacyheaders/chargegroup.h @@ -40,27 +40,31 @@ #include -#include "typedefs.h" +#include "../math/vectypes.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { #endif -void calc_chargegroup_radii(const gmx_mtop_t *mtop, rvec *x, +struct gmx_mtop_t; +struct t_block; + +void calc_chargegroup_radii(const struct gmx_mtop_t *mtop, rvec *x, real *rvdw1, real *rvdw2, real *rcoul1, real *rcoul2); /* This routine calculates the two largest charge group radii in x, * separately for VdW and Coulomb interactions. */ -void calc_cgcm(FILE *log, int cg0, int cg1, t_block *cgs, +void calc_cgcm(FILE *log, int cg0, int cg1, struct t_block *cgs, rvec pos[], rvec cg_cm[]); /* Routine to compute centers of geometry of charge groups. No periodicity * is used. */ void put_charge_groups_in_box (FILE *log, int cg0, int cg1, - int ePBC, matrix box, t_block *cgs, + int ePBC, matrix box, struct t_block *cgs, rvec pos[], rvec cg_cm[]); /* This routine puts charge groups in the periodic box, keeping them diff --git a/src/gromacs/legacyheaders/ebin.h b/src/gromacs/legacyheaders/ebin.h index 61a8db1de3..3dd6f42a05 100644 --- a/src/gromacs/legacyheaders/ebin.h +++ b/src/gromacs/legacyheaders/ebin.h @@ -40,8 +40,9 @@ #include -#include "typedefs.h" +#include "../legacyheaders/types/energy.h" #include "../fileio/enxio.h" +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/gmx_ga2la.h b/src/gromacs/legacyheaders/gmx_ga2la.h index e5820421df..b5ee2dc25c 100644 --- a/src/gromacs/legacyheaders/gmx_ga2la.h +++ b/src/gromacs/legacyheaders/gmx_ga2la.h @@ -37,8 +37,8 @@ #ifndef _gmx_ga2la_h #define _gmx_ga2la_h -#include "typedefs.h" #include "types/commrec.h" +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/smalloc.h" #ifdef __cplusplus diff --git a/src/gromacs/legacyheaders/gmx_hash.h b/src/gromacs/legacyheaders/gmx_hash.h index da399214da..2e15f38c67 100644 --- a/src/gromacs/legacyheaders/gmx_hash.h +++ b/src/gromacs/legacyheaders/gmx_hash.h @@ -35,9 +35,11 @@ #ifndef _gmx_hash_h #define _gmx_hash_h -#include "typedefs.h" -#include "gromacs/utility/smalloc.h" +#include + +#include "types/commrec.h" #include "gromacs/utility/fatalerror.h" +#include "gromacs/utility/smalloc.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/gmx_omp_nthreads.h b/src/gromacs/legacyheaders/gmx_omp_nthreads.h index 4c30d7e7d2..c5ceef442e 100644 --- a/src/gromacs/legacyheaders/gmx_omp_nthreads.h +++ b/src/gromacs/legacyheaders/gmx_omp_nthreads.h @@ -37,7 +37,8 @@ #define GMX_OMP_NTHREADS_H #include -#include "typedefs.h" + +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { @@ -46,6 +47,8 @@ extern "C" { } #endif +struct t_commrec; + /** Enum values corresponding to multithreaded algorithmic modules. */ typedef enum module_nth { @@ -62,7 +65,7 @@ typedef enum module_nth * It is compatible with tMPI, thread-safety is ensured (for the features * available with tMPI). * This function should caled only once during the initialization of mdrun. */ -void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr, +void gmx_omp_nthreads_init(FILE *fplog, struct t_commrec *cr, int nthreads_hw_avail, int omp_nthreads_req, int omp_nthreads_pme_req, diff --git a/src/gromacs/legacyheaders/gmx_thread_affinity.h b/src/gromacs/legacyheaders/gmx_thread_affinity.h index 5ac0bb54c5..b4abd5c2ab 100644 --- a/src/gromacs/legacyheaders/gmx_thread_affinity.h +++ b/src/gromacs/legacyheaders/gmx_thread_affinity.h @@ -35,7 +35,10 @@ #ifndef GMX_THREAD_AFFINITY_H_ #define GMX_THREAD_AFFINITY_H_ -#include "typedefs.h" +#include + +#include "types/hw_info.h" +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { @@ -44,14 +47,16 @@ extern "C" { } /* fixes auto-indentation problems */ #endif +struct t_commrec; + /* Sets the thread affinity using the requested setting stored in hw_opt. * The hardware topologu is requested from hwinfo, when present. */ void -gmx_set_thread_affinity(FILE *fplog, - const t_commrec *cr, - gmx_hw_opt_t *hw_opt, - const gmx_hw_info_t *hwinfo); +gmx_set_thread_affinity(FILE *fplog, + const struct t_commrec *cr, + gmx_hw_opt_t *hw_opt, + const gmx_hw_info_t *hwinfo); /* Check the process affinity mask and if it is found to be non-zero, * will honor it and disable mdrun internal affinity setting. @@ -66,7 +71,7 @@ gmx_set_thread_affinity(FILE *fplog, * variables for setting the affinity are set. */ void -gmx_check_thread_affinity_set(FILE *fplog, const t_commrec *cr, +gmx_check_thread_affinity_set(FILE *fplog, const struct t_commrec *cr, gmx_hw_opt_t *hw_opt, int ncpus, gmx_bool bAfterOpenmpInit); diff --git a/src/gromacs/legacyheaders/md_logging.h b/src/gromacs/legacyheaders/md_logging.h index 9a074b381f..d610c3d573 100644 --- a/src/gromacs/legacyheaders/md_logging.h +++ b/src/gromacs/legacyheaders/md_logging.h @@ -39,13 +39,14 @@ #define _md_logging_h #include -#include "typedefs.h" #ifdef __cplusplus extern "C" { #endif -void md_print_info(const t_commrec *cr, FILE *fplog, +struct t_commrec; + +void md_print_info(const struct t_commrec *cr, FILE *fplog, const char *fmt, ...); /* Print an general information message to stderr on the master node * and to fplog if fplog!=NULL. @@ -53,7 +54,7 @@ void md_print_info(const t_commrec *cr, FILE *fplog, * the arguments after that contain the values to be printed, as in printf. */ -void md_print_warn(const t_commrec *cr, FILE *fplog, +void md_print_warn(const struct t_commrec *cr, FILE *fplog, const char *fmt, ...); /* As md_print_info above, but for important notices or warnings. * The only difference with md_print_info is that a newline is printed diff --git a/src/gromacs/legacyheaders/mdatoms.h b/src/gromacs/legacyheaders/mdatoms.h index 748c04fe62..21d176b85e 100644 --- a/src/gromacs/legacyheaders/mdatoms.h +++ b/src/gromacs/legacyheaders/mdatoms.h @@ -38,15 +38,22 @@ #ifndef _mdatoms_h #define _mdatoms_h -#include "typedefs.h" +#include + +#include "types/inputrec.h" +#include "types/mdatom.h" +#include "../utility/basedefinitions.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { #endif -t_mdatoms *init_mdatoms(FILE *fp, gmx_mtop_t *mtop, gmx_bool bFreeEnergy); +struct gmx_mtop_t; + +t_mdatoms *init_mdatoms(FILE *fp, struct gmx_mtop_t *mtop, gmx_bool bFreeEnergy); -void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir, +void atoms2md(struct gmx_mtop_t *mtop, t_inputrec *ir, int nindex, int *index, int homenr, t_mdatoms *md); diff --git a/src/gromacs/legacyheaders/mtop_util.h b/src/gromacs/legacyheaders/mtop_util.h index 7c5172c75e..a9b913f521 100644 --- a/src/gromacs/legacyheaders/mtop_util.h +++ b/src/gromacs/legacyheaders/mtop_util.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -34,32 +34,45 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ -#include "typedefs.h" +#ifndef GMX_LEGACYHEADERS_MTOP_UTIL_H +#define GMX_LEGACYHEADERS_MTOP_UTIL_H + +#include "types/inputrec.h" +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { #endif +struct gmx_localtop_t; +struct gmx_moltype_t; +struct gmx_mtop_t; +struct t_atom; +struct t_atoms; +struct t_block; +struct t_ilist; +struct t_topology; + /* Should be called after generating or reading mtop, * to set some compute intesive variables to avoid * N^2 operations later on. */ void -gmx_mtop_finalize(gmx_mtop_t *mtop); +gmx_mtop_finalize(struct gmx_mtop_t *mtop); /* Counts the number of atoms of each type. State should be 0 for * state A and 1 for state B types. typecount should have at * least mtop->ffparams.atnr elements. */ void -gmx_mtop_count_atomtypes(const gmx_mtop_t *mtop, int state, int typecount[]); +gmx_mtop_count_atomtypes(const struct gmx_mtop_t *mtop, int state, int typecount[]); /* Returns the total number of charge groups in mtop */ int -ncg_mtop(const gmx_mtop_t *mtop); +ncg_mtop(const struct gmx_mtop_t *mtop); /* Removes the charge groups, i.e. makes single atom charge groups, in mtop */ -void gmx_mtop_remove_chargegroups(gmx_mtop_t *mtop); +void gmx_mtop_remove_chargegroups(struct gmx_mtop_t *mtop); /* Abstract data type for looking up atoms by global atom number */ @@ -67,11 +80,11 @@ typedef struct gmx_mtop_atomlookup *gmx_mtop_atomlookup_t; /* Initialize atom lookup by global atom number */ gmx_mtop_atomlookup_t -gmx_mtop_atomlookup_init(const gmx_mtop_t *mtop); +gmx_mtop_atomlookup_init(const struct gmx_mtop_t *mtop); /* As gmx_mtop_atomlookup_init, but optimized for atoms involved in settle */ gmx_mtop_atomlookup_t -gmx_mtop_atomlookup_settle_init(const gmx_mtop_t *mtop); +gmx_mtop_atomlookup_settle_init(const struct gmx_mtop_t *mtop); /* Destroy a gmx_mtop_atomlookup_t data structure */ void @@ -85,7 +98,7 @@ gmx_mtop_atomlookup_destroy(gmx_mtop_atomlookup_t alook); void gmx_mtop_atomnr_to_atom(const gmx_mtop_atomlookup_t alook, int atnr_global, - t_atom **atom); + struct t_atom **atom); /* Returns a pointer to the molecule interaction array ilist_mol[F_NRE] @@ -94,7 +107,7 @@ gmx_mtop_atomnr_to_atom(const gmx_mtop_atomlookup_t alook, void gmx_mtop_atomnr_to_ilist(const gmx_mtop_atomlookup_t alook, int atnr_global, - t_ilist **ilist_mol, int *atnr_offset); + struct t_ilist **ilist_mol, int *atnr_offset); /* Returns the molecule block index @@ -110,7 +123,7 @@ gmx_mtop_atomnr_to_molblock_ind(const gmx_mtop_atomlookup_t alook, /* Returns atom name, global resnr and residue name of atom atnr_global */ void -gmx_mtop_atominfo_global(const gmx_mtop_t *mtop, int atnr_global, +gmx_mtop_atominfo_global(const struct gmx_mtop_t *mtop, int atnr_global, char **atomname, int *resnr, char **resname); @@ -124,7 +137,7 @@ typedef struct gmx_mtop_atomloop_all *gmx_mtop_atomloop_all_t; * otherwise use gmx_mtop_atomloop_block. */ gmx_mtop_atomloop_all_t -gmx_mtop_atomloop_all_init(const gmx_mtop_t *mtop); +gmx_mtop_atomloop_all_init(const struct gmx_mtop_t *mtop); /* Loop to the next atom. * When not at the end: @@ -141,7 +154,7 @@ gmx_mtop_atomloop_all_init(const gmx_mtop_t *mtop); */ gmx_bool gmx_mtop_atomloop_all_next(gmx_mtop_atomloop_all_t aloop, - int *at_global, t_atom **atom); + int *at_global, struct t_atom **atom); /* Return the atomname, the residue number and residue name * of the current atom in the loop. @@ -155,7 +168,7 @@ gmx_mtop_atomloop_all_names(gmx_mtop_atomloop_all_t aloop, */ void gmx_mtop_atomloop_all_moltype(gmx_mtop_atomloop_all_t aloop, - gmx_moltype_t **moltype, int *at_mol); + struct gmx_moltype_t **moltype, int *at_mol); /* Abstract type for atom loop over atoms in all molecule blocks */ @@ -164,7 +177,7 @@ typedef struct gmx_mtop_atomloop_block *gmx_mtop_atomloop_block_t; /* Initialize an atom loop over atoms in all molecule blocks the system. */ gmx_mtop_atomloop_block_t -gmx_mtop_atomloop_block_init(const gmx_mtop_t *mtop); +gmx_mtop_atomloop_block_init(const struct gmx_mtop_t *mtop); /* Loop to the next atom. * When not at the end: @@ -181,7 +194,7 @@ gmx_mtop_atomloop_block_init(const gmx_mtop_t *mtop); */ gmx_bool gmx_mtop_atomloop_block_next(gmx_mtop_atomloop_block_t aloop, - t_atom **atom, int *nmol); + struct t_atom **atom, int *nmol); /* Abstract type for ilist loop over all ilists */ @@ -189,7 +202,7 @@ typedef struct gmx_mtop_ilistloop *gmx_mtop_ilistloop_t; /* Initialize an ilist loop over all molecule types in the system. */ gmx_mtop_ilistloop_t -gmx_mtop_ilistloop_init(const gmx_mtop_t *mtop); +gmx_mtop_ilistloop_init(const struct gmx_mtop_t *mtop); /* Loop to the next molecule, @@ -200,7 +213,7 @@ gmx_mtop_ilistloop_init(const gmx_mtop_t *mtop); */ gmx_bool gmx_mtop_ilistloop_next(gmx_mtop_ilistloop_t iloop, - t_ilist **ilist_mol, int *nmol); + struct t_ilist **ilist_mol, int *nmol); /* Abstract type for ilist loop over all ilists of all molecules */ @@ -212,7 +225,7 @@ typedef struct gmx_mtop_ilistloop_all *gmx_mtop_ilistloop_all_t; * otherwise use gmx_mtop_ilistloop. */ gmx_mtop_ilistloop_all_t -gmx_mtop_ilistloop_all_init(const gmx_mtop_t *mtop); +gmx_mtop_ilistloop_all_init(const struct gmx_mtop_t *mtop); /* Loop to the next molecule, * When not at the end: @@ -222,22 +235,22 @@ gmx_mtop_ilistloop_all_init(const gmx_mtop_t *mtop); */ gmx_bool gmx_mtop_ilistloop_all_next(gmx_mtop_ilistloop_all_t iloop, - t_ilist **ilist_mol, int *atnr_offset); + struct t_ilist **ilist_mol, int *atnr_offset); /* Returns the total number of interactions in the system of type ftype */ int -gmx_mtop_ftype_count(const gmx_mtop_t *mtop, int ftype); +gmx_mtop_ftype_count(const struct gmx_mtop_t *mtop, int ftype); /* Returns a charge group index for the whole system */ -t_block -gmx_mtop_global_cgs(const gmx_mtop_t *mtop); +struct t_block +gmx_mtop_global_cgs(const struct gmx_mtop_t *mtop); /* Returns a single t_atoms struct for the whole system */ -t_atoms -gmx_mtop_global_atoms(const gmx_mtop_t *mtop); +struct t_atoms +gmx_mtop_global_atoms(const struct gmx_mtop_t *mtop); /* Make all charge groups the size of one atom. @@ -245,22 +258,24 @@ gmx_mtop_global_atoms(const gmx_mtop_t *mtop); * that consist of a single charge group. */ void -gmx_mtop_make_atomic_charge_groups(gmx_mtop_t *mtop, gmx_bool bKeepSingleMolCG); +gmx_mtop_make_atomic_charge_groups(struct gmx_mtop_t *mtop, gmx_bool bKeepSingleMolCG); /* Generate a 'local' topology for the whole system. * When ir!=NULL the free energy interactions will be sorted to the end. */ -gmx_localtop_t * -gmx_mtop_generate_local_top(const gmx_mtop_t *mtop, const t_inputrec *ir); +struct gmx_localtop_t * +gmx_mtop_generate_local_top(const struct gmx_mtop_t *mtop, const t_inputrec *ir); /* Converts a gmx_mtop_t struct to t_topology. * All memory relating only to mtop will be freed. */ -t_topology -gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop); +struct t_topology +gmx_mtop_t_to_t_topology(struct gmx_mtop_t *mtop); #ifdef __cplusplus } #endif + +#endif diff --git a/src/gromacs/legacyheaders/mvdata.h b/src/gromacs/legacyheaders/mvdata.h index 083e4fc6bc..b065b4fee4 100644 --- a/src/gromacs/legacyheaders/mvdata.h +++ b/src/gromacs/legacyheaders/mvdata.h @@ -38,18 +38,22 @@ #ifndef _mvdata_h #define _mvdata_h -#include "typedefs.h" +#include "types/inputrec.h" +#include "types/state.h" #ifdef __cplusplus extern "C" { #endif -void bcast_ir_mtop(const t_commrec *cr, - t_inputrec *inputrec, gmx_mtop_t *mtop); +struct gmx_mtop_t; +struct t_commrec; + +void bcast_ir_mtop(const struct t_commrec *cr, + t_inputrec *inputrec, struct gmx_mtop_t *mtop); /* Broadcasts ir and mtop from the master to all nodes in cr->mpi_comm_mygroup. */ -void bcast_state(const t_commrec *cr, t_state *state); +void bcast_state(const struct t_commrec *cr, t_state *state); /* Broadcasts state from the master to all nodes in cr->mpi_comm_mygroup. */ diff --git a/src/gromacs/legacyheaders/network.h b/src/gromacs/legacyheaders/network.h index 42fe9ca74f..f0ae524c17 100644 --- a/src/gromacs/legacyheaders/network.h +++ b/src/gromacs/legacyheaders/network.h @@ -45,64 +45,67 @@ #include -#include "types/simple.h" -#include "typedefs.h" +#include "../utility/basedefinitions.h" #include "../utility/fatalerror.h" #ifdef __cplusplus extern "C" { #endif -t_commrec *init_commrec(void); +struct gmx_domdec_t; +struct gmx_multisim_t; +struct t_commrec; + +struct t_commrec *init_commrec(void); /* Allocate, initialize and return the commrec. */ -t_commrec *reinitialize_commrec_for_this_thread(const t_commrec *cro); +struct t_commrec *reinitialize_commrec_for_this_thread(const struct t_commrec *cro); /* Initialize communication records for thread-parallel simulations. Must be called on all threads before any communication takes place by the individual threads. Copies the original commrec to thread-local versions (a small memory leak results because we don't deallocate the old shared version). */ -void gmx_fill_commrec_from_mpi(t_commrec *cr); +void gmx_fill_commrec_from_mpi(struct t_commrec *cr); /* Continues t_commrec construction */ -void gmx_setup_nodecomm(FILE *fplog, t_commrec *cr); +void gmx_setup_nodecomm(FILE *fplog, struct t_commrec *cr); /* Sets up fast global communication for clusters with multi-core nodes */ -void gmx_init_intranode_counters(t_commrec *cr); +void gmx_init_intranode_counters(struct t_commrec *cr); /* Initializes intra-physical-node MPI process/thread counts and ID. */ -void gmx_barrier(const t_commrec *cr); +void gmx_barrier(const struct t_commrec *cr); /* Wait till all processes in cr->mpi_comm_mygroup have reached the barrier */ -void gmx_bcast(int nbytes, void *b, const t_commrec *cr); +void gmx_bcast(int nbytes, void *b, const struct t_commrec *cr); /* Broadcast nbytes bytes from the master to cr->mpi_comm_mygroup */ -void gmx_bcast_sim(int nbytes, void *b, const t_commrec *cr); +void gmx_bcast_sim(int nbytes, void *b, const struct t_commrec *cr); /* Broadcast nbytes bytes from the sim master to cr->mpi_comm_mysim */ -void gmx_sumi(int nr, int r[], const t_commrec *cr); +void gmx_sumi(int nr, int r[], const struct t_commrec *cr); /* Calculate the global sum of an array of ints */ -void gmx_sumli(int nr, gmx_int64_t r[], const t_commrec *cr); +void gmx_sumli(int nr, gmx_int64_t r[], const struct t_commrec *cr); /* Calculate the global sum of an array of large ints */ -void gmx_sumf(int nr, float r[], const t_commrec *cr); +void gmx_sumf(int nr, float r[], const struct t_commrec *cr); /* Calculate the global sum of an array of floats */ -void gmx_sumd(int nr, double r[], const t_commrec *cr); +void gmx_sumd(int nr, double r[], const struct t_commrec *cr); /* Calculate the global sum of an array of doubles */ -void gmx_sumi_sim(int nr, int r[], const gmx_multisim_t *ms); +void gmx_sumi_sim(int nr, int r[], const struct gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of ints */ -void gmx_sumli_sim(int nr, gmx_int64_t r[], const gmx_multisim_t *ms); +void gmx_sumli_sim(int nr, gmx_int64_t r[], const struct 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); +void gmx_sumf_sim(int nr, float r[], const struct gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of floats */ -void gmx_sumd_sim(int nr, double r[], const gmx_multisim_t *ms); +void gmx_sumd_sim(int nr, double r[], const struct gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of doubles */ #ifdef GMX_DOUBLE @@ -113,12 +116,12 @@ void gmx_sumd_sim(int nr, double r[], const gmx_multisim_t *ms); #define gmx_sum_sim gmx_sumf_sim #endif -gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr); +gmx_bool gmx_fexist_master(const char *fname, struct t_commrec *cr); /* Return TRUE when fname exists, FALSE otherwise, bcast from master to others */ void gmx_fatal_collective(int f_errno, const char *file, int line, - const t_commrec *cr, gmx_domdec_t *dd, + const struct t_commrec *cr, struct gmx_domdec_t *dd, const char *fmt, ...); /* As gmx_fatal declared in utility/fatalerror.h, * but only the master process prints the error message. diff --git a/src/gromacs/legacyheaders/perf_est.h b/src/gromacs/legacyheaders/perf_est.h index 35d1ca3c7b..cb2c44e6e5 100644 --- a/src/gromacs/legacyheaders/perf_est.h +++ b/src/gromacs/legacyheaders/perf_est.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2008, The GROMACS development team. - * Copyright (c) 2010, by the GROMACS development team, led by + * Copyright (c) 2010,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -37,18 +37,22 @@ #ifndef _perf_est_h #define _perf_est_h -#include "typedefs.h" +#include "types/inputrec.h" +#include "../math/vectypes.h" +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { #endif -int n_bonded_dx(gmx_mtop_t *mtop, gmx_bool bExcl); +struct gmx_mtop_t; + +int n_bonded_dx(struct gmx_mtop_t *mtop, gmx_bool bExcl); /* Returns the number of pbc_rvec_sub calls required for bonded interactions. * This number is also roughly proportional to the computational cost. */ -float pme_load_estimate(gmx_mtop_t *mtop, t_inputrec *ir, matrix box); +float pme_load_estimate(struct gmx_mtop_t *mtop, t_inputrec *ir, matrix box); /* Returns an estimate for the relative load of the PME mesh calculation * in the total force calculation. * This estimate is reasonable for recent Intel and AMD x86_64 CPUs. diff --git a/src/gromacs/legacyheaders/rbin.h b/src/gromacs/legacyheaders/rbin.h index f8ff166fea..ec2cd30dc6 100644 --- a/src/gromacs/legacyheaders/rbin.h +++ b/src/gromacs/legacyheaders/rbin.h @@ -38,12 +38,14 @@ #ifndef _rbin_h #define _rbin_h -#include "typedefs.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { #endif +struct t_commrec; + typedef struct { int nreal; int maxreal; @@ -63,7 +65,7 @@ int add_binr(t_bin *b, int nr, real r[]); int add_bind(t_bin *b, int nr, double r[]); /* Add reals to the bin. Returns index */ -void sum_bin(t_bin *b, t_commrec *cr); +void sum_bin(t_bin *b, struct t_commrec *cr); /* Globally sum the reals in the bin */ void extract_binr(t_bin *b, int index, int nr, real r[]); diff --git a/src/gromacs/legacyheaders/readinp.h b/src/gromacs/legacyheaders/readinp.h index 1c910ac01a..7fed9636af 100644 --- a/src/gromacs/legacyheaders/readinp.h +++ b/src/gromacs/legacyheaders/readinp.h @@ -40,7 +40,7 @@ #include -#include "typedefs.h" +#include "../utility/basedefinitions.h" #include "warninp.h" #ifdef __cplusplus diff --git a/src/gromacs/legacyheaders/sighandler.h b/src/gromacs/legacyheaders/sighandler.h index 03a6f6e9da..78edc547a9 100644 --- a/src/gromacs/legacyheaders/sighandler.h +++ b/src/gromacs/legacyheaders/sighandler.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010, by the GROMACS development team, led by + * Copyright (c) 2010,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,7 +40,7 @@ #include -#include "typedefs.h" +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/splitter.h b/src/gromacs/legacyheaders/splitter.h index 4453714bf5..2e6bc8ec0f 100644 --- a/src/gromacs/legacyheaders/splitter.h +++ b/src/gromacs/legacyheaders/splitter.h @@ -38,15 +38,19 @@ #ifndef _splitter_h #define _splitter_h -#include "typedefs.h" -#include "types/inputrec.h" +#include + +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { #endif +struct t_blocka; +struct t_idef; + void gen_sblocks(FILE *fp, int at_start, int at_end, - t_idef *idef, t_blocka *sblock, + struct t_idef *idef, struct t_blocka *sblock, gmx_bool bSettle); /* Generate shake blocks from the constraint list. Set bSettle to yes for shake * blocks including settles. You normally do not want this. diff --git a/src/gromacs/legacyheaders/vcm.h b/src/gromacs/legacyheaders/vcm.h index c11f77c87a..86649a101d 100644 --- a/src/gromacs/legacyheaders/vcm.h +++ b/src/gromacs/legacyheaders/vcm.h @@ -40,12 +40,17 @@ #include -#include "typedefs.h" +#include "types/inputrec.h" +#include "types/mdatom.h" +#include "../math/vectypes.h" +#include "../utility/basedefinitions.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { #endif +struct gmx_groups_t; typedef struct { int nr; /* Number of groups */ @@ -62,7 +67,7 @@ typedef struct { char **group_name; /* These two are copies to pointers in */ } t_vcm; -t_vcm *init_vcm(FILE *fp, gmx_groups_t *groups, t_inputrec *ir); +t_vcm *init_vcm(FILE *fp, struct gmx_groups_t *groups, t_inputrec *ir); /* Do a per group center of mass things */ void calc_vcm_grp(int start, int homenr, t_mdatoms *md, diff --git a/src/gromacs/legacyheaders/warninp.h b/src/gromacs/legacyheaders/warninp.h index be7c8a71cf..da485eda87 100644 --- a/src/gromacs/legacyheaders/warninp.h +++ b/src/gromacs/legacyheaders/warninp.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010, by the GROMACS development team, led by + * Copyright (c) 2010,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,7 +38,7 @@ #ifndef _warninp_h #define _warninp_h -#include "typedefs.h" +#include "../utility/basedefinitions.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/mdlib/init.c b/src/gromacs/mdlib/init.c index 121a9c323b..4537efc662 100644 --- a/src/gromacs/mdlib/init.c +++ b/src/gromacs/mdlib/init.c @@ -49,7 +49,6 @@ #include "mdatoms.h" #include "mdrun.h" #include "names.h" -#include "calcgrid.h" #include "update.h" #include "mdebin.h" diff --git a/src/gromacs/selection/tests/toputils.cpp b/src/gromacs/selection/tests/toputils.cpp index 070f87d18e..9a2f39e028 100644 --- a/src/gromacs/selection/tests/toputils.cpp +++ b/src/gromacs/selection/tests/toputils.cpp @@ -45,6 +45,7 @@ #include "gromacs/math/vec.h" #include "gromacs/fileio/tpxio.h" +#include "gromacs/fileio/trx.h" #include "gromacs/fileio/trxio.h" #include "gromacs/topology/atoms.h" #include "gromacs/topology/topology.h" diff --git a/src/gromacs/tools/convert_tpr.c b/src/gromacs/tools/convert_tpr.c index 552b1d299f..524d6d6f55 100644 --- a/src/gromacs/tools/convert_tpr.c +++ b/src/gromacs/tools/convert_tpr.c @@ -39,22 +39,27 @@ #endif #include + +#include "gromacs/legacyheaders/types/inputrec.h" +#include "gromacs/legacyheaders/types/simple.h" +#include "gromacs/legacyheaders/types/state.h" #include "index.h" -#include "gromacs/utility/fatalerror.h" -#include "gromacs/utility/smalloc.h" #include "macros.h" #include "names.h" -#include "typedefs.h" #include "gromacs/gmxpreprocess/readir.h" -#include "gromacs/commandline/pargs.h" -#include "gromacs/math/vec.h" #include "mtop_util.h" #include "checkpoint.h" #include "gromacs/fileio/tpxio.h" #include "gromacs/fileio/trnio.h" #include "gromacs/fileio/enxio.h" #include "gromacs/utility/futil.h" + +#include "gromacs/commandline/pargs.h" +#include "gromacs/math/vec.h" #include "gromacs/random/random.h" +#include "gromacs/topology/topology.h" +#include "gromacs/utility/fatalerror.h" +#include "gromacs/utility/smalloc.h" #define RANGECHK(i, n) if ((i) >= (n)) gmx_fatal(FARGS, "Your index file contains atomnumbers (e.g. %d)\nthat are larger than the number of atoms in the tpr file (%d)", (i), (n)) diff --git a/src/gromacs/trajectoryanalysis/modules/select.cpp b/src/gromacs/trajectoryanalysis/modules/select.cpp index fc8f592e93..9fe80ec551 100644 --- a/src/gromacs/trajectoryanalysis/modules/select.cpp +++ b/src/gromacs/trajectoryanalysis/modules/select.cpp @@ -56,12 +56,14 @@ #include "gromacs/analysisdata/modules/lifetime.h" #include "gromacs/analysisdata/modules/plot.h" #include "gromacs/fileio/gmxfio.h" +#include "gromacs/fileio/trx.h" #include "gromacs/fileio/trxio.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" #include "gromacs/options/options.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" +#include "gromacs/topology/topology.h" #include "gromacs/trajectoryanalysis/analysissettings.h" #include "gromacs/utility/arrayref.h" #include "gromacs/utility/exceptions.h" diff --git a/src/gromacs/trajectoryanalysis/runnercommon.cpp b/src/gromacs/trajectoryanalysis/runnercommon.cpp index bc97d3acc4..643ed3e30a 100644 --- a/src/gromacs/trajectoryanalysis/runnercommon.cpp +++ b/src/gromacs/trajectoryanalysis/runnercommon.cpp @@ -51,6 +51,7 @@ #include "gromacs/fileio/timecontrol.h" #include "gromacs/fileio/tpxio.h" +#include "gromacs/fileio/trx.h" #include "gromacs/fileio/trxio.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" @@ -60,6 +61,7 @@ #include "gromacs/selection/indexutil.h" #include "gromacs/selection/selectioncollection.h" #include "gromacs/selection/selectionfileoption.h" +#include "gromacs/topology/topology.h" #include "gromacs/trajectoryanalysis/analysissettings.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/gmxassert.h" -- 2.22.0