Browse Source

Add dumb cost model for callback test to work on simgrid

Samuel Thibault 10 years ago
parent
commit
3f30d16bdb
1 changed files with 19 additions and 1 deletions
  1. 19 1
      mpi/tests/callback.c

+ 19 - 1
mpi/tests/callback.c

@@ -27,11 +27,29 @@ void my_func(STARPU_ATTRIBUTE_UNUSED void *descr[], STARPU_ATTRIBUTE_UNUSED void
 	FPRINTF_MPI(stderr, "i am here\n");
 }
 
+#ifdef STARPU_SIMGRID
+static double cost_function(struct starpu_task *task, unsigned nimpl)
+{
+	(void) task;
+	(void) nimpl;
+	return 0.000001;
+}
+
+static struct starpu_perfmodel model =
+{
+	.type = STARPU_COMMON,
+	.cost_function = cost_function,
+};
+#endif
+
 struct starpu_codelet my_codelet =
 {
 	.cpu_funcs = {my_func},
 	.cuda_funcs = {my_func},
-	.opencl_funcs = {my_func}
+	.opencl_funcs = {my_func},
+#ifdef STARPU_SIMGRID
+	.model = &model
+#endif
 };
 
 static