Bladeren bron

Fix value of ncores: 1 core is now coded 1.

Samuel Thibault 10 jaren geleden
bovenliggende
commit
72a14e28c5

+ 1 - 1
src/core/combined_workers.c

@@ -106,7 +106,7 @@ int starpu_combined_worker_assign_workerid(int nworkers, int workerid_array[])
 	combined_worker->perf_arch.ndevices = 1;
 	combined_worker->perf_arch.devices[0].type = config->workers[workerid_array[0]].perf_arch.devices[0].type;
 	combined_worker->perf_arch.devices[0].devid = config->workers[workerid_array[0]].perf_arch.devices[0].devid; 
-	combined_worker->perf_arch.devices[0].ncores = nworkers - 1;
+	combined_worker->perf_arch.devices[0].ncores = nworkers;
 	combined_worker->worker_mask = config->workers[workerid_array[0]].worker_mask;
 	
 #ifdef STARPU_USE_MP

+ 2 - 2
src/core/detect_combined_workers.c

@@ -44,7 +44,7 @@ static void find_workers(hwloc_obj_t obj, int cpu_workers[STARPU_NMAXWORKERS], u
 	for(worker = _starpu_worker_list_begin(workers); worker != _starpu_worker_list_end(workers); worker = _starpu_worker_list_next(worker))
 	{
 		/* is it a CPU worker? */
-		if (worker->perf_arch.devices[0].type == STARPU_CPU_WORKER && worker->perf_arch.devices[0].ncores == 0)
+		if (worker->perf_arch.devices[0].type == STARPU_CPU_WORKER && worker->perf_arch.devices[0].ncores == 1)
 		{
 			_STARPU_DEBUG("worker %d is part of it\n", worker->workerid);
 			/* Add it to the combined worker */
@@ -178,7 +178,7 @@ static void find_and_assign_combinations_with_hwloc(int *workerids, int nworkers
 	for (i = 0; i < nworkers; i++)
 	{
 		struct _starpu_worker *worker = _starpu_get_worker_struct(workerids[i]);
-		if (worker->perf_arch.devices[0].type == STARPU_CPU_WORKER && worker->perf_arch.devices[0].ncores == 0)
+		if (worker->perf_arch.devices[0].type == STARPU_CPU_WORKER && worker->perf_arch.devices[0].ncores == 1)
 		{
 			hwloc_obj_t obj = hwloc_get_obj_by_depth(topology->hwtopology, config->pu_depth, worker->bindid);
 			obj = obj->parent;

+ 1 - 1
src/core/perfmodel/perfmodel.c

@@ -112,7 +112,7 @@ double starpu_worker_get_relative_speedup(struct starpu_perfmodel_arch* perf_arc
 		else if (perf_arch->devices[dev].type == STARPU_MIC_WORKER)
 			coef =  _STARPU_MIC_ALPHA;
 
-		speedup += coef * (perf_arch->devices[dev].ncores + 1);
+		speedup += coef * (perf_arch->devices[dev].ncores);
 	}
 	return speedup;
 }

+ 2 - 2
src/core/perfmodel/perfmodel_print.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2013  Université de Bordeaux
+ * Copyright (C) 2011, 2013-2014  Université de Bordeaux
  * Copyright (C) 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Télécom-SudParis
  *
@@ -219,7 +219,7 @@ int starpu_perfmodel_print_all(struct starpu_perfmodel *model, char *arch, char
 			perf_arch.devices = (struct starpu_perfmodel_device*)malloc(sizeof(struct starpu_perfmodel_device));
 			perf_arch.devices[0].type = STARPU_CPU_WORKER;
 			perf_arch.devices[0].devid = 0;
-			perf_arch.devices[0].ncores = k-1;
+			perf_arch.devices[0].ncores = k;
 			int comb = starpu_perfmodel_arch_comb_get(perf_arch.ndevices, perf_arch.devices);
 			STARPU_ASSERT(comb != -1);
 			int nimpls = model->state->nimpls[comb];