include examples/deprecated/simdag/scheduling/expected_output.jed
include examples/deprecated/simdag/scheduling/sd_scheduling.c
include examples/deprecated/simdag/scheduling/sd_scheduling.tesh
-include examples/deprecated/simdag/test/sd_test.cpp
-include examples/deprecated/simdag/test/sd_test.tesh
-include examples/deprecated/simdag/typed_tasks/sd_typed_tasks.c
-include examples/deprecated/simdag/typed_tasks/sd_typed_tasks.tesh
include examples/python/actor-create/actor-create.py
include examples/python/actor-create/actor-create.tesh
include examples/python/actor-daemon/actor-daemon.py
-foreach(x daxload typed_tasks scheduling)
+foreach(x daxload scheduling)
add_executable (sd_${x} EXCLUDE_FROM_ALL ${x}/sd_${x}.c)
target_link_libraries(sd_${x} simgrid)
set_target_properties(sd_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/sd_${x}.tesh)
endforeach()
-foreach(x test)
- add_executable (sd_${x} EXCLUDE_FROM_ALL ${x}/sd_${x}.cpp)
- target_link_libraries(sd_${x} simgrid)
- set_target_properties(sd_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- add_dependencies(tests sd_${x})
- set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/sd_${x}.cpp)
- set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/sd_${x}.tesh)
-endforeach()
-
foreach(x dag-dotload)
if(HAVE_GRAPHVIZ)
add_executable (sd_${x} EXCLUDE_FROM_ALL ${x}/sd_${x}.c)
${CMAKE_CURRENT_SOURCE_DIR}/dag-dotload/dag.dot
${CMAKE_CURRENT_SOURCE_DIR}/scheduling/expected_output.jed PARENT_SCOPE)
-foreach(x daxload typed_tasks scheduling test)
+foreach(x daxload scheduling)
ADD_TESH(simdag-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/simdag --cd ${CMAKE_BINARY_DIR}/examples/deprecated/simdag ${CMAKE_HOME_DIRECTORY}/examples/deprecated/simdag/${x}/sd_${x}.tesh)
endforeach()
+++ /dev/null
-/* Copyright (c) 2006-2021. 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/s4u.hpp"
-#include "simgrid/simdag.h"
-
-#include <cmath>
-#include <set>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test, "Logging specific to this SimDag example");
-
-int main(int argc, char **argv)
-{
- sg_host_t host_list[2];
- double computation_amount[2];
- double communication_amount[4] = { 0 };
-
- /* initialization of SD */
- SD_init(&argc, argv);
-
- xbt_assert(argc > 1, "Usage: %s platform_file\n\nExample: %s two_clusters.xml", argv[0], argv[0]);
- SD_create_environment(argv[1]);
-
- /* test the estimation functions */
- const sg_host_t* hosts = sg_host_list();
- simgrid::s4u::Host* h1 = hosts[4];
- simgrid::s4u::Host* h2 = hosts[2];
- double comp_amount1 = 2000000;
- double comp_amount2 = 1000000;
- double comm_amount12 = 2000000;
- double comm_amount21 = 3000000;
- XBT_INFO("Computation time for %f flops on %s: %f", comp_amount1, h1->get_cname(), comp_amount1 / h1->get_speed());
- XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, h2->get_cname(), comp_amount2 / h2->get_speed());
-
- XBT_INFO("Route between %s and %s:", h1->get_cname(), h2->get_cname());
- std::vector<sg_link_t> route;
- double latency = 0;
- h1->route_to(h2, route, &latency);
-
- for (auto const& link : route)
- XBT_INFO(" Link %s: latency = %f, bandwidth = %f", sg_link_get_name(link), sg_link_get_latency(link),
- sg_link_get_bandwidth(link));
-
- XBT_INFO("Route latency = %f, route bandwidth = %f", latency, sg_host_get_route_bandwidth(h1, h2));
- XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount12, h1->get_cname(), h2->get_cname(),
- sg_host_get_route_latency(h1, h2) + comm_amount12 / sg_host_get_route_bandwidth(h1, h2));
- XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount21, h2->get_cname(), h1->get_cname(),
- sg_host_get_route_latency(h2, h1) + comm_amount21 / sg_host_get_route_bandwidth(h2, h1));
-
- /* creation of the tasks and their dependencies */
- SD_task_t taskA = SD_task_create("Task A", nullptr, 10.0);
- SD_task_t taskB = SD_task_create("Task B", nullptr, 40.0);
- SD_task_t taskC = SD_task_create("Task C", nullptr, 30.0);
- SD_task_t taskD = SD_task_create("Task D", nullptr, 60.0);
-
- /* try to attach and retrieve user data to a task */
- SD_task_set_data(taskA, &comp_amount1);
- if (fabs(comp_amount1 - (*(static_cast<double*>(SD_task_get_data(taskA))))) > 1e-12)
- XBT_ERROR("User data was corrupted by a simple set/get");
-
- SD_task_dependency_add(taskB, taskA);
- SD_task_dependency_add(taskC, taskA);
- SD_task_dependency_add(taskD, taskB);
- SD_task_dependency_add(taskD, taskC);
- SD_task_dependency_add(taskB, taskC);
-
- /* watch points */
- SD_task_watch(taskD, SD_DONE);
- SD_task_watch(taskB, SD_DONE);
- SD_task_unwatch(taskD, SD_DONE);
-
- /* scheduling parameters */
- host_list[0] = h1;
- host_list[1] = h2;
- computation_amount[0] = comp_amount1;
- computation_amount[1] = comp_amount2;
-
- communication_amount[1] = comm_amount12;
- communication_amount[2] = comm_amount21;
-
- /* estimated time */
- XBT_INFO("Estimated time for '%s': %f", SD_task_get_name(taskD),
- SD_task_get_execution_time(taskD, 2, host_list, computation_amount, communication_amount));
-
- SD_task_schedule(taskA, 2, host_list, computation_amount, communication_amount, -1);
- SD_task_schedule(taskB, 2, host_list, computation_amount, communication_amount, -1);
- SD_task_schedule(taskC, 2, host_list, computation_amount, communication_amount, -1);
- SD_task_schedule(taskD, 2, host_list, computation_amount, communication_amount, -1);
-
- const std::set<SD_task_t>* changed_tasks = simgrid::sd::simulate(-1.0);
- for (auto const& task : *changed_tasks) {
- XBT_INFO("Task '%s' start time: %f, finish time: %f", SD_task_get_name(task),
- SD_task_get_start_time(task), SD_task_get_finish_time(task));
- }
-
- XBT_DEBUG("Destroying tasks...");
- SD_task_destroy(taskA);
- SD_task_destroy(taskB);
- SD_task_destroy(taskC);
- SD_task_destroy(taskD);
-
- XBT_DEBUG("Tasks destroyed. Exiting SimDag...");
- xbt_free((sg_host_t*)hosts);
- return 0;
-}
+++ /dev/null
-#!/usr/bin/env tesh
-
-p Simple test of simdag
-
-! output sort
-$ ./test/sd_test ${srcdir:=.}/../../platforms/small_platform.xml
-> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
-> [0.000000] [sd_test/INFO] Computation time for 2000000.000000 flops on Jacquelin: 0.014563
-> [0.000000] [sd_test/INFO] Computation time for 1000000.000000 flops on Fafard: 0.013107
-> [0.000000] [sd_test/INFO] Route between Jacquelin and Fafard:
-> [0.000000] [sd_test/INFO] Link 145: latency = 0.000410, bandwidth = 2583375.000000
-> [0.000000] [sd_test/INFO] Link 59: latency = 0.000371, bandwidth = 11845375.000000
-> [0.000000] [sd_test/INFO] Link 56: latency = 0.029589, bandwidth = 21414750.000000
-> [0.000000] [sd_test/INFO] Link 54: latency = 0.035083, bandwidth = 15376875.000000
-> [0.000000] [sd_test/INFO] Link 17: latency = 0.000137, bandwidth = 118682500.000000
-> [0.000000] [sd_test/INFO] Link 16: latency = 0.000514, bandwidth = 34285625.000000
-> [0.000000] [sd_test/INFO] Link 10: latency = 0.000514, bandwidth = 34285625.000000
-> [0.000000] [sd_test/INFO] Link 6: latency = 0.000060, bandwidth = 41279125.000000
-> [0.000000] [sd_test/INFO] Link 9: latency = 0.001462, bandwidth = 7209750.000000
-> [0.000000] [sd_test/INFO] Link 79: latency = 0.000156, bandwidth = 8427250.000000
-> [0.000000] [sd_test/INFO] Link 78: latency = 0.000278, bandwidth = 27946250.000000
-> [0.000000] [sd_test/INFO] Route latency = 0.068575, route bandwidth = 2583375.000000
-> [0.000000] [sd_test/INFO] Communication time for 2000000.000000 bytes between Jacquelin and Fafard: 0.842756
-> [0.000000] [sd_test/INFO] Communication time for 3000000.000000 bytes between Fafard and Jacquelin: 1.229846
-> [0.000000] [sd_test/INFO] Estimated time for 'Task D': 1.242953
-> [4.008055] [sd_test/INFO] Task 'Task B' start time: 2.004027, finish time: 4.008055
-> [4.008055] [sd_test/INFO] Task 'Task D' start time: 0.000000, finish time: 2.004027
+++ /dev/null
-/* Copyright (c) 2006-2021. 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_CATEGORY(sd_typed_tasks_test, "Logging specific to this SimDag example");
-
-int main(int argc, char **argv)
-{
- unsigned int ctr;
- SD_task_t task;
-
- double computation_amount[4];
- double communication_amount[16] = { 0 };
- sg_host_t host_list[4];
-
- SD_init(&argc, argv);
-
- xbt_assert(argc > 1, "Usage: %s platform_file\n\nExample: %s two_clusters.xml", argv[0], argv[0]);
- SD_create_environment(argv[1]);
-
- sg_host_t *hosts = sg_host_list();
-
- /* creation of some typed tasks and their dependencies */
- SD_task_t seq_comp1 = SD_task_create_comp_seq("Seq. comp. 1", NULL, 1e9);
- SD_task_t e2e_comm = SD_task_create_comm_e2e("E2E comm.", NULL, 1e7);
- SD_task_t seq_comp2 = SD_task_create_comp_seq("Seq. comp 2.", NULL, 1e9);
- SD_task_t par_comp1 = SD_task_create_comp_par_amdahl("Par. Comp. 1", NULL, 1e9, 0.2);
- SD_task_t redist = SD_task_create_comm_par_mxn_1d_block("MxN redist", NULL, 1.2e8);
- SD_task_t par_comp2 = SD_task_create_comp_par_amdahl("Par. Comp. 2", NULL, 3e8, 0.5);
- SD_task_t par_comp3 = SD_task_create("Par. Comp. 3", NULL, 1e9);
-
- SD_task_dependency_add(seq_comp1, e2e_comm);
- SD_task_dependency_add(e2e_comm, seq_comp2);
-
- SD_task_dependency_add(par_comp1, redist);
- SD_task_dependency_add(redist, par_comp2);
-
- SD_task_schedulel(seq_comp1, 1, hosts[8]);
- SD_task_schedulel(seq_comp2, 1, hosts[9]);
-
- SD_task_schedulev(par_comp1, 4, hosts);
- SD_task_schedulev(par_comp2, 3, hosts);
-
- /* Let's unschedule these tasks and test the auto-scheduling in the opposite way. */
- SD_task_unschedule(par_comp1);
- SD_task_unschedule(par_comp2);
- SD_task_unschedule(redist); /* yes, it was scheduled too */
-
- SD_task_schedulev(par_comp2, 3, hosts);
- SD_task_schedulev(par_comp1, 4, hosts);
-
- for (int i=0;i<4;i++){
- host_list[i]=hosts[i+4];
- /* Apply Amdahl's law manually assuming a 20% serial part */
- computation_amount[i]=(0.2 + (1 - 0.2)/4) * SD_task_get_amount(par_comp3);
- }
-
- SD_task_schedule(par_comp3, 4, host_list, computation_amount, communication_amount, -1);
-
- xbt_dynar_t changed_tasks = xbt_dynar_new(sizeof(SD_task_t), NULL);
- SD_simulate_with_update(-1.0, changed_tasks);
- xbt_dynar_foreach(changed_tasks, ctr, task) {
- XBT_INFO("Task '%s' start time: %f, finish time: %f", SD_task_get_name(task), SD_task_get_start_time(task),
- SD_task_get_finish_time(task));
- }
-
- xbt_dynar_foreach(changed_tasks, ctr, task)
- SD_task_destroy(task);
- xbt_dynar_free_container(&changed_tasks);
-
- xbt_free(hosts);
- return 0;
-}
+++ /dev/null
-#!/usr/bin/env tesh
-p Usage test of simdag's typed tasks
-
-! output sort
-$ ./typed_tasks/sd_typed_tasks ${srcdir:=.}/../../platforms/cluster_backbone.xml
-> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 3' start time: 0.000000, finish time: 0.400000
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 1' start time: 0.000000, finish time: 0.400000
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'Seq. comp. 1' start time: 0.000000, finish time: 1.000000
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'MxN redist' start time: 0.400000, finish time: 0.720600
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 2' start time: 0.720600, finish time: 0.920600
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'E2E comm.' start time: 1.000000, finish time: 1.080600
-> [2.080600] [sd_typed_tasks_test/INFO] Task 'Seq. comp 2.' start time: 1.080600, finish time: 2.080600