From: suter Date: Mon, 26 Nov 2012 11:18:06 +0000 (+0100) Subject: better description of the basic simdag tests + cosmetics X-Git-Tag: v3_9_rc1~91^2~19 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/68bcc41546f34b2b4fd2bc55f0ce7446fb8cbbfe?ds=sidebyside better description of the basic simdag tests + cosmetics --- diff --git a/teshsuite/simdag/basic1.c b/teshsuite/simdag/basic1.c index d7dcd82c4d..a3dcd3aeaa 100644 --- a/teshsuite/simdag/basic1.c +++ b/teshsuite/simdag/basic1.c @@ -11,7 +11,7 @@ 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 diff --git a/teshsuite/simdag/basic2.c b/teshsuite/simdag/basic2.c index f1eef64917..6e4ac837f4 100644 --- a/teshsuite/simdag/basic2.c +++ b/teshsuite/simdag/basic2.c @@ -11,7 +11,7 @@ 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 diff --git a/teshsuite/simdag/basic3.c b/teshsuite/simdag/basic3.c index 9657e3a0a5..7f747bcb3d 100644 --- a/teshsuite/simdag/basic3.c +++ b/teshsuite/simdag/basic3.c @@ -1,4 +1,4 @@ -/* 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 @@ -11,6 +11,11 @@ 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) { diff --git a/teshsuite/simdag/basic4.c b/teshsuite/simdag/basic4.c index ac09265344..b6435cfdaa 100644 --- a/teshsuite/simdag/basic4.c +++ b/teshsuite/simdag/basic4.c @@ -1,4 +1,4 @@ -/* 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 @@ -11,6 +11,13 @@ 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 */ diff --git a/teshsuite/simdag/basic5.c b/teshsuite/simdag/basic5.c index b40070126b..1bf80b3c1d 100644 --- a/teshsuite/simdag/basic5.c +++ b/teshsuite/simdag/basic5.c @@ -1,4 +1,4 @@ -/* 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 @@ -11,6 +11,15 @@ 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) { diff --git a/teshsuite/simdag/basic6.c b/teshsuite/simdag/basic6.c index f48f761ab0..66e2d341a9 100644 --- a/teshsuite/simdag/basic6.c +++ b/teshsuite/simdag/basic6.c @@ -1,6 +1,4 @@ -/* 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 @@ -13,6 +11,16 @@ #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) { @@ -34,7 +42,8 @@ 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); diff --git a/teshsuite/simdag/incomplete.c b/teshsuite/simdag/incomplete.c index 76c346e67b..696ab7bb55 100644 --- a/teshsuite/simdag/incomplete.c +++ b/teshsuite/simdag/incomplete.c @@ -1,4 +1,4 @@ -/* 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 @@ -9,8 +9,18 @@ #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) { @@ -20,7 +30,7 @@ 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 */