3
0
forked from pool/coreutils

Accepting request 135267 from home:froh:branches:Base:System

fix multithreading patch for sort(1) to respect OMP_NUM_THREADS again.
the other, "pending" request, #114813, was rejected by aj already

OBS-URL: https://build.opensuse.org/request/show/135267
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=158
This commit is contained in:
Philipp Thomas 2012-09-21 15:56:26 +00:00 committed by Git OBS Bridge
parent 81c6e98de3
commit 7778de0576
2 changed files with 15 additions and 7 deletions

View File

@ -1,15 +1,17 @@
Index: src/sort.c
===================================================================
--- src/sort.c.orig 2012-04-16 13:17:12.342019601 +0200
+++ src/sort.c 2012-04-16 13:17:12.463016705 +0200
@@ -5288,8 +5288,8 @@ main (int argc, char **argv)
--- src/sort.c.orig
+++ src/sort.c
@@ -5288,7 +5288,11 @@ main (int argc, char **argv)
{
if (!nthreads)
{
- unsigned long int np = num_processors (NPROC_CURRENT_OVERRIDABLE);
- nthreads = MIN (np, DEFAULT_MAX_THREADS);
+ //unsigned long int np = num_processors (NPROC_CURRENT_OVERRIDABLE);
+ nthreads = 1; //MIN (np, DEFAULT_MAX_THREADS);
+ unsigned long int np;
+ if (getenv("OMP_NUM_THREADS"))
+ np = num_processors (NPROC_CURRENT_OVERRIDABLE);
+ else
+ np = 1;
nthreads = MIN (np, DEFAULT_MAX_THREADS);
}
/* Avoid integer overflow later. */

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 21 11:55:12 UTC 2012 - froh@suse.com
- fix coreutils-8.9-singlethreaded-sort.patch to
respect OMP_NUM_THREADS again.
-------------------------------------------------------------------
Tue Jun 19 12:37:47 CEST 2012 - pth@suse.de