瀏覽代碼

Support unbound threads

Samuel Thibault 11 年之前
父節點
當前提交
660d059e71
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 3 1
      src/core/topology.c
  2. 2 2
      src/core/topology.h

+ 3 - 1
src/core/topology.c

@@ -1000,13 +1000,15 @@ _starpu_init_machine_config (struct _starpu_machine_config *config, int no_mp_co
 void
 _starpu_bind_thread_on_cpu (
 	struct _starpu_machine_config *config STARPU_ATTRIBUTE_UNUSED,
-	unsigned cpuid)
+	int cpuid)
 {
 #ifdef STARPU_SIMGRID
 	return;
 #endif
 	if (starpu_get_env_number("STARPU_WORKERS_NOBIND") > 0)
 		return;
+	if (cpuid < 0)
+		return;
 #ifdef STARPU_HAVE_HWLOC
 	const struct hwloc_topology_support *support;
 

+ 2 - 2
src/core/topology.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2010, 2012  Université de Bordeaux 1
+ * Copyright (C) 2009-2010, 2012, 2014  Université de Bordeaux 1
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -38,7 +38,7 @@ unsigned _starpu_topology_get_nhwcpu(struct _starpu_machine_config *config);
 /* Bind the current thread on the CPU logically identified by "cpuid". The
  * logical ordering of the processors is either that of hwloc (if available),
  * or the ordering exposed by the OS. */
-void _starpu_bind_thread_on_cpu(struct _starpu_machine_config *config, unsigned cpuid);
+void _starpu_bind_thread_on_cpu(struct _starpu_machine_config *config, int cpuid);
 
 struct _starpu_combined_worker;
 /* Bind the current thread on the set of CPUs for the given combined worker. */