Commit 4f9c450c by Jakub Jelinek Committed by Jakub Jelinek

re PR libgomp/32468 (number of threads in a parallel region depends on number of…

re PR libgomp/32468 (number of threads in a parallel region depends on number of SECTIONs and MAX_THREADS)

	PR libgomp/32468
	* sections.c (GOMP_parallel_sections_start): Only decrease
	number of threads to COUNT if dyn_var is true.
	* testsuite/libgomp.c/pr32468.c: New test.

From-SVN: r126224
parent 83cc1ba1
2007-07-02 Jakub Jelinek <jakub@redhat.com>
PR libgomp/32468
* sections.c (GOMP_parallel_sections_start): Only decrease
number of threads to COUNT if dyn_var is true.
* testsuite/libgomp.c/pr32468.c: New test.
2007-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR libgomp/26308
......
/* Copyright (C) 2005 Free Software Foundation, Inc.
/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
......@@ -106,7 +106,7 @@ GOMP_parallel_sections_start (void (*fn) (void *), void *data,
struct gomp_work_share *ws;
num_threads = gomp_resolve_num_threads (num_threads);
if (num_threads > count)
if (gomp_dyn_var && num_threads > count)
num_threads = count;
ws = gomp_new_work_share (false, num_threads);
......
/* PR libgomp/32468 */
/* { dg-do run } */
#include <omp.h>
#include <stdlib.h>
int
main (void)
{
int res[2] = { -1, -1 };
omp_set_dynamic (0);
omp_set_num_threads (4);
#pragma omp parallel
{
#pragma omp sections
{
#pragma omp section
res[0] = omp_get_num_threads () != 4;
#pragma omp section
res[1] = omp_get_num_threads () != 4;
}
}
if (res[0] != 0 || res[1] != 0)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment