random_shuffle.h: (parallel_random_shuffle_drs) Get the actual number of threads after entering...

2008-06-05  Johannes Singler  <singler@ira.uka.de>

        * include/parallel/random_shuffle.h:
        (parallel_random_shuffle_drs) Get the actual number of
        threads after entering the parallel region. Indentation.
        * include/parallel/algo.h: (random_shuffle(begin, end))
        Add namespace qualification to avoid ambiguity.

From-SVN: r136405
This commit is contained in:
Johannes Singler 2008-06-05 15:45:10 +00:00 committed by Johannes Singler
parent 8ba965b514
commit 5d336e9db5
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2008-06-05 Johannes Singler <singler@ira.uka.de>
* include/parallel/random_shuffle.h:
(parallel_random_shuffle_drs) Get the actual number of
threads after entering the parallel region. Indentation.
* include/parallel/algo.h: (random_shuffle(begin, end))
Add namespace qualification to avoid ambiguity.
2008-05-15 Johannes Singler <singler@ira.uka.de>
* doc/xml/manual/parallel_mode.xml:

View File

@ -1647,7 +1647,7 @@ namespace __parallel
{
c_rand_number<> r;
// Parallelization still possible.
random_shuffle(begin, end, r);
__gnu_parallel::random_shuffle(begin, end, r);
}
// Parallel algorithm for random access iterators.

View File

@ -333,6 +333,7 @@ template<typename RandomAccessIterator, typename RandomNumberGenerator>
# pragma omp parallel num_threads(num_threads)
{
thread_index_t num_threads = omp_get_num_threads();
# pragma omp single
{
pus = new DRSSorterPU<RandomAccessIterator, random_number>
@ -375,9 +376,9 @@ template<typename RandomAccessIterator, typename RandomNumberGenerator>
}
starts[num_threads] = start;
} //single
// Now shuffle in parallel.
parallel_random_shuffle_drs_pu(pus);
}
// Now shuffle in parallel.
parallel_random_shuffle_drs_pu(pus);
} // parallel
delete[] starts;
delete[] sd.bin_proc;