-foreach(x availability basic0 basic1 basic2 basic3 basic4 basic5 basic6 basic-link-test basic-parsing-test
+foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 basic-link-test basic-parsing-test
comm-mxn-all2all comm-mxn-independent comm-mxn-scatter comm-p2p-latency-1
comm-p2p-latency-2 comm-p2p-latency-3 comm-p2p-latency-bound comp-only-par comp-only-seq incomplete)
add_executable (${x} ${x}/${x}.c)
${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.fail
${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.lat PARENT_SCOPE)
-foreach(x availability basic0 basic1 basic2 basic3 basic4 basic5 basic6 basic-link-test basic-parsing-test
+foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 basic-link-test basic-parsing-test
comm-mxn-all2all comm-mxn-independent comm-mxn-scatter comm-p2p-latency-1 flatifier is-router
comm-p2p-latency-2 comm-p2p-latency-3 comm-p2p-latency-bound comp-only-par comp-only-seq incomplete)
ADD_TESH(tesh-simdag-${x} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/${x} ${x}.tesh)
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/simdag.h"
-#include "xbt/log.h"
+#include "xbt/str.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic1, sd, "SimDag test basic1");
*/
int main(int argc, char **argv)
{
- /* scheduling parameters */
- double communication_amount1 = 1e9;
- double communication_amount2 = 1e9;
- double no_cost = 0.0;
/* initialization of SD */
SD_init(&argc, argv);
/* creation of the environment */
SD_create_environment(argv[1]);
+ /* scheduling parameters */
+ double communication_amount1 = xbt_str_parse_double(argv[2], "Invalid communication size: %s");
+ double communication_amount2 = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
/* creation of the tasks and their dependencies */
SD_task_t taskInit = SD_task_create("Init", NULL, 1.0);
SD_task_dependency_add(NULL, NULL, taskInit, taskB);
sg_host_t *hosts = sg_host_list();
- SD_task_schedule(taskInit, 1, hosts, &no_cost, &no_cost, -1.0);
- SD_task_schedule(taskA, 1, &hosts[0], &no_cost, &communication_amount1, -1.0);
- SD_task_schedule(taskB, 1, &hosts[1], &no_cost, &communication_amount2, -1.0);
+ SD_task_schedule(taskInit, 1, hosts, SD_SCHED_NO_COST, SD_SCHED_NO_COST, -1.0);
+ SD_task_schedule(taskA, 1, &hosts[0], SD_SCHED_NO_COST, &communication_amount1, -1.0);
+ SD_task_schedule(taskB, 1, &hosts[1], SD_SCHED_NO_COST, &communication_amount2, -1.0);
xbt_free(hosts);
/* let's launch the simulation! */
-$ ${bindir:=.}/basic1 ../../../examples/platforms/two_hosts_platform_shared.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/basic1 ../../../examples/platforms/two_hosts_platform_shared.xml 1e9 1e9 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
> [ 16.000100] (0:maestro@) Simulation time: 16.000100
+
+$ ${bindir:=.}/basic1 ../../../examples/platforms/two_hosts_platform_shared.xml 1e9 1e8 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [ 0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
+> [ 8.800100] (0:maestro@) Simulation time: 8.800100
+++ /dev/null
-/* Copyright (c) 2007-2012, 2014-2015. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/simdag.h"
-#include "xbt/log.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(basic2, sd, "SimDag test basic2");
-
-/* Basic SimDag Test 2
- * Scenario:
- * - Create a no-op Init task
- * - Create two communication tasks: 1GB and 100MB
- * - Schedule them concurrently on the two hosts of the platform
- * The two communications occur simultaneously. They share the network for the duration of the shortest one, then the
- * longest one has the full bandwidth.
- * Simulated time should be:
- * 1e8/(1/2*1.25e8) + 9e8/1.25e8) + 1e-4 = 8.8001 seconds
- */
-int main(int argc, char **argv)
-{
- /* scheduling parameters */
- double communication_amount1 = 1e9;
- double communication_amount2 = 1e8;
- double no_cost = 0.0;
-
- /* initialization of SD */
- SD_init(&argc, argv);
-
- /* creation of the environment */
- SD_create_environment(argv[1]);
-
- /* creation of the tasks and their dependencies */
- SD_task_t taskInit = SD_task_create("Init", NULL, 1.0);
- SD_task_t taskA = SD_task_create("Task Comm A", NULL, 1.0);
- SD_task_t taskB = SD_task_create("Task Comm B", NULL, 1.0);
-
- SD_task_dependency_add(NULL, NULL, taskInit, taskA);
- SD_task_dependency_add(NULL, NULL, taskInit, taskB);
-
- sg_host_t *hosts = sg_host_list();
- SD_task_schedule(taskInit, 1, hosts, &no_cost, &no_cost, -1.0);
- SD_task_schedule(taskA, 1, &hosts[0], &no_cost, &communication_amount1, -1.0);
- SD_task_schedule(taskB, 1, &hosts[1], &no_cost, &communication_amount2, -1.0);
- xbt_free(hosts);
-
- /* let's launch the simulation! */
- SD_simulate(-1.0);
- SD_task_destroy(taskA);
- SD_task_destroy(taskB);
- SD_task_destroy(taskInit);
-
- XBT_INFO("Simulation time: %f", SD_get_clock());
-
- SD_exit();
- return 0;
-}
+++ /dev/null
-$ ${bindir:=.}/basic2 ../../../examples/platforms/two_hosts_platform_shared.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [ 0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
-> [ 8.800100] (0:maestro@) Simulation time: 8.800100