Просмотр исходного кода

On some systems (eg. MacOS), it's just not possible to bind threads at all, so
we don't consider it as an error anymore.

Cédric Augonnet лет назад: 15
Родитель
Сommit
82828a010d
1 измененных файлов с 10 добавлено и 3 удалено
  1. 10 3
      src/core/topology.c

+ 10 - 3
src/core/topology.c

@@ -369,6 +369,12 @@ void bind_thread_on_cpu(struct machine_config_s *config __attribute__((unused)),
 	hwloc_cpuset_t set = obj->cpuset;
 	hwloc_cpuset_singlify(set);
 	ret = hwloc_set_cpubind(config->hwtopology, set, HWLOC_CPUBIND_THREAD);
+	if (ret)
+	{
+		perror("binding thread");
+		STARPU_ASSERT(0);
+	}
+
 #elif defined(HAVE_PTHREAD_SETAFFINITY_NP)
 	/* fix the thread on the correct cpu */
 	cpu_set_t aff_mask;
@@ -378,14 +384,15 @@ void bind_thread_on_cpu(struct machine_config_s *config __attribute__((unused)),
 	pthread_t self = pthread_self();
 
 	ret = pthread_setaffinity_np(self, sizeof(aff_mask), &aff_mask);
-#else
-#warning no CPU binding support
-#endif
 	if (ret)
 	{
 		perror("binding thread");
 		STARPU_ASSERT(0);
 	}
+
+#else
+#warning no CPU binding support
+#endif
 }
 
 static void init_workers_binding(struct machine_config_s *config)