Ver código fonte

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 anos atrás
pai
commit
82828a010d
1 arquivos alterados com 10 adições e 3 exclusões
  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)