From 7778de05761ac9dbf35e74c3b5bcef0018eea360eb3727f1e1f3720936e381c1 Mon Sep 17 00:00:00 2001 From: Philipp Thomas Date: Fri, 21 Sep 2012 15:56:26 +0000 Subject: [PATCH] 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 --- coreutils-8.9-singlethreaded-sort.patch | 16 +++++++++------- coreutils.changes | 6 ++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/coreutils-8.9-singlethreaded-sort.patch b/coreutils-8.9-singlethreaded-sort.patch index ff789ad..9bf7857 100644 --- a/coreutils-8.9-singlethreaded-sort.patch +++ b/coreutils-8.9-singlethreaded-sort.patch @@ -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. */ diff --git a/coreutils.changes b/coreutils.changes index 418981e..555ea6a 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -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