XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic1, sd, "SimDag test basic1");
-/* Basic SimDag Test 0
+/* Basic SimDag Test 1
* Scenario:
* - Create a no-op Init task
* - Create two communication tasks: 1GB and 1GB
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic2, sd, "SimDag test basic2");
-/* Basic SimDag Test 0
+/* Basic SimDag Test 2
* Scenario:
* - Create a no-op Init task
* - Create two communication tasks: 1GB and 100MB
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic3, sd, "SimDag test basic3");
+/* Basic SimDag Test 3
+ * Scenario:
+ * - Create a chain of tasks (Init, A, Fin)
+ * Verify that the tasks are actually simulated in the right order.
+ */
int main(int argc, char **argv)
{
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic4, sd, "SimDag test basic4");
+/* Basic SimDag Test 4
+ * Scenario:
+ * - Create a chain of tasks (Init, A, Fin)
+ * - Have a 1B communication between two no-op tasks.
+ * Verify that the tasks are actually simulated in the right order.
+ * The simulated time should be equal to the network latency: 0.0001 seconds.
+ */
int main(int argc, char **argv)
{
/* creation of the tasks and their dependencies */
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic5, sd, "SimDag test basic5");
+/* Basic SimDag Test 5
+ * Scenario:
+ * - Create a no-op Init task
+ * - Create two tasks: send 100kB and compute 10Mflops
+ * - Schedule them concurrently
+ * The two tasks should overlap smoothly as they use different resources.
+ * Simulated time should be:
+ * MAX(1e5/(1.25e8), 1e7/4e9) = MAX(.0009, .0025) = 0.0025 seconds
+ */
int main(int argc, char **argv)
{
-/* test scheduling 2 tasks at the same time without artificial dependencies */
-
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic6, sd, "SimDag test basic6");
+/* test scheduling 2 tasks at the same time without artificial dependencies */
+
+/* Basic SimDag Test 6
+ * Scenario:
+ * - Schedule two parallel tasks concurrently on a P2P platform
+ * - Hosts computes 1B per second
+ * Computing power is shared between tasks.
+ * Simulated time should be:
+ * 1/(1/2) = 2 seconds
+ */
int main(int argc, char **argv)
{
ret = SD_simulate(-1.0);
xbt_assert(xbt_dynar_length(ret) == 2,
- "I was expecting the terminaison of 2 tasks, but I got %lu instead", xbt_dynar_length(ret));
+ "I was expecting the terminaison of 2 tasks, but I got %lu instead",
+ xbt_dynar_length(ret));
xbt_dynar_free(&ret);
SD_task_destroy(taskA);
SD_task_destroy(taskB);
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "simdag/simdag.h"
#include "xbt/log.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic2, sd, "SimDag test basic2");
-
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(incomplete, sd, "SimDag incomplete test");
+
+/* SimDag Incomplete Test
+ * Scenario:
+ * - Create a bunch of tasks
+ * - schedule only a subset of them (init, A and D)
+ * - run the simulation
+ * - Verify that we detect which tasks are not scheduled and show their state.
+ * The scheduled task A sends 1GB. Simulation time should be
+ * 1e9/1.25e8 + 1e-4 = 8.0001 seconds
+ * Task D is scheduled but depends on unscheduled task C.
+ */
int main(int argc, char **argv)
{
const SD_workstation_t *workstation;
- double communication_amount1 = 1000000000;
+ double communication_amount1 = 1e9;
double no_cost = 0.0;
/* initialization of SD */