random_shuffle.h: (parallel_random_shuffle_drs) Get the actual number of threads...
authorJohannes Singler <singler@ira.uka.de>
Thu, 5 Jun 2008 15:47:17 +0000 (15:47 +0000)
committerJohannes Singler <singler@gcc.gnu.org>
Thu, 5 Jun 2008 15:47:17 +0000 (15:47 +0000)
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: r136406

libstdc++-v3/ChangeLog
libstdc++-v3/include/parallel/algo.h
libstdc++-v3/include/parallel/random_shuffle.h

index d06e303f343e98938d1297316e1142a4c85ba256..0f2e56c57a7899bbeb98b92864d3ecaa5b1a4a97 100644 (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-06-04  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/ext/pb_ds/assoc_container.hpp: Change allocator typedef
index 397d7cbcb4f94892b39739d6a898348c29d65520..4aa4d8af47f6d1d56e113c3ea088134f872eb6c5 100644 (file)
@@ -1649,7 +1649,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.
index 75d9e18d23af3d9f7a45c76c69584ca253d8609d..1f7cc10742d3fb2fdbbaecb7eb91f09b4a09c874 100644 (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;