From fe166514c26e40351a9103b37879193cf15be012 Mon Sep 17 00:00:00 2001 From: Paul Bauer Date: Fri, 29 Nov 2019 16:00:52 +0100 Subject: [PATCH] Set update to run on GPU by default if possible Change-Id: I1a2052968c8d8dd8020744bf15f974bc0d92a6ef --- src/gromacs/mdrun/runner.cpp | 16 ++-------------- src/gromacs/taskassignment/decidegpuusage.cpp | 6 ++---- src/gromacs/taskassignment/decidegpuusage.h | 4 +--- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index fd9700e453..7ce0a14071 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -175,8 +175,6 @@ struct DevelopmentFeatureFlags //! True if the Buffer ops development feature is enabled // TODO: when the trigger of the buffer ops offload is fully automated this should go away bool enableGpuBufferOps = false; - //! If true, forces 'mdrun -update auto' default to 'gpu' - bool forceGpuUpdateDefaultOn = false; //! True if the GPU halo exchange development feature is enabled bool enableGpuHaloExchange = false; //! True if the PME PP direct communication GPU development feature is enabled @@ -211,7 +209,6 @@ static DevelopmentFeatureFlags manageDevelopmentFeatures(const gmx::MDLogger& md #pragma GCC diagnostic ignored "-Wunused-result" devFlags.enableGpuBufferOps = (getenv("GMX_USE_GPU_BUFFER_OPS") != nullptr) && (GMX_GPU == GMX_GPU_CUDA) && useGpuForNonbonded; - devFlags.forceGpuUpdateDefaultOn = (getenv("GMX_FORCE_UPDATE_DEFAULT_GPU") != nullptr); devFlags.enableGpuHaloExchange = (getenv("GMX_GPU_DD_COMMS") != nullptr && GMX_THREAD_MPI && (GMX_GPU == GMX_GPU_CUDA)); devFlags.enableGpuPmePPComm = @@ -255,15 +252,6 @@ static DevelopmentFeatureFlags manageDevelopmentFeatures(const gmx::MDLogger& md } } - if (devFlags.forceGpuUpdateDefaultOn) - { - GMX_LOG(mdlog.warning) - .asParagraph() - .appendTextFormatted( - "NOTE: This run will default to '-update gpu' as requested by the " - "GMX_FORCE_UPDATE_DEFAULT_GPU environment variable."); - } - if (devFlags.enableGpuPmePPComm) { if (pmeRunMode == PmeRunMode::GPU) @@ -908,8 +896,8 @@ int Mdrunner::mdrunner() try { useGpuForUpdate = decideWhetherToUseGpuForUpdate( - devFlags.forceGpuUpdateDefaultOn, useDomainDecomposition, useGpuForPme, - useGpuForNonbonded, updateTarget, gpusWereDetected, *inputrec, mtop, doEssentialDynamics, + useDomainDecomposition, useGpuForPme, useGpuForNonbonded, updateTarget, + gpusWereDetected, *inputrec, mtop, doEssentialDynamics, gmx_mtop_ftype_count(mtop, F_ORIRES) > 0, replExParams.exchangeInterval > 0); } GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR diff --git a/src/gromacs/taskassignment/decidegpuusage.cpp b/src/gromacs/taskassignment/decidegpuusage.cpp index 0cd35168ea..a83b2b82e0 100644 --- a/src/gromacs/taskassignment/decidegpuusage.cpp +++ b/src/gromacs/taskassignment/decidegpuusage.cpp @@ -488,8 +488,7 @@ bool decideWhetherToUseGpusForBonded(const bool useGpuForNonbonded, return gpusWereDetected && usingOurCpuForPmeOrEwald; } -bool decideWhetherToUseGpuForUpdate(const bool forceGpuUpdateDefaultOn, - const bool isDomainDecomposition, +bool decideWhetherToUseGpuForUpdate(const bool isDomainDecomposition, const bool useGpuForPme, const bool useGpuForNonbonded, const TaskTarget updateTarget, @@ -602,8 +601,7 @@ bool decideWhetherToUseGpuForUpdate(const bool forceGpuUpdateDefaultOn, return false; } - return ((forceGpuUpdateDefaultOn && updateTarget == TaskTarget::Auto) - || (updateTarget == TaskTarget::Gpu)); + return true; } } // namespace gmx diff --git a/src/gromacs/taskassignment/decidegpuusage.h b/src/gromacs/taskassignment/decidegpuusage.h index 5bbc1b231c..08ff410b40 100644 --- a/src/gromacs/taskassignment/decidegpuusage.h +++ b/src/gromacs/taskassignment/decidegpuusage.h @@ -231,7 +231,6 @@ bool decideWhetherToUseGpusForBonded(bool useGpuForNonbonded, /*! \brief Decide whether to use GPU for update. * - * \param[in] forceGpuUpdateDefaultOn If the update should be offloaded by default. * \param[in] isDomainDecomposition Whether there more than one domain. * \param[in] useGpuForPme Whether GPUs will be used for PME interactions. * \param[in] useGpuForNonbonded Whether GPUs will be used for nonbonded interactions. @@ -247,8 +246,7 @@ bool decideWhetherToUseGpusForBonded(bool useGpuForNonbonded, * \throws std::bad_alloc If out of memory * InconsistentInputError If the user requirements are inconsistent. */ -bool decideWhetherToUseGpuForUpdate(bool forceGpuUpdateDefaultOn, - bool isDomainDecomposition, +bool decideWhetherToUseGpuForUpdate(bool isDomainDecomposition, bool useGpuForPme, bool useGpuForNonbonded, TaskTarget updateTarget, -- 2.22.0