diff --git a/CHANGELOG.md b/CHANGELOG.md index fac0b02b841..d1057c15013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - PR #384 Fixed bug in snmg coo2csr causing error in dask-cugraph tests. - PR #382 Disabled vertex id check to allow Azure deployment - PR #410 Fixed overflow error in SNMG COO2CSR +- PR #395 run omp_ge_num_threads in a parallel context # cuGraph 0.8.0 (27 June 2019) diff --git a/cpp/src/sort/sort_impl.cuh b/cpp/src/sort/sort_impl.cuh index edd8c9712b0..2423caf9529 100644 --- a/cpp/src/sort/sort_impl.cuh +++ b/cpp/src/sort/sort_impl.cuh @@ -457,8 +457,13 @@ namespace cusort { // Used for partitioning the output and ensuring that each GPU sorts a near equal number of elements. Length_t average_array_size = (keyCount + num_gpus - 1) / num_gpus; - int original_number_threads = omp_get_num_threads(); - + int original_number_threads = 0; +#pragma omp parallel + { + if (omp_get_thread_num() == 0) + original_number_threads = omp_get_num_threads(); + } + omp_set_num_threads(num_gpus); #pragma omp parallel