Skip to content

Commit

Permalink
Merge pull request rapidsai#395 from ChuckHastings/bug_snmg_sort_omp_…
Browse files Browse the repository at this point in the history
…threads

[REVIEW] run omp_get_num_threads in a parallel context
  • Loading branch information
BradReesWork authored Jul 22, 2019
2 parents b9679ee + ba9ef44 commit e038d75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- PR #378 cugraph was unable to import device_of_gpu_pointer
- PR #384 Fixed bug in snmg coo2csr causing error in dask-cugraph tests.
- PR #382 Disabled vertex id check to allow Azure deployment
- PR #395 run omp_ge_num_threads in a parallel context


# cuGraph 0.8.0 (27 June 2019)
Expand Down
9 changes: 7 additions & 2 deletions cpp/src/sort/sort_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e038d75

Please sign in to comment.