Browse Source

small fixes

Samuel Thibault 8 years ago
parent
commit
1aefee7563

+ 11 - 9
configure.ac

@@ -1,6 +1,6 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2016  Université de Bordeaux
+# Copyright (C) 2009-2017  Université de Bordeaux
 # Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
 # Copyright (C) 2011  Télécom-SudParis
 # Copyright (C) 2011, 2012, 2014-2016  INRIA
@@ -164,23 +164,25 @@ AM_CONDITIONAL([STARPU_USE_MIC], [test "x$enable_mic" = "xyes"])
 #                                                                             #
 ###############################################################################
 
+AC_MSG_CHECKING(maximum number of NUMA nodes)
+AC_ARG_ENABLE(maxnumanodes, [AS_HELP_STRING([--enable-maxnumanodes=<number>],
+			[maximum number of NUMA nodes])],
+			nmaxnumanodes=$enableval, nmaxnumanodes=16)
+AC_MSG_RESULT($nmaxnumanodes)
+AC_DEFINE_UNQUOTED(STARPU_MAXNUMANODES, [$nmaxnumanodes],
+		[maximum number of NUMA nodes])
+
 AC_ARG_ENABLE(numa, [AS_HELP_STRING([--enable-numa],
 	      [use NUMA node(s)])], [enable_numa=$enableval], [enable_numa=no])
 
 if test x$enable_numa = xyes ; then
 	AC_DEFINE(STARPU_USE_NUMA, [1], [NUMA memory nodes support is enabled])
+else
+	nmaxnumanodes=1
 fi
 
 AM_CONDITIONAL([STARPU_USE_NUMA], [test "x$enable_numa" = "xyes"])
 
-AC_MSG_CHECKING(maximum number of NUMA nodes)
-AC_ARG_ENABLE(maxnumanodes, [AS_HELP_STRING([--enable-maxnumanodes=<number>],
-			[maximum number of NUMA nodes])],
-			nmaxnumanodes=$enableval, nmaxnumanodes=16)
-AC_MSG_RESULT($nmaxnumanodes)
-AC_DEFINE_UNQUOTED(STARPU_MAXNUMANODES, [$nmaxnumanodes],
-		[maximum number of NUMA nodes])
-
 
 ###############################################################################
 

+ 17 - 38
src/core/topology.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 CNRS
  * Copyright (C) 2011, 2016  INRIA
  * Copyright (C) 2016  Uppsala University
@@ -57,11 +57,14 @@ static int nobind;
 
 /* For checking whether two workers share the same PU, indexed by PU number */
 static int cpu_worker[STARPU_MAXCPUS];
-#ifdef STARPU_USE_NUMA
 static unsigned nb_numa_nodes = 0;
 static unsigned numa_memory_nodes[STARPU_MAXNUMANODES];
-#endif /* STARPU_USE_NUMA */
-
+static unsigned numa_numaid[STARPU_MAXNODES];
+#ifdef STARPU_USE_NUMA
+static int _starpu_worker_numa_node(unsigned workerid);
+#else
+#define _starpu_worker_numa_node(workerid) 0
+#endif
 
 
 #if defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL) || defined(STARPU_USE_SCC) || defined(STARPU_SIMGRID)
@@ -810,7 +813,7 @@ _starpu_topology_get_nhwpu (struct _starpu_machine_config *config)
 	return config->topology.nhwpus;
 }
 
-unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config)
+unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config STARPU_ATTRIBUTE_UNUSED)
 {
 #ifdef STARPU_USE_NUMA
 	struct _starpu_machine_topology *topology = &config->topology ;
@@ -1537,7 +1540,6 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
 
 	/* note that even if the CPU cpu are not used, we always have a RAM
 	 * node */
-	/* TODO : support NUMA  ;) */
 	ram_memory_node = _starpu_memory_node_register(STARPU_CPU_RAM, 0);
 	STARPU_ASSERT(ram_memory_node == STARPU_MAIN_RAM);
 
@@ -1555,21 +1557,16 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
 	/* Each device is initialized,
 	 * giving it a memory node and a core bind id.
 	 */
-	/* TODO: STARPU_MAXNUMANODES */
-#ifdef STARPU_USE_NUMA
+	nb_numa_nodes = 1;
 	unsigned n;
 	unsigned numa_init[STARPU_MAXNUMANODES];
 	numa_init[0] = 1 ;
-	nb_numa_nodes = 1;
 	numa_memory_nodes[0] = ram_memory_node ;
+	numa_numaid[ram_memory_node] = 0;
 	for (n=1; n<STARPU_MAXNUMANODES; n++)
 	{
 		numa_init[n] = 0;
 	}	
-#else /* STARPU_USE_NUMA */
-	unsigned numa_init[1] = { 1 };
-	unsigned numa_memory_nodes[1] = { ram_memory_node };
-#endif /* STARPU_USE_NUMA */
 #if defined(STARPU_USE_CUDA) || defined(STARPU_SIMGRID)
 	unsigned cuda_init[STARPU_MAXCUDADEVS] = { };
 	unsigned cuda_memory_nodes[STARPU_MAXCUDADEVS];
@@ -1614,12 +1611,7 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
 			case STARPU_CPU_WORKER:
 			{
 				workerarg->bindid = _starpu_get_next_bindid(config, NULL, 0);
-				/* TODO: NUMA */
-#ifdef STARPU_USE_NUMA
 				int numaid = workerarg->numa_memory_node = _starpu_worker_numa_node(worker);
-#else /* STARPU_USE_NUMA */
-				int numaid = 0;
-#endif /* STARPU_USE_NUMA */
 				/* "dedicate" a cpu core to that worker */
 				if (numa_init[numaid])
 				{
@@ -1628,10 +1620,9 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
 				else
 				{
 					numa_init[numaid] = 1;
-#ifdef STARPU_USE_NUMA
 					nb_numa_nodes++;
-#endif /* STARPU_USE_NUMA */
 					memory_node = numa_memory_nodes[numaid] = _starpu_memory_node_register(STARPU_CPU_RAM, numaid);
+					numa_numaid[memory_node] = numaid;
 #ifdef STARPU_SIMGRID
 					snprintf(name, sizeof(name), "RAM%d", numaid);
 					host = _starpu_simgrid_get_host_by_name(name);
@@ -1639,17 +1630,11 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
 					_starpu_simgrid_memory_node_set_host(memory_node, host);
 #endif
 				}
-				//workerarg->bindid = _starpu_get_next_bindid(config, NULL, 0);
 				_starpu_memory_node_add_nworkers(memory_node);
 #ifdef STARPU_SIMGRID
 				starpu_pthread_queue_register(&workerarg->wait, &_starpu_simgrid_transfer_queue[memory_node]);
-#ifdef STARPU_USE_NUMA
-				if (_starpu_node_get_kind(memory_node) != STARPU_CPU_RAM)
-					starpu_pthread_queue_register(&workerarg->wait, &_starpu_simgrid_transfer_queue[STARPU_MAIN_RAM]);
-#else /* STARPU_USE_NUMA */
-				if (memory_node != STARPU_MAIN_RAM)
+				if (starpu_node_get_kind(memory_node) != STARPU_CPU_RAM)
 					starpu_pthread_queue_register(&workerarg->wait, &_starpu_simgrid_transfer_queue[STARPU_MAIN_RAM]);
-#endif /* STARPU_USE_NUMA */
 #endif
 				break;
 			}
@@ -2023,8 +2008,7 @@ starpu_topology_print (FILE *output)
 	}
 }
 
-#ifdef STARPU_USE_NUMA
-int _starpu_get_nb_numa_nodes()
+int _starpu_get_nb_numa_nodes(void)
 {
 	return nb_numa_nodes;
 }
@@ -2038,16 +2022,11 @@ int _starpu_numaid_to_memnode(unsigned numaid)
 
 int _starpu_memnode_to_numaid(unsigned memnode)
 {
-	int numaid;
-
-	for (numaid=0; numaid<nb_numa_nodes; numaid++)
-		if (numa_memory_nodes[numaid] == memnode)
-			return numaid;
-
-	return 0;
+	return numa_numaid[memnode];
 }
 
-int _starpu_worker_numa_node(unsigned workerid)
+#ifdef STARPU_USE_NUMA
+static int _starpu_worker_numa_node(unsigned workerid)
 {
 	struct _starpu_worker *worker = _starpu_get_worker_struct(workerid);
 	#ifdef STARPU_HAVE_HWLOC
@@ -2067,7 +2046,7 @@ int _starpu_worker_numa_node(unsigned workerid)
 	STARPU_ASSERT(obj->depth == HWLOC_OBJ_NODE);
 	return obj->logical_index;
 	#else /* STARPU_HAVE_HWLOC */
-	return 0 ;
+	return STARPU_MAIN_RAM;
 	#endif /* STARPU_HAVE_HWLOC */
 }
 #endif /* STARPU_USE_NUMA */

+ 2 - 5
src/core/topology.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2010, 2012, 2014-2016  Université de Bordeaux
+ * Copyright (C) 2009-2010, 2012, 2014-2017  Université de Bordeaux
  * Copyright (C) 2010, 2015  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -66,11 +66,8 @@ void _starpu_bind_thread_on_cpus(struct _starpu_machine_config *config STARPU_AT
 
 void *_starpu_get_worker_from_driver(struct starpu_driver *d);
 
-#ifdef STARPU_USE_NUMA
 int _starpu_numaid_to_memnode(unsigned numaid);
 int _starpu_memnode_to_numaid(unsigned memnode);
-int _starpu_get_nb_numa_nodes();
-int _starpu_worker_numa_node(unsigned workerid);
-#endif /* STARPU_USE_NUMA */
+int _starpu_get_nb_numa_nodes(void);
 	
 #endif // __TOPOLOGY_H__

+ 5 - 11
src/core/workers.c

@@ -1516,19 +1516,13 @@ void starpu_shutdown(void)
 	/* tell all workers to shutdown */
 	_starpu_kill_all_workers(&_starpu_config);
 	
-#ifdef STARPU_USE_NUMA
+	int i;
+	unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
+	for (i=0; i<nb_numa_nodes; i++)
 	{
-		int i;
-		unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
-		for (i=0; i<nb_numa_nodes; i++)
-		{
-			unsigned id = _starpu_numaid_to_memnode(i);
-			_starpu_free_all_automatically_allocated_buffers(id);
-		}
+		unsigned id = _starpu_numaid_to_memnode(i);
+		_starpu_free_all_automatically_allocated_buffers(id);
 	}
-#else /* STARPU_USE_NUMA */
-	_starpu_free_all_automatically_allocated_buffers(STARPU_MAIN_RAM);
-#endif /* STARPU_USE_NUMA */
 
 	{
 	     int stats = starpu_get_env_number("STARPU_STATS");

+ 0 - 2
src/core/workers.h

@@ -76,9 +76,7 @@ LIST_TYPE(_starpu_worker,
 	starpu_pthread_cond_t started_cond; /* indicate when the worker is ready */
 	starpu_pthread_cond_t ready_cond; /* indicate when the worker is ready */
 	unsigned memory_node; /* which memory node is the worker associated with ? */
-#ifdef STARPU_USE_NUMA
 	unsigned numa_memory_node; /* which numa memory node is the worker associated with ? */
-#endif /* STARPU_USE_NUMA */
 	starpu_pthread_cond_t sched_cond; /* condition variable used when the worker waits for tasks. */
         starpu_pthread_mutex_t sched_mutex; /* mutex protecting sched_cond */
 	struct starpu_task_list local_tasks; /* this queue contains tasks that have been explicitely submitted to that queue */

+ 2 - 6
src/datawizard/coherency.c

@@ -1,5 +1,5 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures. *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  * Copyright (C) 2014  INRIA
  *
@@ -562,11 +562,7 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 		/* if the data is in write only mode (and not SCRATCH or REDUX), there is no need for a source, data will be initialized by the task itself */
 		if (mode & STARPU_W)
 			dst_replicate->initialized = 1;
-#ifdef STARPU_USE_NUMA
-		if (starpu_node_get_kind(requesting_node) == STARPU_CPU_RAM && !nwait)		
-#else /* STARPU_USE_NUMA */
-		if (requesting_node == STARPU_MAIN_RAM && !nwait)
-#endif /* STARPU_USE_NUMA */
+		if (starpu_node_get_kind(requesting_node) == STARPU_CPU_RAM && !nwait)
 		{
 			/* And this is the main RAM, really no need for a
 			 * request, just allocate */

+ 1 - 7
src/datawizard/copy_driver.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2016  Université de Bordeaux
+ * Copyright (C) 2010-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2013, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -736,15 +736,9 @@ void _starpu_driver_wait_request_completion(struct _starpu_async_channel *async_
 		_starpu_mic_wait_request_completion(&(async_channel->event.mic_event));
 		break;
 #endif
-	case STARPU_MAIN_RAM:
-#ifdef STARPU_USE_NUMA
 	case STARPU_CPU_RAM:
-#endif /* STARPU_USE_NUMA */
 		starpu_disk_wait_request(async_channel);
 		break;
-#ifndef STARPU_USE_NUMA
-	case STARPU_CPU_RAM:
-#endif /* !STARPU_USE_NUMA */
 	default:
 		STARPU_ABORT();
 	}

+ 1 - 9
src/datawizard/data_request.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -155,11 +155,7 @@ struct _starpu_data_request *_starpu_create_data_request(starpu_data_handle_t ha
 	if (handling_node == -1)
 		handling_node = STARPU_MAIN_RAM;
 	r->handling_node = handling_node;
-#ifdef STARPU_USE_NUMA
 	STARPU_ASSERT(starpu_node_get_kind(handling_node) == STARPU_CPU_RAM || _starpu_memory_node_get_nworkers(handling_node));
-#else /* STARPU_USE_NUMA */
-	STARPU_ASSERT(handling_node == STARPU_MAIN_RAM || _starpu_memory_node_get_nworkers(handling_node));
-#endif /* STARPU_USE_NUMA */
 	r->completed = 0;
 	r->prefetch = is_prefetch;
 	r->prio = prio;
@@ -287,11 +283,7 @@ void _starpu_post_data_request(struct _starpu_data_request *r, unsigned handling
 {
 	/* We don't have a worker for disk nodes, these should have been posted to a main RAM node */
 	STARPU_ASSERT(starpu_node_get_kind(handling_node) != STARPU_DISK_RAM);
-#ifdef STARPU_USE_NUMA
 	STARPU_ASSERT(starpu_node_get_kind(handling_node) == STARPU_CPU_RAM || _starpu_memory_node_get_nworkers(handling_node));
-#else /* STARPU_USE_NUMA */
-	STARPU_ASSERT(handling_node == STARPU_MAIN_RAM || _starpu_memory_node_get_nworkers(handling_node));
-#endif /* STARPU_USE_NUMA */
 
 //	_STARPU_DEBUG("POST REQUEST\n");
 

+ 10 - 52
src/datawizard/interfaces/bcsr_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -114,7 +114,7 @@ void starpu_bcsr_data_register(starpu_data_handle_t *handleptr, int home_node,
 		.elemsize = elemsize
 	};
 #ifndef STARPU_SIMGRID
-	if (home_node == STARPU_MAIN_RAM)
+	if (starpu_node_get_kind(home_node) == STARPU_CPU_RAM)
 	{
 		STARPU_ASSERT_ACCESSIBLE(nzval);
 		STARPU_ASSERT_ACCESSIBLE(nzval + nnz*elemsize*r*c - 1);
@@ -155,90 +155,48 @@ static int bcsr_compare(void *data_interface_a, void *data_interface_b)
 /* offer an access to the data parameters */
 uint32_t starpu_bcsr_get_nnz(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-	
 	struct starpu_bcsr_interface *data_interface = (struct starpu_bcsr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return data_interface->nnz;
 }
 
 uint32_t starpu_bcsr_get_nrow(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_bcsr_interface *data_interface = (struct starpu_bcsr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return data_interface->nrow;
 }
 
 uint32_t starpu_bcsr_get_firstentry(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_bcsr_interface *data_interface = (struct starpu_bcsr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return data_interface->firstentry;
 }
 
 uint32_t starpu_bcsr_get_r(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_bcsr_interface *data_interface = (struct starpu_bcsr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return data_interface->r;
 }
 
 uint32_t starpu_bcsr_get_c(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_bcsr_interface *data_interface = (struct starpu_bcsr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return data_interface->c;
 }
 
 size_t starpu_bcsr_get_elemsize(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_bcsr_interface *data_interface = (struct starpu_bcsr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return data_interface->elemsize;
 }
@@ -261,7 +219,7 @@ uint32_t *starpu_bcsr_get_local_colind(starpu_data_handle_t handle)
 	int node = STARPU_MAIN_RAM;
 #ifdef STARPU_USE_NUMA
 	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
+	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
 		node = STARPU_MAIN_RAM;
 #endif /* STARPU_USE_NUMA */
 
@@ -277,7 +235,7 @@ uint32_t *starpu_bcsr_get_local_rowptr(starpu_data_handle_t handle)
 	int node = STARPU_MAIN_RAM;
 #ifdef STARPU_USE_NUMA
 	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
+	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
 		node = STARPU_MAIN_RAM;
 #endif /* STARPU_USE_NUMA */
 

+ 8 - 48
src/datawizard/interfaces/block_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -162,7 +162,7 @@ void starpu_block_data_register(starpu_data_handle_t *handleptr, int home_node,
 		.elemsize = elemsize
 	};
 #ifndef STARPU_SIMGRID
-	if (home_node == STARPU_MAIN_RAM)
+	if (starpu_node_get_kind(home_node) == STARPU_CPU_RAM)
 	{
 		STARPU_ASSERT_ACCESSIBLE(ptr);
 		STARPU_ASSERT_ACCESSIBLE(ptr + (nz-1)*ldz*elemsize + (ny-1)*ldy*elemsize + nx*elemsize - 1);
@@ -216,13 +216,7 @@ static void display_block_interface(starpu_data_handle_t handle, FILE *f)
 {
 	struct starpu_block_interface *block_interface;
 
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-	block_interface = (struct starpu_block_interface *) starpu_data_get_interface_on_node(handle, node);
+	block_interface = (struct starpu_block_interface *) starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	fprintf(f, "%u\t%u\t%u\t", block_interface->nx, block_interface->ny, block_interface->nz);
 }
@@ -293,13 +287,7 @@ static size_t block_interface_get_size(starpu_data_handle_t handle)
 	size_t size;
 	struct starpu_block_interface *block_interface;
 
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-	block_interface = (struct starpu_block_interface *) starpu_data_get_interface_on_node(handle, node);
+	block_interface = (struct starpu_block_interface *) starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	size = block_interface->nx*block_interface->ny*block_interface->nz*block_interface->elemsize;
 
@@ -309,45 +297,24 @@ static size_t block_interface_get_size(starpu_data_handle_t handle)
 /* offer an access to the data parameters */
 uint32_t starpu_block_get_nx(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_block_interface *block_interface = (struct starpu_block_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return block_interface->nx;
 }
 
 uint32_t starpu_block_get_ny(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_block_interface *block_interface = (struct starpu_block_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return block_interface->ny;
 }
 
 uint32_t starpu_block_get_nz(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_block_interface *block_interface = (struct starpu_block_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return block_interface->nz;
 }
@@ -393,15 +360,8 @@ uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle)
 
 size_t starpu_block_get_elemsize(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_block_interface *block_interface = (struct starpu_block_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return block_interface->elemsize;
 }

+ 6 - 26
src/datawizard/interfaces/coo_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013-2016  Université Bordeaux
+ * Copyright (C) 2013-2017  Université Bordeaux
  * Copyright (C) 2012 INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -18,6 +18,7 @@
 #include <starpu.h>
 #include <common/fxt.h>
 #include <datawizard/memalloc.h>
+#include <datawizard/memory_nodes.h>
 
 static int
 copy_any_to_any(void *src_interface, unsigned src_node,
@@ -150,16 +151,9 @@ free_coo_buffer_on_node(void *data_interface, unsigned node)
 static size_t
 coo_interface_get_size(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_coo_interface *coo_interface;
 	coo_interface = (struct starpu_coo_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return coo_interface->nx * coo_interface->ny * coo_interface->elemsize;
 }
@@ -167,16 +161,9 @@ coo_interface_get_size(starpu_data_handle_t handle)
 static uint32_t
 coo_interface_footprint(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_coo_interface *coo_interface;
 	coo_interface = (struct starpu_coo_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return starpu_hash_crc32c_be(coo_interface->nx * coo_interface->ny, 0);
 }
@@ -198,16 +185,9 @@ coo_compare(void *a, void *b)
 static void
 display_coo_interface(starpu_data_handle_t handle, FILE *f)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_coo_interface *coo_interface;
 	coo_interface = (struct starpu_coo_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	fprintf(f, "%u\t%u", coo_interface->nx, coo_interface->ny);
 }
@@ -256,7 +236,7 @@ starpu_coo_data_register(starpu_data_handle_t *handleptr, int home_node,
 		.elemsize = elemsize,
 	};
 #ifndef STARPU_SIMGRID
-	if (home_node == STARPU_MAIN_RAM)
+	if (starpu_node_get_kind(home_node) == STARPU_CPU_RAM)
 	{
 		STARPU_ASSERT_ACCESSIBLE(columns);
 		STARPU_ASSERT_ACCESSIBLE((uintptr_t) columns + n_values*sizeof(uint32_t) - 1);

+ 6 - 34
src/datawizard/interfaces/csr_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013, 2014  CNRS
  *
@@ -107,7 +107,7 @@ void starpu_csr_data_register(starpu_data_handle_t *handleptr, int home_node,
 		.elemsize = elemsize
 	};
 #ifndef STARPU_SIMGRID
-	if (home_node == STARPU_MAIN_RAM)
+	if (starpu_node_get_kind(home_node) == STARPU_CPU_RAM)
 	{
 		STARPU_ASSERT_ACCESSIBLE(nzval);
 		STARPU_ASSERT_ACCESSIBLE(nzval + nnz*elemsize - 1);
@@ -140,60 +140,32 @@ static int csr_compare(void *data_interface_a, void *data_interface_b)
 /* offer an access to the data parameters */
 uint32_t starpu_csr_get_nnz(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_csr_interface *csr_interface = (struct starpu_csr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return csr_interface->nnz;
 }
 
 uint32_t starpu_csr_get_nrow(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_csr_interface *csr_interface = (struct starpu_csr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return csr_interface->nrow;
 }
 
 uint32_t starpu_csr_get_firstentry(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-	
 	struct starpu_csr_interface *csr_interface = (struct starpu_csr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return csr_interface->firstentry;
 }
 
 size_t starpu_csr_get_elemsize(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_csr_interface *csr_interface = (struct starpu_csr_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return csr_interface->elemsize;
 }

+ 7 - 14
src/datawizard/interfaces/data_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  * Copyright (C) 2014, 2016  Inria
  *
@@ -415,10 +415,10 @@ _starpu_data_initialize_per_worker(starpu_data_handle_t handle)
 	int handle_node = STARPU_MAIN_RAM;
 #ifdef STARPU_USE_NUMA
 	handle_node = handle->home_node;
-	if (handle_node < 0 || (_starpu_node_get_kind(handle_node) != STARPU_CPU_RAM))
+	if (handle_node < 0 || (starpu_node_get_kind(handle_node) != STARPU_CPU_RAM))
 		handle_node = STARPU_MAIN_RAM;
 #endif /* STARPU_USE_NUMA */
-	ptr = starpu_data_handle_to_pointer(handle, handle_node);
+	void * ptr = starpu_data_handle_to_pointer(handle, handle_node);
 	if (ptr != NULL)
 	{
 		_starpu_data_register_ram_pointer(handle, ptr);
@@ -496,14 +496,7 @@ void starpu_data_register(starpu_data_handle_t *handleptr, int home_node,
 
 void starpu_data_register_same(starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handlesrc->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
-	void *local_interface = starpu_data_get_interface_on_node(handlesrc, node);
+	void *local_interface = starpu_data_get_interface_on_node(handlesrc, STARPU_MAIN_RAM);
 	starpu_data_register(handledst, -1, local_interface, handlesrc->ops);
 }
 
@@ -540,7 +533,7 @@ void _starpu_data_unregister_ram_pointer(starpu_data_handle_t handle)
 	int node = STARPU_MAIN_RAM;
 #ifdef STARPU_USE_NUMA
 	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
+	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
 		node = STARPU_MAIN_RAM;
 #endif /* STARPU_USE_NUMA */
 
@@ -783,7 +776,7 @@ static void _starpu_data_unregister(starpu_data_handle_t handle, unsigned cohere
 			home_node = STARPU_MAIN_RAM;
 #ifdef STARPU_USE_NUMA
 			home_node = handle->home_node;
-			if (home_node < 0 || (_starpu_node_get_kind(home_node) != STARPU_CPU_RAM))
+			if (home_node < 0 || (starpu_node_get_kind(home_node) != STARPU_CPU_RAM))
 				home_node = STARPU_MAIN_RAM;
 #endif /* STARPU_USE_NUMA */
 			format_interface = (struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, home_node);
@@ -1002,7 +995,7 @@ static void _starpu_data_invalidate(void *data)
 		if (local->mc && local->allocated && local->automatically_allocated)
 		{
 #ifdef STARPU_USE_NUMA
-			if (_starpu_node_get_kind(node) == STARPU_CPU_RAM)
+			if (starpu_node_get_kind(node) == STARPU_CPU_RAM)
 #else /* STARPU_USE_NUMA */		
 			if (node == STARPU_MAIN_RAM)
 #endif /* STARPU_USE_NUMA */		

+ 7 - 42
src/datawizard/interfaces/matrix_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2016  Université de Bordeaux
+ * Copyright (C) 2010-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -173,7 +173,7 @@ void starpu_matrix_data_register(starpu_data_handle_t *handleptr, int home_node,
                 .offset = 0
 	};
 #ifndef STARPU_SIMGRID
-	if (home_node == STARPU_MAIN_RAM)
+	if (starpu_node_get_kind(home_node) == STARPU_CPU_RAM)
 	{
 		STARPU_ASSERT_ACCESSIBLE(ptr);
 		STARPU_ASSERT_ACCESSIBLE(ptr + (ny-1)*ld*elemsize + nx*elemsize - 1);
@@ -217,15 +217,8 @@ static int matrix_compare(void *data_interface_a, void *data_interface_b)
 
 static void display_matrix_interface(starpu_data_handle_t handle, FILE *f)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_matrix_interface *matrix_interface = (struct starpu_matrix_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	fprintf(f, "%u\t%u\t", matrix_interface->nx, matrix_interface->ny);
 }
@@ -282,15 +275,8 @@ static int unpack_matrix_handle(starpu_data_handle_t handle, unsigned node, void
 
 static size_t matrix_interface_get_size(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_matrix_interface *matrix_interface = (struct starpu_matrix_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	size_t size;
 	size = (size_t)matrix_interface->nx*matrix_interface->ny*matrix_interface->elemsize;
@@ -301,30 +287,16 @@ static size_t matrix_interface_get_size(starpu_data_handle_t handle)
 /* offer an access to the data parameters */
 uint32_t starpu_matrix_get_nx(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_matrix_interface *matrix_interface = (struct starpu_matrix_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return matrix_interface->nx;
 }
 
 uint32_t starpu_matrix_get_ny(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_matrix_interface *matrix_interface = (struct starpu_matrix_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return matrix_interface->ny;
 }
@@ -357,15 +329,8 @@ uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle)
 
 size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_matrix_interface *matrix_interface = (struct starpu_matrix_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return matrix_interface->elemsize;
 }

+ 3 - 22
src/datawizard/interfaces/multiformat_interface.c

@@ -242,15 +242,8 @@ static int multiformat_compare(void *data_interface_a, void *data_interface_b)
 static void display_multiformat_interface(starpu_data_handle_t handle, FILE *f)
 {
 	struct starpu_multiformat_interface *multiformat_interface;
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	multiformat_interface = (struct starpu_multiformat_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	fprintf(f, "%u\t", multiformat_interface->nx);
 }
@@ -260,13 +253,7 @@ static size_t multiformat_interface_get_size(starpu_data_handle_t handle)
 {
 	size_t size;
 	struct starpu_multiformat_interface *multiformat_interface;
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-	multiformat_interface = (struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, node);
+	multiformat_interface = (struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 	size = multiformat_interface->nx * multiformat_interface->ops->cpu_elemsize;
 	return size;
 }
@@ -274,13 +261,7 @@ static size_t multiformat_interface_get_size(starpu_data_handle_t handle)
 uint32_t starpu_multiformat_get_nx(starpu_data_handle_t handle)
 {
 	struct starpu_multiformat_interface *multiformat_interface;
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-	multiformat_interface = (struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, node);
+	multiformat_interface = (struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 	return multiformat_interface->nx;
 }
 

+ 5 - 26
src/datawizard/interfaces/variable_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2016  Université de Bordeaux
+ * Copyright (C) 2010-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -112,7 +112,7 @@ void starpu_variable_data_register(starpu_data_handle_t *handleptr, int home_nod
 		.elemsize = elemsize
 	};
 #ifndef STARPU_SIMGRID
-	if (home_node == STARPU_MAIN_RAM)
+	if (starpu_node_get_kind(home_node) == STARPU_CPU_RAM)
 	{
 		STARPU_ASSERT_ACCESSIBLE(ptr);
 		STARPU_ASSERT_ACCESSIBLE(ptr + elemsize - 1);
@@ -154,15 +154,8 @@ static int variable_compare(void *data_interface_a, void *data_interface_b)
 
 static void display_variable_interface(starpu_data_handle_t handle, FILE *f)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_variable_interface *variable_interface = (struct starpu_variable_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	fprintf(f, "%ld\t", (long)variable_interface->elemsize);
 }
@@ -200,15 +193,8 @@ static int unpack_variable_handle(starpu_data_handle_t handle, unsigned node, vo
 
 static size_t variable_interface_get_size(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_variable_interface *variable_interface = (struct starpu_variable_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return variable_interface->elemsize;
 }
@@ -225,14 +211,7 @@ uintptr_t starpu_variable_get_local_ptr(starpu_data_handle_t handle)
 
 size_t starpu_variable_get_elemsize(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
-	return STARPU_VARIABLE_GET_ELEMSIZE(starpu_data_get_interface_on_node(handle, node));
+	return STARPU_VARIABLE_GET_ELEMSIZE(starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM));
 }
 
 /* memory allocation/deallocation primitives for the variable interface */

+ 6 - 34
src/datawizard/interfaces/vector_interface.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -120,7 +120,7 @@ void starpu_vector_data_register(starpu_data_handle_t *handleptr, int home_node,
                 .offset = 0
 	};
 #ifndef STARPU_SIMGRID
-	if (home_node == STARPU_MAIN_RAM)
+	if (starpu_node_get_kind(home_node) == STARPU_CPU_RAM)
 	{
 		STARPU_ASSERT_ACCESSIBLE(ptr);
 		STARPU_ASSERT_ACCESSIBLE(ptr + nx*elemsize - 1);
@@ -162,15 +162,8 @@ static int vector_compare(void *data_interface_a, void *data_interface_b)
 
 static void display_vector_interface(starpu_data_handle_t handle, FILE *f)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	fprintf(f, "%u\t", vector_interface->nx);
 }
@@ -208,16 +201,9 @@ static int unpack_vector_handle(starpu_data_handle_t handle, unsigned node, void
 
 static size_t vector_interface_get_size(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	size_t size;
 	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	size = vector_interface->nx*vector_interface->elemsize;
 
@@ -227,15 +213,8 @@ static size_t vector_interface_get_size(starpu_data_handle_t handle)
 /* offer an access to the data parameters */
 uint32_t starpu_vector_get_nx(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return vector_interface->nx;
 }
@@ -255,15 +234,8 @@ uintptr_t starpu_vector_get_local_ptr(starpu_data_handle_t handle)
 
 size_t starpu_vector_get_elemsize(starpu_data_handle_t handle)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
 	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+		starpu_data_get_interface_on_node(handle, STARPU_MAIN_RAM);
 
 	return vector_interface->elemsize;
 }

+ 1 - 8
src/datawizard/interfaces/void_interface.c

@@ -70,14 +70,7 @@ static void register_void_handle(starpu_data_handle_t handle STARPU_ATTRIBUTE_UN
 /* declare a new data with the void interface */
 void starpu_void_data_register(starpu_data_handle_t *handleptr)
 {
-	int node = STARPU_MAIN_RAM;
-#ifdef STARPU_USE_NUMA
-	node = (*handleptr)->home_node;
-	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
-		node = STARPU_MAIN_RAM;
-#endif /* STARPU_USE_NUMA */
-
-	starpu_data_register(handleptr, node, NULL, &starpu_interface_void_ops);
+	starpu_data_register(handleptr, STARPU_MAIN_RAM, NULL, &starpu_interface_void_ops);
 }
 
 

+ 3 - 42
src/datawizard/memalloc.c

@@ -21,6 +21,7 @@
 #include <datawizard/memalloc.h>
 #include <datawizard/footprint.h>
 #include <core/disk.h>
+#include <core/topology.h>
 #include <starpu.h>
 #include <common/uthash.h>
 
@@ -381,11 +382,7 @@ static size_t free_memory_on_node(struct _starpu_mem_chunk *mc, unsigned node)
 			data_interface = mc->chunk_interface;
 		STARPU_ASSERT(data_interface);
 
-#ifdef STARPU_USE_NUMA
 		if (handle && (starpu_node_get_kind(node) == STARPU_CPU_RAM))
-#else /* STARPU_USE_NUMA */
-		if (handle && node == STARPU_MAIN_RAM)
-#endif /* STARPU_USE_NUMA */
 			_starpu_data_unregister_ram_pointer(handle);
 
 		_STARPU_TRACE_START_FREE(node, mc->size);
@@ -633,14 +630,10 @@ static unsigned try_to_reuse_mem_chunk(struct _starpu_mem_chunk *mc, unsigned no
 			 * away after writing it back to main memory */
 			_starpu_spin_unlock(&mc_lock[node]);
 			_STARPU_TRACE_START_WRITEBACK(node);
-#ifdef STARPU_USE_NUMA
 			int home_node = old_data->home_node;
-			if (home_node < 0 || (_starpu_node_get_kind(home_node) != STARPU_CPU_RAM))
+			if (home_node < 0 || (starpu_node_get_kind(home_node) != STARPU_CPU_RAM))
 				home_node = STARPU_MAIN_RAM;
 			res = transfer_subtree_to_node(old_data, node, home_node);
-#else /* STARPU_USE_NUMA */
-			res = transfer_subtree_to_node(old_data, node, STARPU_MAIN_RAM);
-#endif /* STARPU_USE_NUMA */
 			_STARPU_TRACE_END_WRITEBACK(node);
 			_starpu_spin_lock(&mc_lock[node]);
 
@@ -1447,11 +1440,7 @@ int _starpu_allocate_memory_on_node(starpu_data_handle_t handle, struct _starpu_
 	replicate->allocated = 1;
 	replicate->automatically_allocated = 1;
 
-#ifdef STARPU_USE_NUMA
 	if (replicate->relaxed_coherency == 0 && (starpu_node_get_kind(dst_node) == STARPU_CPU_RAM))
-#else /* STARPU_USE_NUMA */
-	if (replicate->relaxed_coherency == 0 && dst_node == STARPU_MAIN_RAM)
-#endif /* STARPU_USE_NUMA */
 	{
 		/* We are allocating the buffer in main memory, also register it
 		 * for the gcc plugin.  */
@@ -1616,13 +1605,8 @@ choose_target(starpu_data_handle_t handle, unsigned node)
 	size_t size_handle = _starpu_data_get_size(handle);
 	if (handle->home_node != -1)
 		/* try to push on RAM if we can before to push on disk */
-#ifdef STARPU_USE_NUMA
 		if(starpu_node_get_kind(handle->home_node) == STARPU_DISK_RAM && (starpu_node_get_kind(node) != STARPU_CPU_RAM))
-#else /* STARPU_USE_NUMA */
-		if(starpu_node_get_kind(handle->home_node) == STARPU_DISK_RAM && node != STARPU_MAIN_RAM)
-#endif /* STARPU_USE_NUMA */
 		{
-#ifdef STARPU_USE_NUMA
  	                int i;
 			unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
 			for (i=0; i<nb_numa_nodes; i++)
@@ -1636,14 +1620,6 @@ choose_target(starpu_data_handle_t handle, unsigned node)
 				}
 			}
 			if (target == -1)
-#else /* STARPU_USE_NUMA */
-			if (handle->per_node[STARPU_MAIN_RAM].allocated ||
-			    _starpu_memory_manager_test_allocate_size(STARPU_MAIN_RAM, size_handle) == 1)
-			{
-				target = STARPU_MAIN_RAM;
-			}
-			else
-#endif /* STARPU_USE_NUMA */
 			{
 				target = get_better_disk_can_accept_size(handle, node);
 			}
@@ -1658,18 +1634,12 @@ choose_target(starpu_data_handle_t handle, unsigned node)
 	{
 		/* handle->home_node == -1 */
 		/* no place for datas in RAM, we push on disk */
-#ifdef STARPU_USE_NUMA
 		if (starpu_node_get_kind(node) == STARPU_CPU_RAM)
-#else /* STARPU_USE_NUMA */
-		if (node == STARPU_MAIN_RAM)
-#endif /* STARPU_USE_NUMA */
 		{
 			target = get_better_disk_can_accept_size(handle, node);
-		}
+		} else {
 		/* node != 0 */
 		/* try to push data to RAM if we can before to push on disk*/
-#ifdef STARPU_USE_NUMA
-		else {
 			int i;
 			unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
 			for (i=0; i<nb_numa_nodes; i++)
@@ -1685,15 +1655,6 @@ choose_target(starpu_data_handle_t handle, unsigned node)
 		}
 		/* no place in RAM */
 		if (target == -1)
-#else /* STARPU_USE_NUMA */
-		else if (handle->per_node[STARPU_MAIN_RAM].allocated ||
-			 _starpu_memory_manager_test_allocate_size(STARPU_MAIN_RAM, size_handle) == 1)
-		{
-			target = STARPU_MAIN_RAM;
-		}
-		/* no place in RAM */
-		else
-#endif /* STARPU_USE_NUMA */
 		{
 			target = get_better_disk_can_accept_size(handle, node);
 		}

+ 1 - 0
src/datawizard/memory_nodes.c

@@ -112,6 +112,7 @@ unsigned _starpu_memory_node_register(enum starpu_node_kind kind, int devid)
 	/* ATOMIC_ADD returns the new value ... */
 	node = STARPU_ATOMIC_ADD(&_starpu_descr.nnodes, 1) - 1;
 	STARPU_ASSERT_MSG(node < STARPU_MAXNODES,"Too many nodes (%u) for maximum %u. Use configure option --enable-maxnodes=xxx to update the maximum number of nodes.", node, STARPU_MAXNODES);
+
 	_starpu_descr.nodes[node] = kind;
 	_STARPU_TRACE_NEW_MEM_NODE(node);
 

+ 5 - 13
src/datawizard/user_interactions.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -189,25 +189,21 @@ int starpu_data_acquire_on_node_cb(starpu_data_handle_t handle, int node,
 int starpu_data_acquire_cb(starpu_data_handle_t handle,
 			   enum starpu_data_access_mode mode, void (*callback)(void *), void *arg)
 {
-#ifdef STARPU_USE_NUMA
 	int home_node = handle->home_node;
 	if (home_node >= 0 && (starpu_node_get_kind(home_node) == STARPU_CPU_RAM))
 		return starpu_data_acquire_on_node_cb(handle, home_node, mode, callback, arg);
 	else
-#endif /* STARPU_USE_NUMA */
-	return starpu_data_acquire_on_node_cb(handle, STARPU_MAIN_RAM, mode, callback, arg);
+		return starpu_data_acquire_on_node_cb(handle, STARPU_MAIN_RAM, mode, callback, arg);
 }
 
 int starpu_data_acquire_cb_sequential_consistency(starpu_data_handle_t handle,
 						  enum starpu_data_access_mode mode, void (*callback)(void *), void *arg, int sequential_consistency)
 {
-#ifdef STARPU_USE_NUMA
 	int home_node = handle->home_node;
 	if (home_node >= 0 && (starpu_node_get_kind(home_node) == STARPU_CPU_RAM))
 	 	return starpu_data_acquire_on_node_cb_sequential_consistency(handle, home_node, mode, callback, arg, sequential_consistency);
 	else
-#endif /* STARPU_USE_NUMA */
-	return starpu_data_acquire_on_node_cb_sequential_consistency(handle, STARPU_MAIN_RAM, mode, callback, arg, sequential_consistency);
+		return starpu_data_acquire_on_node_cb_sequential_consistency(handle, STARPU_MAIN_RAM, mode, callback, arg, sequential_consistency);
 }
 
 /*
@@ -338,13 +334,11 @@ int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum star
 
 int starpu_data_acquire(starpu_data_handle_t handle, enum starpu_data_access_mode mode)
 {
-#ifdef STARPU_USE_NUMA
 	int home_node = handle->home_node;
 	if (home_node >= 0 && (starpu_node_get_kind(home_node) == STARPU_CPU_RAM))
 	 	return starpu_data_acquire_on_node(handle, home_node, mode);
 	else
-#endif /* STARPU_USE_NUMA */
-	return starpu_data_acquire_on_node(handle, STARPU_MAIN_RAM, mode);
+		return starpu_data_acquire_on_node(handle, STARPU_MAIN_RAM, mode);
 }
 
 /* This function must be called after starpu_data_acquire so that the
@@ -376,13 +370,11 @@ void starpu_data_release_on_node(starpu_data_handle_t handle, int node)
 
 void starpu_data_release(starpu_data_handle_t handle)
 {
-#ifdef STARPU_USE_NUMA
 	int home_node = handle->home_node;
 	if (home_node >= 0 && (starpu_node_get_kind(home_node) == STARPU_CPU_RAM))
 	 	return starpu_data_release_on_node(handle, home_node);
 	else
-#endif /* STARPU_USE_NUMA */	
-	starpu_data_release_on_node(handle, STARPU_MAIN_RAM);
+		starpu_data_release_on_node(handle, STARPU_MAIN_RAM);
 }
 
 static void _prefetch_data_on_node(void *arg)

+ 7 - 21
src/drivers/cpu/driver_cpu.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2016  Université de Bordeaux
+ * Copyright (C) 2010-2017  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010-2016  CNRS
  * Copyright (C) 2011  Télécom-SudParis
@@ -222,12 +222,7 @@ int _starpu_cpu_driver_init(struct _starpu_worker *cpu_worker)
 	int devid = cpu_worker->devid;
 
 	_starpu_driver_start(cpu_worker, _STARPU_FUT_CPU_KEY, 1);
-	/* FIXME: when we have NUMA support, properly turn node number into NUMA node number */
-#ifdef STARPU_USE_NUMA
 	_starpu_memory_manager_set_global_memory_size(cpu_worker->memory_node, _starpu_cpu_get_global_mem_size(cpu_worker->numa_memory_node, cpu_worker->config));
-#else /* STARPU_USE_NUMA */
-	_starpu_memory_manager_set_global_memory_size(cpu_worker->memory_node, _starpu_cpu_get_global_mem_size(cpu_worker->memory_node, cpu_worker->config));
-#endif /* STARPU_USE_NUMA */
 	snprintf(cpu_worker->name, sizeof(cpu_worker->name), "CPU %d", devid);
 	snprintf(cpu_worker->short_name, sizeof(cpu_worker->short_name), "CPU %d", devid);
 	starpu_pthread_setname(cpu_worker->short_name);
@@ -248,29 +243,20 @@ int _starpu_cpu_driver_run_once(struct _starpu_worker *cpu_worker)
 	unsigned memnode = cpu_worker->memory_node;
 	int workerid = cpu_worker->workerid;
 
-	int res;
+	int res = 0;
 
 #ifdef STARPU_SIMGRID
 	starpu_pthread_wait_reset(&cpu_worker->wait);
 #endif
 
 	_STARPU_TRACE_START_PROGRESS(memnode);
-	res = __starpu_datawizard_progress(memnode, 1, 1);
-#ifdef STARPU_USE_NUMA
-	if (starpu_node_get_kind(memnode) != STARPU_CPU_RAM)
+	unsigned i;
+	unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
+	for (i=0; i<nb_numa_nodes; i++)
 	{
-		int i;
-		unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
-		for (i=0; i<nb_numa_nodes; i++)
-		{
-			unsigned id = _starpu_numaid_to_memnode(i);			
-			res |= __starpu_datawizard_progress(id, 1, 1);
-		}
+		unsigned id = _starpu_numaid_to_memnode(i);			
+		res |= __starpu_datawizard_progress(id, 1, 1);
 	}
-#else /* STARPU_USE_NUMA */
-	if (memnode != STARPU_MAIN_RAM)
-		res |= __starpu_datawizard_progress(STARPU_MAIN_RAM, 1, 1);
-#endif /* STARPU_USE_NUMA */
 	_STARPU_TRACE_END_PROGRESS(memnode);
 
 	struct _starpu_job *j;

+ 3 - 11
src/drivers/cuda/driver_cuda.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016, 2017  CNRS
  * Copyright (C) 2011  Télécom-SudParis
@@ -811,16 +811,12 @@ int _starpu_cuda_driver_run_once(struct _starpu_worker_set *worker_set)
 	{
 		/* Nothing ready yet, no better thing to do than waiting */
 		__starpu_datawizard_progress(memnode, 1, 0);
-#ifdef STARPU_USE_NUMA
-		unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
+		int nb_numa_nodes = _starpu_get_nb_numa_nodes();
 		for (i=0; i<nb_numa_nodes; i++)
 		{
 			unsigned id = _starpu_numaid_to_memnode(i);
 			__starpu_datawizard_progress(id, 1, 0);
 		}
-#else /* STARPU_USE_NUMA */
-		__starpu_datawizard_progress(STARPU_MAIN_RAM, 1, 0);
-#endif /* STARPU_USE_NUMA */
 		return 0;
 	}
 #endif
@@ -828,16 +824,12 @@ int _starpu_cuda_driver_run_once(struct _starpu_worker_set *worker_set)
 	/* Something done, make some progress */
 	res = !idle;
 	res |= __starpu_datawizard_progress(memnode, 1, 1);
-#ifdef STARPU_USE_NUMA
-	unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
+	int nb_numa_nodes = _starpu_get_nb_numa_nodes();
 	for (i=0; i<nb_numa_nodes; i++)
 	{
 		unsigned id = _starpu_numaid_to_memnode(i);
 		res |= __starpu_datawizard_progress(id, 1, 1);
 	}
-#else /* STARPU_USE_NUMA */
-	res |= __starpu_datawizard_progress(STARPU_MAIN_RAM, 1, 1);
-#endif /* STARPU_USE_NUMA */
 
 	/* And pull tasks */
 	res |= _starpu_get_multi_worker_task(worker_set->workers, tasks, worker_set->nworkers, memnode);

+ 0 - 4
src/drivers/mp_common/source_common.c

@@ -693,16 +693,12 @@ void _starpu_src_common_worker(struct _starpu_worker_set * worker_set,
 
 		_STARPU_TRACE_START_PROGRESS(memnode);
 		res |= __starpu_datawizard_progress(memnode, 1, 1);
-#ifdef STARPU_USE_NUMA
 		unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes;
 		for (i=0; i<nb_numa_nodes; i++)
 		{
 			unsigned id = _starpu_numaid_to_memnode(i);
 			res |= __starpu_datawizard_progress(id, 1, 1);
 		}
-#else /* STARPU_USE_NUMA */
-		res |= __starpu_datawizard_progress(STARPU_MAIN_RAM, 1, 1);
-#endif /* STARPU_USE_NUMA */
 		_STARPU_TRACE_END_PROGRESS(memnode);
 
 		/* Handle message which have been store */

+ 3 - 11
src/drivers/opencl/driver_opencl.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2016  Université de Bordeaux
+ * Copyright (C) 2010-2017  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  * Copyright (C) 2011  Télécom-SudParis
@@ -757,34 +757,26 @@ int _starpu_opencl_driver_run_once(struct _starpu_worker *worker)
 	{
 		/* Not ready yet, no better thing to do than waiting */
 		__starpu_datawizard_progress(memnode, 1, 0);
-#ifdef STARPU_USE_NUMA
 		unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
-		int i;
+		unsigned i;
 		for (i=0; i<nb_numa_nodes; i++)
 		{
 			unsigned id = _starpu_numaid_to_memnode(i);
 			__starpu_datawizard_progress(id, 1, 0);
 		}
-#else /* STARPU_USE_NUMA */
-		__starpu_datawizard_progress(STARPU_MAIN_RAM, 1, 0);
-#endif /* STARPU_USE_NUMA */
 		return 0;
 	}
 #endif
 
 	res = !idle;
 	res |= __starpu_datawizard_progress(memnode, 1, 1);
-#ifdef STARPU_USE_NUMA
 	unsigned nb_numa_nodes = _starpu_get_nb_numa_nodes();
-	int i;
+	unsigned i;
 	for (i=0; i<nb_numa_nodes; i++)
 	{
 		unsigned id = _starpu_numaid_to_memnode(i);
 		res |= __starpu_datawizard_progress(id, 1, 1);
 	}
-#else /* STARPU_USE_NUMA */
-	res |= __starpu_datawizard_progress(STARPU_MAIN_RAM, 1, 1);
-#endif /* STARPU_USE_NUMA */
 
 	task = _starpu_get_worker_task(worker, workerid, memnode);
 

+ 1 - 1
src/util/openmp_runtime_support.c

@@ -2421,7 +2421,7 @@ void starpu_omp_vector_annotate(starpu_data_handle_t handle, uint32_t slice_base
 	int node = STARPU_MAIN_RAM;
 #ifdef STARPU_USE_NUMA
 	node = handle->home_node;
-	if (node < 0 || (_starpu_node_get_kind(node) != STARPU_CPU_RAM))
+	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
 		node = STARPU_MAIN_RAM;
 #endif /* STARPU_USE_NUMA */
 	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *)