1 /* Computation tests */
3 /* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
12 #include "simdag/simdag.h"
15 * This test checks if the reinitialization of
16 * surf works properly.
17 * 1 test: empty task, reinit, empty task
18 * 2 test: comm cost task, reinit, empty task
25 static SD_task_t create_empty_cost_root()
27 double no_cost[] = { 0.0 };
30 root = SD_task_create("Root", NULL, 1.0);
31 SD_task_schedule(root, 1, SD_workstation_get_list(), no_cost, no_cost,
37 static void zero_cost_test(int *argc, char *argv[])
43 SD_create_environment(argv[1]);
45 task = create_empty_cost_root();
47 SD_task_destroy(task);
49 SD_application_reinit();
51 task = create_empty_cost_root();
53 SD_task_destroy(task);
57 time = SD_get_clock();
64 static SD_task_t create_root_with_costs()
66 double comp_cost[] = { 0.0, 0.0 };
67 double comm_cost[] = { 0.0, 1.0, 0.0, 0.0 };
70 root = SD_task_create("Root", NULL, 1.0);
71 SD_task_schedule(root, 2, SD_workstation_get_list(), comp_cost, comm_cost,
77 static void zero_cost_test2(int *argc, char *argv[])
83 SD_create_environment(argv[1]);
85 task = create_root_with_costs();
87 SD_task_destroy(task);
89 SD_application_reinit();
91 task = create_empty_cost_root();
93 SD_task_destroy(task);
97 time = SD_get_clock();
104 int main(int argc, char **argv)
107 zero_cost_test(&argc, argv);
109 zero_cost_test2(&argc, argv);