[Openmp-commits] [openmp] [OpenMP] Use half of available logical processors for collapse tests (PR #88319)

via Openmp-commits openmp-commits at lists.llvm.org
Thu Apr 18 13:35:03 PDT 2024


================
@@ -106,12 +106,14 @@ int test() {
   unsigned scalarCount = 0;
   unsigned uselessThreadsOpenMP = 0;
   unsigned usefulThreadsOpenMP = 0;
-  unsigned chunkSizesOpenmp[MAX_THREADS] = {0};
 
-  unsigned num_threads = omp_get_max_threads();
+  // Use half of the available threads/logical processor.
+  unsigned num_threads = omp_get_max_threads() / 2;
   if (num_threads > MAX_THREADS)
     num_threads = MAX_THREADS;
-  omp_set_num_threads(num_threads);
+
+  unsigned *chunkSizesOpenmp = malloc(sizeof(unsigned) * num_threads);
----------------
jprotze wrote:

Yes, that's the change I proposed.

https://github.com/llvm/llvm-project/pull/88319


More information about the Openmp-commits mailing list