1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2011, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * For more info, check our website at http://www.gromacs.org
34 * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
37 #ifndef _pme_loadbal_h
38 #define _pme_loadbal_h
40 typedef struct pme_load_balancing *pme_load_balancing_t;
42 /* Initialze the PP-PME load balacing data and infrastructure */
43 void pme_loadbal_init(pme_load_balancing_t *pme_lb_p,
44 const t_inputrec *ir,matrix box,
45 const interaction_const_t *ic,
48 /* Try to adjust the PME grid and Coulomb cut-off.
49 * The adjustment is done to generate a different non-bonded PP and PME load.
50 * With separate PME nodes (PP and PME on different processes) or with
51 * a GPU (PP on GPU, PME on CPU), PP and PME run on different resources
52 * and changing the load will affect the load balance and performance.
53 * The total time for a set of integration steps is monitored and a range
54 * of grid/cut-off setups is scanned. After calling pme_load_balance many
55 * times and acquiring enough statistics, the best performing setup is chosen.
56 * Here we try to take into account fluctuations and changes due to external
57 * factors as well as DD load balancing.
58 * Returns TRUE the load balancing continues, FALSE is the balancing is done.
60 gmx_bool pme_load_balance(pme_load_balancing_t pme_lb,
67 interaction_const_t *ic,
68 nonbonded_verlet_t *nbv,
70 gmx_large_int_t step);
72 /* Restart the PME load balancing discarding all timings gathered up till now */
73 void restart_pme_loadbal(pme_load_balancing_t pme_lb, int n);
75 /* Finish the PME load balancing and print the settings when fplog!=NULL */
76 void pme_loadbal_done(pme_load_balancing_t pme_lb, FILE *fplog);
78 #endif /* _pme_loadbal_h */