Browse Source

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 16 years ago
parent
commit
82828a010d
1 changed files with 10 additions and 3 deletions
  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_t set = obj->cpuset;
 	hwloc_cpuset_singlify(set);
 	hwloc_cpuset_singlify(set);
 	ret = hwloc_set_cpubind(config->hwtopology, set, HWLOC_CPUBIND_THREAD);
 	ret = hwloc_set_cpubind(config->hwtopology, set, HWLOC_CPUBIND_THREAD);
+	if (ret)
+	{
+		perror("binding thread");
+		STARPU_ASSERT(0);
+	}
+
 #elif defined(HAVE_PTHREAD_SETAFFINITY_NP)
 #elif defined(HAVE_PTHREAD_SETAFFINITY_NP)
 	/* fix the thread on the correct cpu */
 	/* fix the thread on the correct cpu */
 	cpu_set_t aff_mask;
 	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();
 	pthread_t self = pthread_self();
 
 
 	ret = pthread_setaffinity_np(self, sizeof(aff_mask), &aff_mask);
 	ret = pthread_setaffinity_np(self, sizeof(aff_mask), &aff_mask);
-#else
-#warning no CPU binding support
-#endif
 	if (ret)
 	if (ret)
 	{
 	{
 		perror("binding thread");
 		perror("binding thread");
 		STARPU_ASSERT(0);
 		STARPU_ASSERT(0);
 	}
 	}
+
+#else
+#warning no CPU binding support
+#endif
 }
 }
 
 
 static void init_workers_binding(struct machine_config_s *config)
 static void init_workers_binding(struct machine_config_s *config)