Gromacs
2018.8
|
#include <cstdio>
#include <vector>
#include "gromacs/ewald/pme.h"
#include "gromacs/utility/basedefinitions.h"
Declares utility functionality for dividing resources and checking for consistency and usefulness.
Functions | |
int | get_nthreads_mpi (const gmx_hw_info_t *hwinfo, gmx_hw_opt_t *hw_opt, const std::vector< int > &gpuIdsToUse, bool nonbondedOnGpu, bool pmeOnGpu, const t_inputrec *inputrec, const gmx_mtop_t *mtop, const gmx::MDLogger &mdlog, bool doMembed) |
Return the number of threads to use for thread-MPI based on how many were requested, which algorithms we're using, and how many particles there are. At the point we have already called check_and_update_hw_opt. Thus all options should be internally consistent and consistent with the hardware, except that ntmpi could be larger than number of GPUs. If necessary, this function will modify hw_opt->nthreads_omp. | |
void | check_resource_division_efficiency (const gmx_hw_info_t *hwinfo, bool willUsePhysicalGpu, gmx_bool bNtOmpOptionSet, t_commrec *cr, const gmx::MDLogger &mdlog) |
Check if the number of OpenMP threads is within reasonable range considering the hardware used. This is a crude check, but mainly intended to catch cases where the user starts 1 MPI rank per hardware thread or 1 rank per physical node. With a sub-optimal setup a note is printed to fplog and stderr when bNtOmpSet==TRUE; with bNtOptOptionSet==FALSE a fatal error is issued. This function should be called after thread-MPI and OpenMP are set up. | |
void | check_and_update_hw_opt_1 (const gmx::MDLogger &mdlog, gmx_hw_opt_t *hw_opt, const t_commrec *cr, int nPmeRanks) |
Checks we can do when we don't (yet) know the cut-off scheme. | |
void | check_and_update_hw_opt_2 (gmx_hw_opt_t *hw_opt, int cutoff_scheme) |
Checks we can do when we know the cut-off scheme. | |
void | checkAndUpdateRequestedNumOpenmpThreads (gmx_hw_opt_t *hw_opt, const gmx_hw_info_t &hwinfo, const t_commrec *cr, PmeRunMode pmeRunMode, const gmx_mtop_t &mtop) |
Check, and if necessary update, the number of OpenMP threads requested. More... | |
void | checkHardwareOversubscription (int numThreadsOnThisRank, const gmx::HardwareTopology &hwTop, const t_commrec *cr, const gmx::MDLogger &mdlog) |
Warns for oversubscribing the hardware threads, when that is the case. | |
void checkAndUpdateRequestedNumOpenmpThreads | ( | gmx_hw_opt_t * | hw_opt, |
const gmx_hw_info_t & | hwinfo, | ||
const t_commrec * | cr, | ||
PmeRunMode | pmeRunMode, | ||
const gmx_mtop_t & | mtop | ||
) |
Check, and if necessary update, the number of OpenMP threads requested.
Should be called when we know the MPI rank count and PME run mode.