Browse Source

When hwloc reports different kinds of CPUs, warn that StarPU does not support this heterogeneity yet

Samuel Thibault 4 years ago
parent
commit
5516059cb8
2 changed files with 7 additions and 0 deletions
  1. 1 0
      configure.ac
  2. 6 0
      src/core/topology.c

+ 1 - 0
configure.ac

@@ -3169,6 +3169,7 @@ AS_IF([test "$have_valid_hwloc" = "yes"],
 
 AC_CHECK_FUNCS([hwloc_topology_dup])
 AC_CHECK_FUNCS([hwloc_topology_set_components])
+AC_CHECK_FUNCS([hwloc_cpukinds_get_nr])
 AM_CONDITIONAL(STARPU_HWLOC_HAVE_TOPOLOGY_DUP, test $ac_cv_func_hwloc_topology_dup = yes)
 
 LIBS="${SAVED_LIBS}"

+ 6 - 0
src/core/topology.c

@@ -853,6 +853,12 @@ static void _starpu_init_topology(struct _starpu_machine_config *config)
 	_starpu_topology_filter(topology->hwtopology);
 	hwloc_topology_load(topology->hwtopology);
 
+#ifdef HAVE_HWLOC_CPUKINDS_GET_NR
+	int nr_kinds = hwloc_cpukinds_get_nr(topology->hwtopology, 0);
+	if (nr_kinds > 1)
+		_STARPU_DISP("Warning: there are several kinds of CPU on this system. For now StarPU assumes all CPU are equal\n", strerror(errno));
+#endif
+
 	if (starpu_get_env_number_default("STARPU_WORKERS_GETBIND", 0))
 	{
 		/* Respect the existing binding */