Add GMX_DISABLE_GPU_TIMING env var
authorSzilárd Páll <pall.szilard@gmail.com>
Tue, 25 Oct 2016 22:52:37 +0000 (00:52 +0200)
committerSzilárd Páll <pall.szilard@gmail.com>
Wed, 26 Oct 2016 23:14:44 +0000 (01:14 +0200)
It disables timing for both CUDA and OpenCL so on the long run
it can replace both.

Change-Id: I3556d87c135eba2e24935e77a0d608b72219b284

docs/user-guide/environment-variables.rst
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp

index 9b4114081bc3df82af669e9d3ac37df2080f40b4..df2acc761c2e131f66ed2c43c44fbfc9459ab007 100644 (file)
@@ -136,6 +136,9 @@ Performance and Run Control
         disable the use of the lower-latency cudaLaunchKernel API even when supported (CUDA >=v7.0).
         Should only be used for benchmarking purposes.
 
+``GMX_DISABLE_CUDA_TIMING``
+        Disables GPU timing of CUDA tasks; synonymous with ``GMX_DISABLE_GPU_TIMING``.
+
 ``GMX_CYCLE_ALL``
         times all code during runs.  Incompatible with threads.
 
@@ -173,7 +176,7 @@ Performance and Run Control
         disables architecture-specific SIMD-optimized (SSE2, SSE4.1, AVX, etc.)
         non-bonded kernels thus forcing the use of plain C kernels.
 
-``GMX_DISABLE_CUDA_TIMING``
+``GMX_DISABLE_GPU_TIMING``
         timing of asynchronously executed GPU operations can have a
         non-negligible overhead with short step times. Disabling timing can improve performance in these cases.
 
index 5239842a9ec6e8da0d489c2bfbebe2c8a4da31ef..a061f795f3f8082b3c237f39371da78deb8af9a8 100644 (file)
@@ -655,10 +655,11 @@ void nbnxn_gpu_init(gmx_nbnxn_cuda_t         **p_nb,
 
     /* CUDA timing disabled as event timers don't work:
        - with multiple streams = domain-decomposition;
-       - when turned off by GMX_DISABLE_CUDA_TIMING.
+       - when turned off by GMX_DISABLE_CUDA_TIMING/GMX_DISABLE_GPU_TIMING.
      */
     nb->bDoTime = (!nb->bUseTwoStreams &&
-                   (getenv("GMX_DISABLE_CUDA_TIMING") == NULL));
+                   (getenv("GMX_DISABLE_CUDA_TIMING") == NULL) &&
+                   (getenv("GMX_DISABLE_GPU_TIMING") == NULL));
 
     if (nb->bDoTime)
     {
index c7e3329a7c210d8dd3a595684d4292c607350c47..bd7398cc0a14d294536ed0edf7e6241c81e42cb8 100644 (file)
@@ -738,7 +738,9 @@ void nbnxn_gpu_init(gmx_nbnxn_ocl_t          **p_nb,
     init_plist(nb->plist[eintLocal]);
 
     /* OpenCL timing disabled if GMX_DISABLE_OCL_TIMING is defined. */
-    nb->bDoTime = (getenv("GMX_DISABLE_OCL_TIMING") == NULL);
+    /* TODO deprecate the first env var in the 2017 release. */
+    nb->bDoTime = (getenv("GMX_DISABLE_OCL_TIMING") == NULL &&
+                   getenv("GMX_DISABLE_GPU_TIMING") == NULL);
 
     /* Create queues only after bDoTime has been initialized */
     if (nb->bDoTime)