From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5463 invoked by alias); 6 May 2008 09:13:21 -0000 Received: (qmail 5446 invoked by uid 22791); 6 May 2008 09:13:20 -0000 X-Spam-Check-By: sourceware.org Received: from iramx2.ira.uni-karlsruhe.de (HELO iramx2.ira.uni-karlsruhe.de) (141.3.10.81) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 06 May 2008 09:12:56 +0000 Received: from irams1.ira.uni-karlsruhe.de ([141.3.10.5]) by iramx2.ira.uni-karlsruhe.de with esmtps id 1JtJEB-0000br-6M; Tue, 06 May 2008 11:12:52 +0200 Received: from i10pc67.ilkd.uni-karlsruhe.de ([141.3.24.67]) by irams1.ira.uni-karlsruhe.de with esmtp id 1JtJEC-0003d1-2T; Tue, 06 May 2008 11:12:52 +0200 Message-ID: <48202113.4080900@ira.uka.de> Date: Tue, 06 May 2008 10:08:00 -0000 From: Johannes Singler User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: libstdc++ , gcc-patches@gcc.gnu.org Subject: [PATCH][libstdc++-v3 parallel mode] Content-Type: multipart/mixed; boundary="------------010203060107080505010008" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg00292.txt.bz2 This is a multi-part message in MIME format. --------------010203060107080505010008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 563 This patch improves handling the number of threads in parallel quicksort. Before, needless threads were created. This is a relict from switching to a more OpenMP compliant behavior. Tested x86_64-unknown-linux-gnu: No regressions Please approve for mainline and gcc-4_3-branch. 2008-05-06 Johannes Singler * include/parallel/quicksort.h: (parallel_sort_qs_conquer) Explicitly request number of threads in the parallel clause. (parallel_sort_qs) Remove setting the number of threads globally. Johannes --------------010203060107080505010008 Content-Type: text/x-patch; name="quicksort_without_set_num_threads.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="quicksort_without_set_num_threads.patch" Content-length: 702 Index: include/parallel/quicksort.h =================================================================== --- include/parallel/quicksort.h (revision 134945) +++ include/parallel/quicksort.h (working copy) @@ -138,7 +138,7 @@ _Settings::get().sort_qs_num_samples_preset, num_threads); -#pragma omp parallel sections +#pragma omp parallel sections num_threads(2) { #pragma omp section parallel_sort_qs_conquer(begin, begin + split, @@ -177,9 +177,6 @@ if (num_threads > n) num_threads = static_cast(n); - // Hard to avoid. - omp_set_num_threads(num_threads); - parallel_sort_qs_conquer(begin, begin + n, comp, num_threads); } --------------010203060107080505010008--