From f33b6cec0b8c0cff21a63d50a4577304fb32a751 Mon Sep 17 00:00:00 2001 From: atillack Date: Thu, 16 Sep 2021 14:29:25 -0400 Subject: [PATCH 1/2] Fixed memory freeing error when no filelist is used with more than one thread. --- host/src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/host/src/main.cpp b/host/src/main.cpp index 35a9915b..85d7ab05 100644 --- a/host/src/main.cpp +++ b/host/src/main.cpp @@ -477,6 +477,9 @@ int main(int argc, char* argv[]) if(mypars.resname) free(mypars.resname); } } // end of for loop +#ifdef USE_PIPELINE + #pragma omp single +#endif if(!filelist.used){ // Clean up memory dynamically allocated to not leak mypars.receptor_atoms.clear(); @@ -488,6 +491,7 @@ int main(int argc, char* argv[]) } } // end of parallel section if(initial_pars.xml2dlg && !initial_pars.dlg2stdout && (n_files>100)) printf("\n\n"); // finish progress bar + #ifndef _WIN32 // Total time measurement From d1a0ccafa16814bfb6aa939b6c16d35d80665ed2 Mon Sep 17 00:00:00 2001 From: atillack Date: Thu, 16 Sep 2021 19:23:06 -0700 Subject: [PATCH 2/2] Fix wrong Cuda device on multi-threaded runs with single GPU when multiple GPUs are present. --- host/src/performdocking.cpp.Cuda | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/host/src/performdocking.cpp.Cuda b/host/src/performdocking.cpp.Cuda index 54300ab8..dfa3491f 100644 --- a/host/src/performdocking.cpp.Cuda +++ b/host/src/performdocking.cpp.Cuda @@ -119,16 +119,12 @@ void setup_gpu_for_docking( GpuTempData& tData ) { - cudaError_t status; - if(cData.devnum<-1){ - status = cudaSetDevice(cData.devid); - return; // device already setup - } + if(cData.devnum<-1) return; // device already setup auto const t0 = std::chrono::steady_clock::now(); // Initialize CUDA int gpuCount=0; - status = cudaGetDeviceCount(&gpuCount); + cudaError_t status = cudaGetDeviceCount(&gpuCount); RTERROR(status, "cudaGetDeviceCount failed"); if (gpuCount == 0) { @@ -316,7 +312,7 @@ parameters argc and argv: if(output!=NULL) outbuf = (char*)malloc(256*sizeof(char)); auto const t1 = std::chrono::steady_clock::now(); - cudaError_t status; + cudaError_t status = cudaSetDevice(cData.devid); // make sure we're on the correct device Liganddata myligand_reference; @@ -590,21 +586,6 @@ parameters argc and argv: unsigned int ite_cnt = 0; #endif - /* - // Added for printing intracontributor_pairs (autodockdevpy) - for (unsigned int intrapair_cnt=0; - intrapair_cnt