Browse Source

Add starpu_nop_perf_model dumb performance model, use it to fix tests/datawizard/deps on simgrid

Samuel Thibault 7 years ago
parent
commit
eb41e2cdee

+ 3 - 0
doc/doxygen/chapters/api/performance_model.doxy

@@ -333,4 +333,7 @@ Return the estimated time to transfer a given size between two memory nodes.
 \ingroup API_Performance_Model
 Return the estimated time of a task with the given model and the given footprint.
 
+\var starpu_nop_perf_model
+Performance model which just always return 1µs.
+
 */

+ 2 - 0
include/starpu_perfmodel.h

@@ -202,6 +202,8 @@ double starpu_transfer_bandwidth(unsigned src_node, unsigned dst_node);
 double starpu_transfer_latency(unsigned src_node, unsigned dst_node);
 double starpu_transfer_predict(unsigned src_node, unsigned dst_node, size_t size);
 
+extern struct starpu_perfmodel starpu_nop_perf_model;
+
 #ifdef __cplusplus
 }
 #endif

+ 14 - 1
src/core/perfmodel/perfmodel.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  Télécom-SudParis
  * Copyright (C) 2016, 2017  Inria
@@ -556,3 +556,16 @@ void starpu_perfmodel_free_sampling_directories(void)
 	_perf_model_dir_debug = NULL;
 	directory_existence_was_tested = 0;
 }
+
+
+static double nop_cost_function(struct starpu_task *t, struct starpu_perfmodel_arch *a, unsigned i)
+{
+	return 0.000001;
+}
+
+struct starpu_perfmodel starpu_nop_perf_model =
+{
+	.type = STARPU_PER_ARCH,
+	.arch_cost_function = nop_cost_function,
+};
+

+ 3 - 0
tests/datawizard/deps.c

@@ -43,6 +43,7 @@ static struct starpu_codelet cl_null =
 {
 	.cpu_funcs = {null_cpu_func},
 	.cpu_funcs_name = {"null_cpu_func"},
+	.model = &starpu_nop_perf_model,
 	.name = "null",
 };
 
@@ -52,6 +53,8 @@ static struct starpu_codelet cl_prod =
 	.cpu_funcs_name = {"prod_cpu_func"},
 	.nbuffers = 1,
 	.modes = {STARPU_RW},
+	.flags = STARPU_CODELET_SIMGRID_EXECUTE,
+	.model = &starpu_nop_perf_model,
 	.name = "prod",
 };
 

+ 1 - 12
tests/datawizard/variable_size.c

@@ -258,17 +258,6 @@ static void init(void *descr[], void *cl_arg)
 	VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE((void*) variable_interface->ptr, variable_interface->size);
 }
 
-static double nop_cost_function(struct starpu_task *t, struct starpu_perfmodel_arch *a, unsigned i)
-{
-	return 0.001;
-}
-
-static struct starpu_perfmodel nop_perf_model =
-{
-	.type = STARPU_PER_ARCH,
-	.arch_cost_function = nop_cost_function,
-};
-
 static struct starpu_codelet cl_init =
 {
 	.cpu_funcs = {init},
@@ -277,7 +266,7 @@ static struct starpu_codelet cl_init =
 	/*.cpu_funcs_name = {"kernel"},*/
 	.nbuffers = 1,
 	.modes = {STARPU_W},
-	.model = &nop_perf_model,
+	.model = &starpu_nop_perf_model,
 };
 
 int main(int argc, char **argv)