X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=blobdiff_plain;f=src%2Fgromacs%2Fmdrun%2Frunner.cpp;fp=src%2Fgromacs%2Fmdrun%2Frunner.cpp;h=8fc6d89a721e29cbc1980bf169c54bbe71f3b71c;hp=313b4ebb3409d37d90631281a3121e7e7a661bec;hb=c04377fde97785e4fa02bf229b56a67345271be7;hpb=0ce1837c232fa3e99ca90ce12ccb510e0b9a9ba2 diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 313b4ebb34..8fc6d89a72 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -1403,22 +1403,6 @@ int Mdrunner::mdrunner() int deviceId = -1; DeviceInformation* deviceInfo = gpuTaskAssignments.initDevice(&deviceId); - // timing enabling - TODO put this in gpu_utils (even though generally this is just option handling?) - bool useTiming = true; - - if (GMX_GPU_CUDA) - { - /* WARNING: CUDA timings are incorrect with multiple streams. - * This is the main reason why they are disabled by default. - */ - // TODO: Consider turning on by default when we can detect nr of streams. - useTiming = (getenv("GMX_ENABLE_GPU_TIMING") != nullptr); - } - else if (GMX_GPU_OPENCL) - { - useTiming = (getenv("GMX_DISABLE_GPU_TIMING") == nullptr); - } - // TODO Currently this is always built, yet DD partition code // checks if it is built before using it. Probably it should // become an MDModule that is made only when another module @@ -1506,8 +1490,9 @@ int Mdrunner::mdrunner() { dd_setup_dlb_resource_sharing(cr, deviceId); } - deviceStreamManager = std::make_unique( - *deviceInfo, havePPDomainDecomposition(cr), runScheduleWork.simulationWork, useTiming); + const bool useGpuTiming = decideGpuTimingsUsage(); + deviceStreamManager = std::make_unique( + *deviceInfo, havePPDomainDecomposition(cr), runScheduleWork.simulationWork, useGpuTiming); } // If the user chose a task assignment, give them some hints