-/* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
+/*
+ * This file is part of the GROMACS molecular simulation package.
*
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,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.
*
- * This file is part of Gromacs Copyright (c) 1991-2008
- * David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * 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.
*
- * And Hey:
- * Gnomes, ROck Monsters And Chili Sauce
+ * 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 _domdec_h
#define _domdec_h
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "vsite.h"
-#include "genborn.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/timing/wallcycle.h"
#ifdef __cplusplus
extern "C" {
void dd_init_bondeds(FILE *fplog,
gmx_domdec_t *dd, gmx_mtop_t *mtop,
- gmx_vsite_t *vsite, gmx_constr_t constr,
+ gmx_vsite_t *vsite,
t_inputrec *ir, gmx_bool bBCheck, cginfo_mb_t *cginfo_mb);
/* Initialize data structures for bonded interactions */
/* Returns if we need to do pbc for calculating bonded interactions */
void set_dd_parameters(FILE *fplog, gmx_domdec_t *dd, real dlb_scale,
- t_inputrec *ir, t_forcerec *fr,
+ t_inputrec *ir,
gmx_ddbox_t *ddbox);
/* Set DD grid dimensions and limits,
* should be called after calling dd_init_bondeds.
* possible after subsequently setting a shorter cut-off with change_dd_cutoff.
*/
+gmx_bool dd_dlb_is_locked(const gmx_domdec_t *dd);
+/* Return if the DLB lock is set */
+
+void dd_dlb_set_lock(gmx_domdec_t *dd, gmx_bool bValue);
+/* Set a lock such that with DLB=auto DLB can (not) get turned on */
+
+void dd_setup_dlb_resource_sharing(t_commrec *cr,
+ const gmx_hw_info_t *hwinfo,
+ const gmx_hw_opt_t *hw_opt);
+/* When domains (PP MPI ranks) share a GPU, the individual GPU wait times
+ * are meaningless, as it depends on the order in which tasks on the same
+ * GPU finish. Therefore there wait times need to be averaged over the ranks
+ * sharing the same GPU. This function sets up the communication for that.
+ */
+
void setup_dd_grid(FILE *fplog, gmx_domdec_t *dd);
void dd_collect_vec(gmx_domdec_t *dd,
t_state *state_local, t_state *state);
enum {
- ddCyclStep, ddCyclPPduringPME, ddCyclF, ddCyclPME, ddCyclNr
+ ddCyclStep, ddCyclPPduringPME, ddCyclF, ddCyclWaitGPU, ddCyclPME, ddCyclNr
};
void dd_cycles_add(gmx_domdec_t *dd, float cycles, int ddCycl);
/* 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,
void dd_clear_f_vsites(gmx_domdec_t *dd, rvec *f);
void dd_move_x_constraints(gmx_domdec_t *dd, matrix box,
- rvec *x0, rvec *x1);
-/* Move x0 and also x1 if x1!=NULL */
+ rvec *x0, rvec *x1, gmx_bool bX1IsCoord);
+/* Move x0 and also x1 if x1!=NULL. bX1IsCoord tells if to do PBC on x1 */
void dd_move_x_vsites(gmx_domdec_t *dd, matrix box, rvec *x);
t_ilist *il_local);
void init_domdec_constraints(gmx_domdec_t *dd,
- gmx_mtop_t *mtop,
- gmx_constr_t constr);
+ gmx_mtop_t *mtop);
void init_domdec_vsites(gmx_domdec_t *dd, int n_intercg_vsite);
void dd_make_reverse_top(FILE *fplog,
gmx_domdec_t *dd, gmx_mtop_t *mtop,
- gmx_vsite_t *vsite, gmx_constr_t constr,
+ gmx_vsite_t *vsite,
t_inputrec *ir, gmx_bool bBCheck);
void dd_make_local_cgs(gmx_domdec_t *dd, t_block *lcgs);
-void dd_make_local_top(FILE *fplog,
- gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
+void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
int npbcdim, matrix box,
rvec cellsize_min, ivec npulse,
t_forcerec *fr,
t_blocka *make_charge_group_links(gmx_mtop_t *mtop, gmx_domdec_t *dd,
cginfo_mb_t *cginfo_mb);
-void dd_bonded_cg_distance(FILE *fplog,
- gmx_domdec_t *dd, gmx_mtop_t *mtop,
+void dd_bonded_cg_distance(FILE *fplog, gmx_mtop_t *mtop,
t_inputrec *ir, rvec *x, matrix box,
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);
gmx_mtop_t *mtop, matrix box, gmx_ddbox_t *ddbox,
gmx_bool bDynLoadBal, real dlb_scale,
real cellsize_limit, real cutoff_dd,
- gmx_bool bInterCGBondeds, gmx_bool bInterCGMultiBody);
+ gmx_bool bInterCGBondeds);
/* Determines the optimal DD cell setup dd->nc and possibly npmenodes
* for the system.
* On the master node returns the actual cellsize limit used.