1 /* test scheduling 2 tasks at the same time without artificial dependencies */
3 /* Copyright (c) 2007, 2008, 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. */
11 #include "simdag/simdag.h"
12 #include "xbt/asserts.h"
15 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic6, sd, "SimDag test basic6");
17 int main(int argc, char **argv)
19 double comm_cost[] = { 0.0, 0.0, 0.0, 0.0 };
20 double comp_cost[] = { 1.0 };
21 SD_task_t taskA, taskB;
25 SD_create_environment(argv[1]);
27 taskA = SD_task_create("Task A", NULL, 1.0);
28 taskB = SD_task_create("Task B", NULL, 1.0);
30 SD_task_schedule(taskA, 1, SD_workstation_get_list(), comp_cost,
32 SD_task_schedule(taskB, 1, SD_workstation_get_list(), comp_cost,
35 ret = SD_simulate(-1.0);
36 xbt_assert(xbt_dynar_length(ret) == 2,
37 "I was expecting the terminaison of 2 tasks, but I got %lu instead", xbt_dynar_length(ret));
39 SD_task_destroy(taskA);
40 SD_task_destroy(taskB);
42 XBT_INFO("Simulation time: %f", SD_get_clock());