Hi!
On 2024-02-01T19:20:57+0000, John David Anglin <[email protected]> wrote:
> Tested on hppa-unknown-linux-gnu. Committed to trunk.
> Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
>
> We support a maximum of 50 threads on 32-bit hppa.
What happens if you go higher? Curious, what/why is that architectural
limit of 50 threads?
I wonder: shouldn't that cap at 50 threads happen inside libgomp,
generally, instead of per test case and user code (!)? Per my
understanding, OpenMP 'num_threads' specifies a *desired* number of
threads; the implementation may limit that value.
Grüße
Thomas
> --- a/libgomp/testsuite/libgomp.c++/loop-3.C
> +++ b/libgomp/testsuite/libgomp.c++/loop-3.C
> @@ -1,3 +1,9 @@
> +#if defined(__hppa__) && !defined(__LP64__)
> +#define NUM_THREADS 50
> +#else
> +#define NUM_THREADS 64
> +#endif
> +
> extern "C" void abort (void);
> int a;
>
> @@ -19,7 +25,7 @@ foo ()
> int
> main (void)
> {
> -#pragma omp parallel num_threads (64)
> +#pragma omp parallel num_threads (NUM_THREADS)
> foo ();
>
> return 0;
> --- a/libgomp/testsuite/libgomp.c/omp-loop03.c
> +++ b/libgomp/testsuite/libgomp.c/omp-loop03.c
> @@ -1,3 +1,9 @@
> +#if defined(__hppa__) && !defined(__LP64__)
> +#define NUM_THREADS 50
> +#else
> +#define NUM_THREADS 64
> +#endif
> +
> extern void abort (void);
> int a;
>
> @@ -19,7 +25,7 @@ foo ()
> int
> main (void)
> {
> -#pragma omp parallel num_threads (64)
> +#pragma omp parallel num_threads (NUM_THREADS)
> foo ();
>
> return 0;