Bläddra i källkod

examples/sched_ctx: delete contexts in the inverse order to the ones they were created

Nathalie Furmento 6 år sedan
förälder
incheckning
75c6013e30
2 ändrade filer med 3 tillägg och 3 borttagningar
  1. 1 1
      examples/sched_ctx/sched_ctx.c
  2. 2 2
      examples/sched_ctx/two_cpu_contexts.c

+ 1 - 1
examples/sched_ctx/sched_ctx.c

@@ -152,8 +152,8 @@ int main(void)
 	starpu_task_wait_for_all();
 
 	starpu_sched_ctx_add_workers(procs1, nprocs1, sched_ctx2);
-	starpu_sched_ctx_delete(sched_ctx1);
 	starpu_sched_ctx_delete(sched_ctx2);
+	starpu_sched_ctx_delete(sched_ctx1);
 	printf("tasks executed %d out of %d\n", tasks_executed, ntasks);
 	printf("tasks executed on ctx1: %d\n", ctx1_tasks_executed);
 	printf("tasks executed on ctx2: %d\n", ctx2_tasks_executed);

+ 2 - 2
examples/sched_ctx/two_cpu_contexts.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2017                                     CNRS
+ * Copyright (C) 2017, 2018                               CNRS
  * Copyright (C) 2016,2018                                Inria
  * Copyright (C) 2016                                     Université de Bordeaux
  *
@@ -111,8 +111,8 @@ int main(void)
 	starpu_task_wait_for_all();
 
 	starpu_sched_ctx_add_workers(procs1, nprocs1, sched_ctx2);
-	starpu_sched_ctx_delete(sched_ctx1);
 	starpu_sched_ctx_delete(sched_ctx2);
+	starpu_sched_ctx_delete(sched_ctx1);
 	starpu_shutdown();
 	free(procs);
 	free(procs1);