Pārlūkot izejas kodu

Do not hardcode the maximum number of workers in the starpu.h header. Instead,
we use autoconf to compute this number.

Cédric Augonnet 15 gadi atpakaļ
vecāks
revīzija
74cc2f1adc
3 mainītis faili ar 8 papildinājumiem un 4 dzēšanām
  1. 7 0
      configure.ac
  2. 0 4
      include/starpu.h
  3. 1 0
      include/starpu_config.h.in

+ 7 - 0
configure.ac

@@ -658,6 +658,13 @@ AC_MSG_RESULT($perf_model_dir)
 AC_CHECK_LIB([rt], [clock_gettime])
 AC_CHECK_FUNCS([clock_gettime])
 
+# Compute the maximum number of workers (we round it to 16 for alignment
+# purposes).
+nmaxworkers=`expr 16 \* \( \( $nmaxcpus + $nmaxcudadev + $nmaxopencldev + 15 \) / 16 \) `
+AC_MSG_CHECKING(Maximum number of workers)
+AC_MSG_RESULT($nmaxworkers)
+AC_DEFINE_UNQUOTED(STARPU_NMAXWORKERS, [$nmaxworkers], [Maximum number of workers])
+
 ###############################################################################
 #                                                                             #
 #                                    MPI                                      #

+ 0 - 4
include/starpu.h

@@ -20,10 +20,6 @@
 #include <stdlib.h>
 #include <stdint.h>
 
-/* Maximum number of workers supported by StarPU, the actual number of worker
- * is given by the startpu_get_worker_count method */
-#define STARPU_NMAXWORKERS	32
-
 #include <starpu_config.h>
 #include <starpu_util.h>
 #include <starpu_data.h>

+ 1 - 0
include/starpu_config.h.in

@@ -39,6 +39,7 @@
 #undef STARPU_NMAXBUFS
 #undef STARPU_MAXCUDADEVS
 #undef STARPU_MAXOPENCLDEVS
+#undef STARPU_NMAXWORKERS
 
 #undef STARPU_HAVE_LIBNUMA