Merge release-5-0 into master
[alexxy/gromacs.git] / src / gromacs / legacyheaders / domdec.h
index 4b6c5af011ca136b26695c861e792f6ceadac712..c44c7bf8406784fdd4ee17326d357a3266c521d4 100644 (file)
@@ -1,28 +1,45 @@
-/* -*- 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" {
@@ -122,6 +139,21 @@ void change_dd_dlb_cutoff_limit(t_commrec *cr);
  * 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,
@@ -131,7 +163,7 @@ void dd_collect_state(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);
@@ -164,7 +196,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,
@@ -201,8 +233,8 @@ void dd_move_f_vsites(gmx_domdec_t *dd, rvec *f, rvec *fshift);
 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);
 
@@ -263,7 +295,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);