omp_get_thread_limit default

Hi,

calling “omp_get_thread_limit”, either inside or outside a parallel region, it returns MAX_INT (2147483647) when OMP_THREAD_LIMIT is not set.

Is that the correct/default behavior for that function?

Thanks.

Simone

Hi,

calling “omp_get_thread_limit”, either inside or outside a parallel region, it returns MAX_INT (2147483647) when OMP_THREAD_LIMIT is not set.

Is that the correct/default behavior for that function?

Thanks.

Simone

Hi Simone,

this function gives access to the ICV thread-limit-var. According to 2.1 de initial value of this ICV is implementation defined. So, MAX_INT is a valid value.

Best
- Joachim

At a more philosophical level, it's hard for the runtime to give any better answer,
because the runtime itself has no inbuilt limits. The things which will limit the number
of threads that can be created are system-wide resources like memory, and there is no
sane way for the runtime to predict which resource will run out, and, therefore, when
attempting to create another thread will fail.

-- Jim

Jim Cownie <james.h.cownie@intel.com>
SSG/DPD/TCAR (Technical Computing, Analyzers, and Runtimes)
Tel: +44 117 9071438