浏览代码

Change the default value for configure option --enable-maxcpus to auto. it allows StarPU to automatically detect the number of CPUs on the running machine.

Nathalie Furmento 3 年之前
父节点
当前提交
cfb65fee99
共有 3 个文件被更改,包括 19 次插入3 次删除
  1. 5 2
      ChangeLog
  2. 9 1
      configure.ac
  3. 5 0
      doc/doxygen/chapters/510_configure_options.doxy

+ 5 - 2
ChangeLog

@@ -70,8 +70,11 @@ Small changes:
   * Rename
     - starpu_conf::sched_policy_init to starpu_conf::sched_policy_callback
     and
-   - starpu_sched_ctx_get_sched_policy_init() to starpu_sched_ctx_get_sched_policy_callback()
-   as the callback function may not only be used for init purposes
+    - starpu_sched_ctx_get_sched_policy_init() to starpu_sched_ctx_get_sched_policy_callback()
+    as the callback function may not only be used for init purposes
+  - Change the default value for configure option --enable-maxcpus to
+    auto. it allows StarPU to automatically detect the number of CPUs
+    on the running machine.
 
 StarPU 1.3.8
 ====================================================================

+ 9 - 1
configure.ac

@@ -1060,7 +1060,15 @@ fi
 AC_MSG_CHECKING(maximum number of CPUs)
 AC_ARG_ENABLE(maxcpus, [AS_HELP_STRING([--enable-maxcpus=<number>],
 			[maximum number of CPUs])],
-			maxcpus=$enableval, maxcpus=64)
+			maxcpus=$enableval, maxcpus=auto)
+if test x$maxcpus == xauto
+then
+	maxcpus=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
+	if test x$maxcpus = x
+	then
+		AC_MSG_ERROR([cannot get the number of CPUS, please specify a numerical value with --enable-maxcpus])
+	fi
+fi
 AC_MSG_RESULT($maxcpus)
 AC_DEFINE_UNQUOTED(STARPU_MAXCPUS, [$maxcpus], [Maximum number of CPUs supported])
 

+ 5 - 0
doc/doxygen/chapters/510_configure_options.doxy

@@ -182,6 +182,11 @@ about workers going to sleep and waking up.
 \addindex __configure__--enable-maxcpus
 Use at most <c>count</c> CPU cores.  This information is then
 available as the macro ::STARPU_MAXCPUS.
+
+The default value is <c>auto</c>. it allows StarPU to automatically
+detect the number of CPUs on the running machine. This should not be
+used if the running host has a different number of CPUs from the
+compilation node.
 </dd>
 
 <dt>--enable-maxnumanodes=<c>count</c></dt>