From: SUTER Frederic Date: Sun, 2 Jan 2022 14:41:17 +0000 (+0100) Subject: Kill both SimDag and Jedule bindings. Cleanups will follow X-Git-Tag: v3.30~150 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bc0010abcda73a601f75f7c96fc1cc09918ee2cd Kill both SimDag and Jedule bindings. Cleanups will follow --- diff --git a/MANIFEST.in b/MANIFEST.in index e18ca85b9b..9141a50b9e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -217,7 +217,6 @@ include examples/cpp/dag-from-dot/s4u-dag-from-dot.tesh include examples/cpp/dag-io/s4u-dag-io.cpp include examples/cpp/dag-io/s4u-dag-io.tesh include examples/cpp/dag-scheduling/Montage_25.xml -include examples/cpp/dag-scheduling/expected_output.jed include examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp include examples/cpp/dag-scheduling/s4u-dag-scheduling.tesh include examples/cpp/dag-simple/s4u-dag-simple.cpp @@ -2061,10 +2060,6 @@ include include/simgrid/exec.h include include/simgrid/forward.h include include/simgrid/host.h include include/simgrid/instr.h -include include/simgrid/jedule/jedule.hpp -include include/simgrid/jedule/jedule_events.hpp -include include/simgrid/jedule/jedule_platform.hpp -include include/simgrid/jedule/jedule_sd_binding.h include include/simgrid/kernel/ProfileBuilder.hpp include include/simgrid/kernel/Timer.hpp include include/simgrid/kernel/future.hpp @@ -2115,7 +2110,6 @@ include include/simgrid/s4u/NetZone.hpp include include/simgrid/s4u/Semaphore.hpp include include/simgrid/s4u/VirtualMachine.hpp include include/simgrid/semaphore.h -include include/simgrid/simdag.h include include/simgrid/simix.h include include/simgrid/simix.hpp include include/simgrid/version.h.in @@ -2243,10 +2237,6 @@ include src/instr/instr_platform.cpp include src/instr/instr_private.hpp include src/instr/instr_resource_utilization.cpp include src/instr/instr_smpi.hpp -include src/instr/jedule/jedule.cpp -include src/instr/jedule/jedule_events.cpp -include src/instr/jedule/jedule_platform.cpp -include src/instr/jedule/jedule_sd_binding.cpp include src/internal_config.h.in include src/kernel/EngineImpl.cpp include src/kernel/EngineImpl.hpp @@ -2456,8 +2446,6 @@ include src/simdag/dax_dtd.c include src/simdag/dax_dtd.h include src/simdag/sd_daxloader.cpp include src/simdag/sd_dotloader.cpp -include src/simdag/sd_global.cpp -include src/simdag/sd_task.cpp include src/simdag/simdag_private.hpp include src/simgrid/Exception.cpp include src/simgrid/sg_config.cpp diff --git a/docs/source/Installing_SimGrid.rst b/docs/source/Installing_SimGrid.rst index 0696f9c7b1..8b02627e8e 100644 --- a/docs/source/Installing_SimGrid.rst +++ b/docs/source/Installing_SimGrid.rst @@ -261,10 +261,6 @@ enable_java (on/OFF) Generates the java bindings of SimGrid. You must also enable MSG for this to work. -enable_jedule (on/OFF) - Produces execution traces from SimDag simulations, which can then be visualized with the - Jedule external tool. - enable_lua (on/OFF) Generate the lua bindings to the SimGrid internals (requires lua-5.3). diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index d0fa3df3c5..7bd62d3128 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -256,7 +256,6 @@ set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dax/simpl ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dax/smalldax.xml ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dot/dag.dot ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dot/dag_with_cycle.dot - ${CMAKE_CURRENT_SOURCE_DIR}/dag-scheduling/expected_output.jed ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p0.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p1.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm.txt diff --git a/examples/cpp/dag-failure/s4u-dag-failure.tesh b/examples/cpp/dag-failure/s4u-dag-failure.tesh index 9fcb888643..aff6c32418 100644 --- a/examples/cpp/dag-failure/s4u-dag-failure.tesh +++ b/examples/cpp/dag-failure/s4u-dag-failure.tesh @@ -1,6 +1,6 @@ #!/usr/bin/env tesh -p Test of the management of failed tasks simdag +p Test of the management of failed dag activities $ ${bindir:=.}/s4u-dag-failure ${platfdir}/faulty_host.xml --log=s4u_activity.t:verbose "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" > [ 0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07' diff --git a/examples/cpp/dag-from-dax/s4u-dag-from-dax.tesh b/examples/cpp/dag-from-dax/s4u-dag-from-dax.tesh index 34705f95a7..ad0b9cb6be 100644 --- a/examples/cpp/dag-from-dax/s4u-dag-from-dax.tesh +++ b/examples/cpp/dag-from-dax/s4u-dag-from-dax.tesh @@ -2,8 +2,8 @@ p Test the DAX loader on a small DAX instance $ ${bindir:=.}/s4u-dag-from-dax --log=no_loc ${platfdir}/cluster_backbone.xml ${srcdir:=.}/smalldax.xml -> [0.000000] [sd_daxparse/WARNING] Ignore file o1 size redefinition from 1000000 to 304 -> [0.000000] [sd_daxparse/WARNING] Ignore file o2 size redefinition from 1000000 to 304 +> [0.000000] [daxparse/WARNING] Ignore file o1 size redefinition from 1000000 to 304 +> [0.000000] [daxparse/WARNING] Ignore file o2 size redefinition from 1000000 to 304 > [0.000000] [dag_from_dax/INFO] --------- Display all activities of the loaded DAG ----------- > [0.000000] [dag_from_dax/INFO] 'root' is an Exec: 0 flops to execute. Dependencies: solved; Ressources: NOT assigned > [0.000000] [dag_from_dax/INFO] '1@task1' is an Exec: 42000000000 flops to execute. Dependencies: NOT solved; Ressources: NOT assigned @@ -33,5 +33,5 @@ p Test the DAX loader with a DAX comprising a cycle. ! expect return 2 $ ${bindir:=.}/s4u-dag-from-dax --log=no_loc ${platfdir}/cluster_backbone.xml ${srcdir:=.}/simple_dax_with_cycle.xml -> [0.000000] [sd_daxparse/ERROR] The DAX described in simple_dax_with_cycle.xml is not a DAG. It contains a cycle. +> [0.000000] [daxparse/ERROR] The DAX described in simple_dax_with_cycle.xml is not a DAG. It contains a cycle. > [0.000000] [dag_from_dax/ERROR] A problem occurred during DAX parsing (cycle or syntax). Do not continue this test diff --git a/examples/cpp/dag-from-dot/s4u-dag-from-dot.tesh b/examples/cpp/dag-from-dot/s4u-dag-from-dot.tesh index 04bb0ccfdf..fb4af3b54f 100644 --- a/examples/cpp/dag-from-dot/s4u-dag-from-dot.tesh +++ b/examples/cpp/dag-from-dot/s4u-dag-from-dot.tesh @@ -48,5 +48,5 @@ $ ${bindir:=.}/s4u-dag-from-dot --log=no_loc ${platfdir}/cluster_backbone.xml ${ ! expect return 2 $ ${bindir:=.}/s4u-dag-from-dot --log=no_loc ${platfdir}/cluster_backbone.xml ${srcdir:=.}/dag_with_cycle.dot -> [0.000000] [sd_dotparse/ERROR] The DOT described in dag_with_cycle.dot is not a DAG. It contains a cycle. +> [0.000000] [dotparse/ERROR] The DOT described in dag_with_cycle.dot is not a DAG. It contains a cycle. > [0.000000] [dag_from_dot/CRITICAL] No dot loaded. Do you have a cycle in your graph? diff --git a/examples/cpp/dag-scheduling/expected_output.jed b/examples/cpp/dag-scheduling/expected_output.jed deleted file mode 100644 index 0228c80c0d..0000000000 --- a/examples/cpp/dag-scheduling/expected_output.jed +++ /dev/null @@ -1,1252 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - get_hierarchy_as_string().c_str()); - fprintf(jed_file, ".[%d-%d]", subset.start_idx, subset.start_idx + subset.nres - 1); - fprintf(jed_file, "\" />\n"); - } - fprintf(jed_file, " \n"); - - if (not this->characteristics_list_.empty()) { - fprintf(jed_file, " \n"); - for (auto const& ch : this->characteristics_list_) - fprintf(jed_file, " \n", ch.c_str()); - fprintf(jed_file, " \n"); - } - - if (not this->info_map_.empty()) { - fprintf(jed_file, " \n"); - for (auto const& elm : this->info_map_) - fprintf(jed_file, " \n", elm.first.c_str(), elm.second.c_str()); - fprintf(jed_file, " \n"); - } - - fprintf(jed_file, " \n"); -} - -} -} -#endif diff --git a/src/instr/jedule/jedule_platform.cpp b/src/instr/jedule/jedule_platform.cpp deleted file mode 100644 index 00f78dad26..0000000000 --- a/src/instr/jedule/jedule_platform.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (c) 2010-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/jedule/jedule.hpp" -#include "simgrid/config.h" -#include "simgrid/host.h" -#include "simgrid/s4u/NetZone.hpp" -#include "xbt/asserts.h" -#include - -#if SIMGRID_HAVE_JEDULE - -namespace { -std::unordered_map host2_simgrid_parent_container; -std::unordered_map container_name2container; -} - -namespace simgrid { -namespace jedule { -Subset::Subset(int start_idx, int end_idx, Container* parent) - : start_idx(start_idx), nres(end_idx - start_idx + 1), parent(parent) -{ -} - -Container::Container(const std::string& name) : name(name) -{ - container_name2container.insert({this->name, this}); -} - -void Container::add_child(jed_container_t child) -{ - xbt_assert(child != nullptr); - children_.emplace_back(child); - child->set_parent(this); -} - -void Container::add_resources(const std::vector& hosts) -{ - children_.clear(); - last_id_ = 0; - - for (auto const& host : hosts) { - const char *host_name = sg_host_get_name(host); - this->name2id.insert({host_name, this->last_id_}); - (this->last_id_)++; - host2_simgrid_parent_container.insert({host_name, this}); - this->resource_list.push_back(host); - } -} - -void Container::create_hierarchy(const_sg_netzone_t from_as) -{ - if (from_as->get_children().empty()) { - // I am no AS - // add hosts to jedule platform - std::vector table = from_as->get_all_hosts(); - this->add_resources(table); - } else { - for (auto const& nz : from_as->get_children()) { - auto* child_container = new simgrid::jedule::Container(nz->get_name()); - this->add_child(child_container); - child_container->create_hierarchy(nz); - } - } -} - -int Container::get_child_position(const Container* child) const -{ - auto it = std::find_if(begin(children_), end(children_), - [&child](const std::unique_ptr& c) { return c.get() == child; }); - return it == end(children_) ? -1 : static_cast(std::distance(begin(children_), it)); -} - -std::vector Container::get_hierarchy() -{ - if (parent_ == nullptr) { - int top_level = 0; - std::vector hier_list = {top_level}; - return hier_list; - } else if (parent_->has_children()) { - int child_nb = parent_->get_child_position(this); - xbt_assert(child_nb > -1); - std::vector hier_list = parent_->get_hierarchy(); - hier_list.insert(hier_list.begin(), child_nb); - return hier_list; - } else { - // we are in the last level - return parent_->get_hierarchy(); - } -} - -std::string Container::get_hierarchy_as_string() -{ - std::string output(""); - - std::vector hier_list = this->get_hierarchy(); - - bool sep = false; - for (auto const& id : hier_list) { - if (sep) - output += '.'; - else - sep = true; - output += std::to_string(id); - } - - return output; -} - -void Container::print_resources(FILE* jed_file) -{ - xbt_assert(not this->resource_list.empty()); - - std::string resid = this->get_hierarchy_as_string(); - - fprintf(jed_file, " resource_list.size()); - bool sep = false; - for (auto const& res : this->resource_list) { - if (sep) - putc('|', jed_file); - else - sep = true; - const char * res_name = sg_host_get_name(res); - fprintf(jed_file, "%s", res_name); - } - fprintf(jed_file, "\" />\n"); -} - -void Container::print(FILE* jed_file) -{ - fprintf(jed_file, " \n", this->name.c_str()); - if (not children_.empty()) { - for (auto const& child : children_) { - child->print(jed_file); - } - } else { - this->print_resources(jed_file); - } - fprintf(jed_file, " \n"); -} - -} // namespace jedule -} // namespace simgrid - -static void add_subsets_to(std::vector& subset_list, const std::vector& hostgroup, - jed_container_t parent) -{ - // get ids for each host - // sort ids - // compact ids - // create subset for each id group - - xbt_assert( parent != nullptr ); - - std::vector id_list; - - for (auto const& host_name : hostgroup) { - xbt_assert( host_name != nullptr ); - const simgrid::jedule::Container* parent_cont = host2_simgrid_parent_container.at(host_name); - unsigned int id = parent_cont->get_id_by_name(host_name); - id_list.push_back(id); - } - std::sort(id_list.begin(), id_list.end()); - - size_t nb_ids = id_list.size(); - size_t start = 0; - size_t pos = start; - for (size_t i = 0; i < nb_ids; i++) { - if (id_list[i] - id_list[pos] > 1) { - subset_list.emplace_back(id_list[start], id_list[pos], parent); - start = i; - - if (i == nb_ids - 1) { - subset_list.emplace_back(id_list[i], id_list[i], parent); - } - } else { - if (i == nb_ids - 1) { - subset_list.emplace_back(id_list[start], id_list[i], parent); - } - } - pos = i; - } -} - -void get_resource_selection_by_hosts(std::vector& subset_list, - const std::vector& host_list) -{ - // for each host name - // find parent container - // group by parent container - std::unordered_map> parent2hostgroup; - for (auto const& host : host_list) { - const char *host_name = sg_host_get_name(host); - const simgrid::jedule::Container* parent = host2_simgrid_parent_container.at(host_name); - xbt_assert( parent != nullptr ); - - auto host_group = parent2hostgroup.find(parent->get_cname()); - if (host_group == parent2hostgroup.end()) - parent2hostgroup.insert({parent->get_cname(), std::vector(1, host_name)}); - else - host_group->second.push_back(host_name); - } - - for (auto const& elm : parent2hostgroup) { - jed_container_t parent = container_name2container.at(elm.first); - add_subsets_to(subset_list, elm.second, parent); - } -} - -#endif diff --git a/src/instr/jedule/jedule_sd_binding.cpp b/src/instr/jedule/jedule_sd_binding.cpp deleted file mode 100644 index c3a644936d..0000000000 --- a/src/instr/jedule/jedule_sd_binding.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2010-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/jedule/jedule.hpp" -#include "simgrid/s4u/Engine.hpp" -#include "simgrid/s4u/NetZone.hpp" -#include "src/simdag/simdag_private.hpp" -#include "xbt/virtu.h" - -#if SIMGRID_HAVE_JEDULE - -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_sd, sd, "Jedule SimDag binding"); - -jedule_t my_jedule; - -void jedule_log_sd_event(const_SD_task_t task) -{ - xbt_assert(task != nullptr); - - simgrid::jedule::Event event(task->get_name(), task->get_start_time(), task->get_finish_time(), "SD"); - event.add_resources(*task->get_allocation()); - my_jedule->add_event(event); -} - -void jedule_sd_init() -{ - const_sg_netzone_t root_comp = simgrid::s4u::Engine::get_instance()->get_netzone_root(); - XBT_DEBUG("root name %s\n", root_comp->get_cname()); - - my_jedule = new simgrid::jedule::Jedule(root_comp->get_name()); -} - -void jedule_sd_exit() -{ - delete my_jedule; -} - -void jedule_sd_dump(const char * filename) -{ - if (my_jedule) { - std::string fname; - if (not filename) { - fname = simgrid::xbt::binary_name + ".jed"; - } else { - fname = filename; - } - - FILE* fh = fopen(fname.c_str(), "w"); - xbt_assert(fh != nullptr, "Failed to open file: %s", fname.c_str()); - - my_jedule->write_output(fh); - - fclose(fh); - } -} -#endif diff --git a/src/simdag/sd_daxloader.cpp b/src/simdag/sd_daxloader.cpp index 62062e3bab..877bfc826e 100644 --- a/src/simdag/sd_daxloader.cpp +++ b/src/simdag/sd_daxloader.cpp @@ -18,7 +18,7 @@ #include "dax_dtd.h" #include "dax_dtd.c" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_daxparse, sd, "Parsing DAX files"); +XBT_LOG_NEW_DEFAULT_CATEGORY(daxparse, "Parsing DAX files"); /* Ensure that transfer tasks have unique names even though a file is used several times */ static void uniq_transfer_task_name(simgrid::s4u::Comm* comm) diff --git a/src/simdag/sd_dotloader.cpp b/src/simdag/sd_dotloader.cpp index 90609a3b24..a59bf74149 100644 --- a/src/simdag/sd_dotloader.cpp +++ b/src/simdag/sd_dotloader.cpp @@ -19,7 +19,7 @@ #if HAVE_GRAPHVIZ #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files"); +XBT_LOG_NEW_DEFAULT_CATEGORY(dotparse, "Parsing DOT files"); namespace simgrid { namespace s4u { diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp deleted file mode 100644 index 04a0f1d901..0000000000 --- a/src/simdag/sd_global.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* 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 "simdag_private.hpp" -#include "simgrid/kernel/resource/Action.hpp" -#include "simgrid/kernel/resource/Model.hpp" -#include "simgrid/s4u/Engine.hpp" -#include "simgrid/sg_config.hpp" -#include "src/kernel/EngineImpl.hpp" -#include "src/surf/surf_interface.hpp" - -#include - -XBT_LOG_NEW_CATEGORY(sd, "Logging specific to SimDag"); -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_kernel, sd, "Logging specific to SimDag (kernel)"); - -std::unique_ptr sd_global = nullptr; - -namespace simgrid { -namespace sd { - -std::set* simulate(double how_long) -{ - XBT_VERB("Run simulation for %f seconds", how_long); - - auto engine = sd_global->engine_->get_impl(); - sd_global->watch_point_reached = false; - sd_global->return_set.clear(); - - /* explore the runnable tasks */ - while (not sd_global->runnable_tasks.empty()) - (*(sd_global->runnable_tasks.begin()))->run(); - - double elapsed_time = 0.0; - double total_time = 0.0; - /* main loop */ - while (elapsed_time >= 0 && (how_long < 0 || 0.00001 < (how_long - total_time)) && - not sd_global->watch_point_reached) { - XBT_DEBUG("Total time: %f", total_time); - - elapsed_time = engine->solve(how_long > 0 ? simgrid_get_clock() + how_long - total_time : -1.0); - XBT_DEBUG("solve() returns %f", elapsed_time); - if (elapsed_time > 0.0) - total_time += elapsed_time; - - /* let's see which tasks are done */ - for (auto const& model : engine->get_all_models()) { - const kernel::resource::Action* action = model->extract_done_action(); - while (action != nullptr && action->get_data() != nullptr) { - auto* task = static_cast(action->get_data()); - XBT_VERB("Task '%s' done", task->get_cname()); - task->set_state(SD_DONE); - - /* the state has changed. Add it only if it's the first change */ - sd_global->return_set.emplace(task); - - /* remove the dependencies after this task */ - for (auto const& succ : task->get_successors()) - succ->released_by(task); - - for (auto const& output : task->get_outputs()) - output->produced_by(task); - task->clear_successors(); - action = model->extract_done_action(); - } - - /* let's see which tasks have just failed */ - action = model->extract_failed_action(); - while (action != nullptr) { - auto* task = static_cast(action->get_data()); - XBT_VERB("Task '%s' failed", task->get_cname()); - task->set_state(SD_FAILED); - sd_global->return_set.insert(task); - action = model->extract_failed_action(); - } - } - } - - if (not sd_global->watch_point_reached && how_long < 0 && not sd_global->initial_tasks.empty()) { - XBT_WARN("Simulation is finished but %zu tasks are still not done", sd_global->initial_tasks.size()); - for (auto const& t : sd_global->initial_tasks) - XBT_WARN("%s is in %s state", t->get_cname(), __get_state_name(t->get_state())); - } - - XBT_DEBUG("elapsed_time = %f, total_time = %f, watch_point_reached = %d", elapsed_time, total_time, - sd_global->watch_point_reached); - XBT_DEBUG("current time = %f", simgrid_get_clock()); - - return &sd_global->return_set; -} -} // namespace sd -} // namespace simgrid - -/** - * @brief helper for pretty printing of task state - * @param state the state of a task - * @return the equivalent as a readable string - */ -const char* __get_state_name(e_SD_task_state_t state) -{ - static constexpr std::array state_names{ - {"not scheduled", "schedulable", "scheduled", "runnable", "running", "done", "failed"}}; - return state_names.at(static_cast(log2(static_cast(state)))); -} - -/** - * @brief Initializes SD internal data - * - * This function must be called before any other SD function. Then you should call SD_create_environment(). - * - * @param argc argument number - * @param argv argument list - * @see SD_create_environment(), SD_exit() - */ -void SD_init_nocheck(int* argc, char** argv) -{ - xbt_assert(sd_global == nullptr, "SD_init() already called"); - - sd_global = std::make_unique(argc, argv); - - simgrid::config::set_default("host/model", "ptask_L07"); - if (simgrid::config::get_value("debug/clean-atexit")) - atexit([]() { -#if SIMGRID_HAVE_JEDULE - jedule_sd_exit(); -#endif - sd_global->engine_->shutdown(); - }); -} - -/** @brief set a configuration variable - * - * Do --help on any simgrid binary to see the list of currently existing configuration variables, and - * see Section @ref options. - * - * Example: SD_config("host/model","default") - */ -void SD_config(const char* key, const char* value) -{ - xbt_assert(sd_global, "ERROR: Please call SD_init() before using SD_config()"); - simgrid::config::set_as_string(key, value); -} - -/** - * @brief Creates the environment - * - * The environment (i.e. the @ref SD_host_api "hosts" and the @ref SD_link_api "links") is created with - * the data stored in the given XML platform file. - * - * @param platform_file name of an XML file describing the environment to create - * @see SD_host_api, SD_link_api - * - * The XML file follows this DTD: - * - * @include simgrid.dtd - * - * Here is a small example of such a platform: - * - * @include small_platform.xml - */ -void SD_create_environment(const char* platform_file) -{ - sd_global->engine_->load_platform(platform_file); - - XBT_DEBUG("Host number: %zu, link number: %zu", sg_host_count(), sg_link_count()); -#if SIMGRID_HAVE_JEDULE - jedule_sd_init(); -#endif - XBT_VERB("Starting simulation..."); - sd_global->engine_->get_impl()->presolve(); /* Takes traces into account */ -} - -/** - * @brief Launches the simulation. - * - * The function will execute the @ref SD_RUNNABLE runnable tasks. - * If @a how_long is positive, then the simulation will be stopped either when time reaches @a how_long or when a watch - * point is reached. - * A non-positive value for @a how_long means no time limit, in which case the simulation will be stopped either when a - * watch point is reached or when no more task can be executed. - * Then you can call SD_simulate() again. - * - * @param how_long maximum duration of the simulation (a negative value means no time limit) - * @return a dynar of @ref SD_task_t whose state has changed. - * @see SD_task_schedule(), SD_task_watch() - */ -void SD_simulate(double how_long) -{ - simgrid::sd::simulate(how_long); -} - -void SD_simulate_with_update(double how_long, xbt_dynar_t changed_tasks_dynar) -{ - const std::set* changed_tasks = simgrid::sd::simulate(how_long); - for (auto const& task : *changed_tasks) - xbt_dynar_push(changed_tasks_dynar, &task); -} diff --git a/src/simdag/sd_task.cpp b/src/simdag/sd_task.cpp deleted file mode 100644 index 23eb24cd19..0000000000 --- a/src/simdag/sd_task.cpp +++ /dev/null @@ -1,967 +0,0 @@ -/* 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 "simdag_private.hpp" -#include "simgrid/kernel/routing/NetPoint.hpp" -#include "src/surf/HostImpl.hpp" -#include "src/surf/surf_interface.hpp" -#include - -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_task, sd, "Logging specific to SimDag (task)"); - -namespace simgrid { - -template class xbt::Extendable; - -namespace sd { - -Task* Task::create(const std::string& name, double amount, void* userdata) -{ - auto task = new Task(); - task->set_name(name); - task->set_amount(amount); - task->set_data(userdata); - task->allocation_ = new std::vector(); - sd_global->initial_tasks.insert(task); - - return task; -} - -Task* Task::create_comm_e2e(const std::string& name, double amount, void* userdata) -{ - auto task = create(name, amount, userdata); - task->bytes_amount_ = xbt_new0(double, 4); - task->bytes_amount_[2] = amount; - task->set_kind(SD_TASK_COMM_E2E); - - return task; -} - -Task* Task::create_comp_seq(const std::string& name, double amount, void* userdata) -{ - auto task = create(name, amount, userdata); - task->flops_amount_ = xbt_new0(double, 1); - task->flops_amount_[0] = amount; - task->set_kind(SD_TASK_COMP_SEQ); - - return task; -} - -Task* Task::create_comp_par_amdahl(const std::string& name, double amount, void* userdata, double alpha) -{ - xbt_assert(alpha < 1. && alpha >= 0., "Invalid parameter: alpha must be in [0.;1.["); - - auto task = create(name, amount, userdata); - task->set_alpha(alpha); - task->set_kind(SD_TASK_COMP_PAR_AMDAHL); - - return task; -} - -Task* Task::create_comm_par_mxn_1d_block(const std::string& name, double amount, void* userdata) -{ - auto task = create(name, amount, userdata); - task->set_kind(SD_TASK_COMM_PAR_MXN_1D_BLOCK); - - return task; -} - -void Task::distribute_comp_amdahl(unsigned long count) -{ - xbt_assert(kind_ == SD_TASK_COMP_PAR_AMDAHL, - "Task %s is not a SD_TASK_COMP_PAR_AMDAHL typed task." - "Cannot use this function.", - get_cname()); - flops_amount_ = xbt_new0(double, count); - for (unsigned long i = 0; i < count; i++) - flops_amount_[i] = (alpha_ + (1 - alpha_) / count) * amount_; -} - -void Task::build_MxN_1D_block_matrix(unsigned long src_nb, unsigned long dst_nb) -{ - xbt_assert(kind_ == SD_TASK_COMM_PAR_MXN_1D_BLOCK, - "Task %s is not a SD_TASK_COMM_PAR_MXN_1D_BLOCK typed task." - "Cannot use this function.", - get_cname()); - xbt_free(bytes_amount_); - bytes_amount_ = xbt_new0(double, allocation_->size() * allocation_->size()); - - for (unsigned long i = 0; i < src_nb; i++) { - double src_start = i * amount_ / src_nb; - double src_end = src_start + amount_ / src_nb; - for (unsigned long j = 0; j < dst_nb; j++) { - double dst_start = j * amount_ / dst_nb; - double dst_end = dst_start + amount_ / dst_nb; - XBT_VERB("(%lu->%lu): (%.2f, %.2f)-> (%.2f, %.2f)", i, j, src_start, src_end, dst_start, dst_end); - bytes_amount_[i * (src_nb + dst_nb) + src_nb + j] = 0.0; - if ((src_end > dst_start) && (dst_end > src_start)) { /* There is something to send */ - bytes_amount_[i * (src_nb + dst_nb) + src_nb + j] = std::min(src_end, dst_end) - std::max(src_start, dst_start); - XBT_VERB("==> %.2f", bytes_amount_[i * (src_nb + dst_nb) + src_nb + j]); - } - } - } -} - -void Task::dependency_add(Task* task) -{ - if (this == task) - throw std::invalid_argument( - simgrid::xbt::string_printf("Cannot add a dependency between task '%s' and itself", get_cname())); - - if (state_ == SD_DONE || state_ == SD_FAILED) - throw std::invalid_argument(simgrid::xbt::string_printf( - "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, SD_RUNNABLE, or SD_RUNNING", get_cname())); - - if (task->get_state() == SD_DONE || task->get_state() == SD_FAILED || task->get_state() == SD_RUNNING) - throw std::invalid_argument(simgrid::xbt::string_printf( - "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, or SD_RUNNABLE", task->get_cname())); - - if (dependency_exist(task)) - throw std::invalid_argument(simgrid::xbt::string_printf( - "A dependency already exists between task '%s' and task '%s'", get_cname(), task->get_cname())); - - successors_.push_back(task); - task->dependencies_.insert({this}); - - /* if 'task' was runnable, it goes back to the SD_SCHEDULED state because of the new dependency*/ - if (task->get_state() == SD_RUNNABLE) { - XBT_DEBUG("SD_task_dependency_add: %s was runnable and becomes scheduled!", task->get_cname()); - task->set_state(SD_SCHEDULED); - } -} - -bool Task::dependency_exist(Task* task) const -{ - return (std::find(successors_.begin(), successors_.end(), task) != successors_.end() || - dependencies_.find(task) != dependencies_.end()); -} - -void Task::dependency_remove(Task* task) -{ - if (this == task) - throw std::invalid_argument("Cannot ask to remove itself from successors"); - - auto p = std::find(successors_.begin(), successors_.end(), task); - if (p != successors_.end()) { - successors_.erase(p); - task->dependencies_.erase({this}); - } else - throw std::invalid_argument(simgrid::xbt::string_printf( - "No dependency found between task '%s' and '%s': task '%s' is not a successor of task '%s'", get_cname(), - task->get_cname(), task->get_cname(), get_cname())); - - /* if 'task' was scheduled and dependencies are satisfied, we can make it runnable */ - if (task->has_unsolved_dependencies() == 0 && task->get_state() == SD_SCHEDULED) - task->set_state(SD_RUNNABLE); -} - -std::set Task::get_predecessors() const -{ - std::set res; - for (const auto& d : dependencies_) - if (d->get_kind() == SD_TASK_COMP_SEQ || d->get_kind() == SD_TASK_COMP_PAR_AMDAHL) - res.insert(d); - return res; -} - -std::set Task::get_inputs() const -{ - std::set res; - for (const auto& d : dependencies_) - if (d->get_kind() == SD_TASK_COMM_E2E || d->get_kind() == SD_TASK_COMM_PAR_MXN_1D_BLOCK) - res.insert(d); - return res; -} - -std::vector Task::get_outputs() const -{ - std::vector res; - for (const auto& d : successors_) - if (d->get_kind() == SD_TASK_COMM_E2E || d->get_kind() == SD_TASK_COMM_PAR_MXN_1D_BLOCK) - res.push_back(d); - return res; -} - -void Task::set_amount(double amount) -{ - amount_ = amount; - if (kind_ == SD_TASK_COMP_SEQ) - flops_amount_[0] = amount; - if (kind_ == SD_TASK_COMM_E2E) { - bytes_amount_[2] = amount; - } -} - -void Task::set_rate(double rate) -{ - xbt_assert(kind_ == SD_TASK_COMM_E2E, "The rate can be modified for end-to-end communications only."); - if (state_ < SD_RUNNING) { - rate_ = rate; - } else { - XBT_WARN("Task %p has started. Changing rate is ineffective.", this); - } -} - -void Task::set_state(e_SD_task_state_t new_state) -{ - std::set::iterator idx; - XBT_DEBUG("Set state of '%s' to %d", get_cname(), new_state); - if ((new_state == SD_NOT_SCHEDULED || new_state == SD_SCHEDULABLE) && state_ == SD_FAILED) { - sd_global->completed_tasks.erase(this); - sd_global->initial_tasks.insert(this); - } - - if (new_state == SD_SCHEDULED && state_ == SD_RUNNABLE) { - sd_global->initial_tasks.insert(this); - sd_global->runnable_tasks.erase(this); - } - - if (new_state == SD_RUNNABLE) { - idx = sd_global->initial_tasks.find(this); - if (idx != sd_global->initial_tasks.end()) { - sd_global->runnable_tasks.insert(*idx); - sd_global->initial_tasks.erase(idx); - } - } - - if (new_state == SD_RUNNING) - sd_global->runnable_tasks.erase(this); - - if (new_state == SD_DONE || new_state == SD_FAILED) { - sd_global->completed_tasks.insert(this); - start_time_ = surf_action_->get_start_time(); - if (new_state == SD_DONE) { - finish_time_ = surf_action_->get_finish_time(); -#if SIMGRID_HAVE_JEDULE - jedule_log_sd_event(this); -#endif - } else - finish_time_ = simgrid_get_clock(); - surf_action_->unref(); - surf_action_ = nullptr; - allocation_->clear(); - } - - state_ = new_state; - - if (watch_points_ & new_state) { - XBT_VERB("Watch point reached with task '%s'!", get_cname()); - sd_global->watch_point_reached = true; - unwatch(new_state); /* remove the watch point */ - } -} - -double Task::get_remaining_amount() const -{ - if (surf_action_) - return surf_action_->get_remains(); - else - return (state_ == SD_DONE) ? 0 : amount_; -} - -double Task::get_start_time() const -{ - return surf_action_ ? surf_action_->get_start_time() : start_time_; -} - -double Task::get_finish_time() const -{ - if (surf_action_) /* should never happen as actions are destroyed right after their completion */ - return surf_action_->get_finish_time(); - else - return finish_time_; -} - -void Task::set_sender_side_allocation(unsigned long count, const std::vector* sender) -{ - for (unsigned long i = 0; i < count; i++) - allocation_->push_back(sender->at(i)); -} - -void Task::set_receiver_side_allocation(unsigned long count, const std::vector* receiver) -{ - for (unsigned long i = 0; i < count; i++) - allocation_->insert(allocation_->begin() + i, receiver->at(i)); -} - -void Task::watch(e_SD_task_state_t state) -{ - if (state & SD_NOT_SCHEDULED) - throw std::invalid_argument("Cannot add a watch point for state SD_NOT_SCHEDULED"); - - watch_points_ = watch_points_ | state; -} - -void Task::unwatch(e_SD_task_state_t state) -{ - xbt_assert(state != SD_NOT_SCHEDULED, "SimDag error: Cannot have a watch point for state SD_NOT_SCHEDULED"); - watch_points_ = watch_points_ & ~state; -} - -void Task::dump() const -{ - XBT_INFO("Displaying task %s", get_cname()); - if (state_ == SD_RUNNABLE) - XBT_INFO(" - state: runnable"); - else if (state_ < SD_RUNNABLE) - XBT_INFO(" - state: %s not runnable", __get_state_name(state_)); - else - XBT_INFO(" - state: not runnable %s", __get_state_name(state_)); - - if (kind_ != 0) { - switch (kind_) { - case SD_TASK_COMM_E2E: - XBT_INFO(" - kind: end-to-end communication"); - break; - case SD_TASK_COMP_SEQ: - XBT_INFO(" - kind: sequential computation"); - break; - case SD_TASK_COMP_PAR_AMDAHL: - XBT_INFO(" - kind: parallel computation following Amdahl's law"); - break; - case SD_TASK_COMM_PAR_MXN_1D_BLOCK: - XBT_INFO(" - kind: MxN data redistribution assuming 1D block distribution"); - break; - default: - XBT_INFO(" - (unknown kind %d)", kind_); - } - } - - XBT_INFO(" - amount: %.0f", amount_); - if (kind_ == SD_TASK_COMP_PAR_AMDAHL) - XBT_INFO(" - alpha: %.2f", alpha_); - XBT_INFO(" - Dependencies to satisfy: %lu", has_unsolved_dependencies()); - if (has_unsolved_dependencies() > 0) { - XBT_INFO(" - pre-dependencies:"); - for (auto const& it : dependencies_) - XBT_INFO(" %s", it->get_cname()); - } - if (is_waited_by() > 0) { - XBT_INFO(" - post-dependencies:"); - - for (auto const& it : successors_) - XBT_INFO(" %s", it->get_cname()); - } -} - -void Task::released_by(Task* pred) -{ - dependencies_.erase(pred); - XBT_DEBUG("Release dependency on %s: %lu remain(s). Becomes schedulable if %zu=0", get_cname(), - has_unsolved_dependencies(), get_predecessors().size()); - - if (state_ == SD_NOT_SCHEDULED && get_predecessors().empty()) - set_state(SD_SCHEDULABLE); - - if (state_ == SD_SCHEDULED && has_unsolved_dependencies() == 0) - set_state(SD_RUNNABLE); - - if (state_ == SD_RUNNABLE && not sd_global->watch_point_reached) - run(); -} - -void Task::produced_by(Task* pred) -{ - if (state_ == SD_RUNNABLE) - return; - - start_time_ = pred->get_finish_time(); - dependencies_.erase(pred); - if (state_ == SD_SCHEDULED) - set_state(SD_RUNNABLE); - else - set_state(SD_SCHEDULABLE); - - Task* comm_dst = *(successors_.begin()); - if (comm_dst->get_state() == SD_NOT_SCHEDULED && comm_dst->get_predecessors().empty()) { - XBT_DEBUG("%s is a transfer, %s may be ready now if %zu=0", get_cname(), comm_dst->get_cname(), - comm_dst->get_predecessors().size()); - comm_dst->set_state(SD_SCHEDULABLE); - } - if (state_ == SD_RUNNABLE && not sd_global->watch_point_reached) - run(); -} - -void Task::do_schedule() -{ - if (state_ > SD_SCHEDULABLE) - throw std::invalid_argument(simgrid::xbt::string_printf("Task '%s' has already been scheduled", get_cname())); - - if (has_unsolved_dependencies() == 0) - set_state(SD_RUNNABLE); - else - set_state(SD_SCHEDULED); -} - -void Task::schedule(const std::vector& hosts, const double* flops_amount, const double* bytes_amount, - double rate) -{ - unsigned long host_count = hosts.size(); - rate_ = rate; - - if (flops_amount) { - flops_amount_ = static_cast(xbt_realloc(flops_amount_, sizeof(double) * host_count)); - memcpy(flops_amount_, flops_amount, sizeof(double) * host_count); - } else { - xbt_free(flops_amount_); - flops_amount_ = nullptr; - } - - unsigned long communication_nb = host_count * host_count; - if (bytes_amount) { - bytes_amount_ = static_cast(xbt_realloc(bytes_amount_, sizeof(double) * communication_nb)); - memcpy(bytes_amount_, bytes_amount, sizeof(double) * communication_nb); - } else { - xbt_free(bytes_amount_); - bytes_amount_ = nullptr; - } - - for (const auto& h : hosts) - allocation_->push_back(h); - - do_schedule(); -} - -void Task::schedulev(const std::vector& hosts) -{ - xbt_assert(kind_ == SD_TASK_COMP_SEQ || kind_ == SD_TASK_COMP_PAR_AMDAHL, - "Task %s is not typed. Cannot automatically schedule it.", get_cname()); - - for (unsigned long i = 0; i < hosts.size(); i++) - allocation_->push_back(hosts[i]); - - XBT_VERB("Schedule computation task %s on %zu host(s)", get_cname(), allocation_->size()); - - if (kind_ == SD_TASK_COMP_SEQ) { - if (not flops_amount_) { /*This task has failed and is rescheduled. Reset the flops_amount*/ - flops_amount_ = xbt_new0(double, 1); - flops_amount_[0] = amount_; - } - XBT_VERB("It costs %.f flops", flops_amount_[0]); - } - - if (kind_ == SD_TASK_COMP_PAR_AMDAHL) { - distribute_comp_amdahl(hosts.size()); - XBT_VERB("%.f flops will be distributed following Amdahl's Law", flops_amount_[0]); - } - - do_schedule(); - - /* Iterate over all inputs and outputs to say where I am located (and start them if runnable) */ - for (auto const& input : get_inputs()) { - unsigned long src_nb = input->get_allocation_size(); - unsigned long dst_nb = hosts.size(); - if (src_nb == 0) - XBT_VERB("Sender side of '%s' not scheduled. Set receiver side to '%s''s allocation", input->get_cname(), - get_cname()); - input->set_sender_side_allocation(dst_nb, allocation_); - - if (input->get_allocation_size() > allocation_->size()) { - if (kind_ == SD_TASK_COMP_PAR_AMDAHL) - input->build_MxN_1D_block_matrix(src_nb, dst_nb); - - input->do_schedule(); - XBT_VERB("Auto-Schedule Communication task '%s'. Send %.f bytes from %lu hosts to %lu hosts.", input->get_cname(), - input->get_amount(), src_nb, dst_nb); - } - } - - for (auto const& output : get_outputs()) { - unsigned long src_nb = hosts.size(); - unsigned long dst_nb = output->get_allocation_size(); - if (dst_nb == 0) - XBT_VERB("Receiver side of '%s' not scheduled. Set sender side to '%s''s allocation", output->get_cname(), - get_cname()); - output->set_receiver_side_allocation(src_nb, allocation_); - - if (output->get_allocation_size() > allocation_->size()) { - if (kind_ == SD_TASK_COMP_PAR_AMDAHL) - output->build_MxN_1D_block_matrix(src_nb, dst_nb); - - output->do_schedule(); - XBT_VERB("Auto-Schedule Communication task %s. Send %.f bytes from %lu hosts to %lu hosts.", output->get_cname(), - output->get_amount(), src_nb, dst_nb); - } - } -} - -void Task::unschedule() -{ - if (state_ == SD_NOT_SCHEDULED || state_ == SD_SCHEDULABLE) - throw std::invalid_argument(xbt::string_printf( - "Task %s: the state must be SD_SCHEDULED, SD_RUNNABLE, SD_RUNNING or SD_FAILED", get_cname())); - - if (state_ == SD_SCHEDULED || state_ == SD_RUNNABLE) /* if the task is scheduled or runnable */ { - allocation_->clear(); - if (kind_ == SD_TASK_COMP_PAR_AMDAHL || kind_ == SD_TASK_COMM_PAR_MXN_1D_BLOCK) { - /* Don't free scheduling data for typed tasks */ - xbt_free(flops_amount_); - xbt_free(bytes_amount_); - bytes_amount_ = nullptr; - flops_amount_ = nullptr; - } - } - - if (state_ == SD_RUNNING) - /* the task should become SD_FAILED */ - surf_action_->cancel(); - else { - if (has_unsolved_dependencies() == 0) - set_state(SD_SCHEDULABLE); - else - set_state(SD_NOT_SCHEDULED); - } - start_time_ = -1.0; -} - -void Task::run() -{ - xbt_assert(state_ == SD_RUNNABLE, "Task '%s' is not runnable! Task state: %d", get_cname(), (int)state_); - xbt_assert(not allocation_->empty(), "Task '%s': host_list is empty!", get_cname()); - - XBT_VERB("Executing task '%s'", get_cname()); - - /* Beware! The scheduling data are now used by the surf action directly! no copy was done */ - auto host_model = allocation_->front()->get_netpoint()->get_englobing_zone()->get_host_model(); - surf_action_ = host_model->execute_parallel(*allocation_, flops_amount_, bytes_amount_, rate_); - - surf_action_->set_data(this); - - XBT_DEBUG("surf_action = %p", surf_action_); - - set_state(SD_RUNNING); - sd_global->return_set.insert(this); -} - -void Task::destroy() -{ - XBT_DEBUG("Destroying task %s...", get_cname()); - - /* First Remove all dependencies associated with the task. */ - while (not dependencies_.empty()) - (*(dependencies_.begin()))->dependency_remove(this); - while (not successors_.empty()) - this->dependency_remove(successors_.front()); - - if (state_ == SD_SCHEDULED || state_ == SD_RUNNABLE) { - xbt_free(flops_amount_); - xbt_free(bytes_amount_); - bytes_amount_ = nullptr; - flops_amount_ = nullptr; - } - - xbt_free(flops_amount_); - xbt_free(bytes_amount_); - - delete allocation_; - - if (surf_action_ != nullptr) - surf_action_->unref(); - - XBT_DEBUG("Task destroyed."); - delete this; -} -} // namespace sd -} // namespace simgrid - -/* **************************** Public C interface *************************** */ - -/** - * @brief Creates a new task. - * - * @param name the name of the task (can be @c nullptr) - * @param data the user data you want to associate with the task (can be @c nullptr) - * @param amount amount of the task - * @return the new task - * @see SD_task_destroy() - */ -SD_task_t SD_task_create(const char* name, void* data, double amount) -{ - return simgrid::sd::Task::create(name, amount, data); -} - -/** @brief create an end-to-end communication task that can then be auto-scheduled - * - * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at - * creation, and decouple them from the scheduling process where you just specify which resource should deliver the - * mandatory power. - * - * A end-to-end communication must be scheduled on 2 hosts, and the amount specified at creation is sent from hosts[0] - * to hosts[1]. - */ -SD_task_t SD_task_create_comm_e2e(const char* name, void* data, double amount) -{ - return simgrid::sd::Task::create_comm_e2e(name, amount, data); -} - -/** @brief create a sequential computation task that can then be auto-scheduled - * - * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at - * creation, and decouple them from the scheduling process where you just specify which resource should deliver the - * mandatory power. - * - * A sequential computation must be scheduled on 1 host, and the amount specified at creation to be run on hosts[0]. - * - * @param name the name of the task (can be @c nullptr) - * @param data the user data you want to associate with the task (can be @c nullptr) - * @param flops_amount amount of compute work to be done by the task - * @return the new SD_TASK_COMP_SEQ typed task - */ -SD_task_t SD_task_create_comp_seq(const char* name, void* data, double flops_amount) -{ - return simgrid::sd::Task::create_comp_seq(name, flops_amount, data); -} - -/** @brief create a parallel computation task that can then be auto-scheduled - * - * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at - * creation, and decouple them from the scheduling process where you just specify which resource should deliver the - * mandatory power. - * - * A parallel computation can be scheduled on any number of host. - * The underlying speedup model is Amdahl's law. - * To be auto-scheduled, @see SD_task_distribute_comp_amdahl has to be called first. - * @param name the name of the task (can be @c nullptr) - * @param data the user data you want to associate with the task (can be @c nullptr) - * @param flops_amount amount of compute work to be done by the task - * @param alpha purely serial fraction of the work to be done (in [0.;1.[) - * @return the new task - */ -SD_task_t SD_task_create_comp_par_amdahl(const char* name, void* data, double flops_amount, double alpha) -{ - return simgrid::sd::Task::create_comp_par_amdahl(name, flops_amount, data, alpha); -} - -/** @brief create a complex data redistribution task that can then be auto-scheduled - * - * Auto-scheduling mean that the task can be used with SD_task_schedulev(). - * This allows one to specify the task costs at creation, and decouple them from the scheduling process where you just - * specify which resource should communicate. - * - * A data redistribution can be scheduled on any number of host. - * The assumed distribution is a 1D block distribution. Each host owns the same share of the @see amount. - * To be auto-scheduled, @see SD_task_distribute_comm_mxn_1d_block has to be called first. - * @param name the name of the task (can be @c nullptr) - * @param data the user data you want to associate with the task (can be @c nullptr) - * @param amount amount of data to redistribute by the task - * @return the new task - */ -SD_task_t SD_task_create_comm_par_mxn_1d_block(const char* name, void* data, double amount) -{ - return simgrid::sd::Task::create_comm_par_mxn_1d_block(name, amount, data); -} - -/** - * @brief Destroys a task. - * - * The user data (if any) should have been destroyed first. - * - * @param task the task you want to destroy - * @see SD_task_create() - */ -void SD_task_destroy(SD_task_t task) -{ - task->destroy(); -} - -/** @brief Returns the user data of a task */ -void* SD_task_get_data(const_SD_task_t task) -{ - return task->get_data(); -} - -/** @brief Sets the user data of a task - * The new data can be @c nullptr. The old data should have been freed first, if it was not @c nullptr. - */ -void SD_task_set_data(SD_task_t task, void* data) -{ - task->set_data(data); -} - -void SD_task_set_rate(SD_task_t task, double rate) -{ - task->set_rate(rate); -} - -/** - * @brief Returns the state of a task - * - * @param task a task - * @return the current @ref e_SD_task_state_t "state" of this task: - * #SD_NOT_SCHEDULED, #SD_SCHEDULED, #SD_RUNNABLE, #SD_RUNNING, #SD_DONE or #SD_FAILED - * @see e_SD_task_state_t - */ -e_SD_task_state_t SD_task_get_state(const_SD_task_t task) -{ - return task->get_state(); -} - -const char* SD_task_get_name(const_SD_task_t task) -{ - return task->get_cname(); -} - -void SD_task_set_name(SD_task_t task, const char* name) -{ - task->set_name(name); -} - -/** @brief Returns the parents of a task ina dynar */ -xbt_dynar_t SD_task_get_parents(const_SD_task_t task) -{ - xbt_dynar_t parents = xbt_dynar_new(sizeof(SD_task_t), nullptr); - - for (auto const& it : task->get_dependencies()) - xbt_dynar_push(parents, &it); - - return parents; -} - -/** @brief Returns the children of a task in a dynar */ -xbt_dynar_t SD_task_get_children(const_SD_task_t task) -{ - xbt_dynar_t children = xbt_dynar_new(sizeof(SD_task_t), nullptr); - - for (auto const& it : task->get_successors()) - xbt_dynar_push(children, &it); - - return children; -} - -double SD_task_get_start_time(const_SD_task_t task) -{ - return task->get_start_time(); -} - -double SD_task_get_finish_time(const_SD_task_t task) -{ - return task->get_finish_time(); -} - -void SD_task_distribute_comp_amdahl(SD_task_t task, int count) -{ - task->distribute_comp_amdahl(count); -} - -void SD_task_build_MxN_1D_block_matrix(SD_task_t task, int src_nb, int dst_nb) -{ - task->build_MxN_1D_block_matrix(src_nb, dst_nb); -} - -/** - * @brief Returns the number of workstations involved in a task - * - * Only call this on already scheduled tasks! - * @param task a task - */ -int SD_task_get_workstation_count(const_SD_task_t task) -{ - return static_cast(task->get_allocation_size()); -} - -/** - * @brief Returns the list of workstations involved in a task - * - * Only call this on already scheduled tasks! - * @param task a task - */ -sg_host_t* SD_task_get_workstation_list(const_SD_task_t task) -{ - return task->get_allocation()->data(); -} - -/** - * @brief Returns the total amount of work contained in a task - * - * @param task a task - * @return the total amount of work (computation or data transfer) for this task - * @see SD_task_get_remaining_amount() - */ -double SD_task_get_amount(const_SD_task_t task) -{ - return task->get_amount(); -} - -void SD_task_set_amount(SD_task_t task, double amount) -{ - task->set_amount(amount); -} - -double SD_task_get_remaining_amount(const_SD_task_t task) -{ - return task->get_remaining_amount(); -} - -e_SD_task_kind_t SD_task_get_kind(const_SD_task_t task) -{ - return task->get_kind(); -} - -void SD_task_dump(const_SD_task_t task) -{ - task->dump(); -} - -void SD_task_dependency_add(SD_task_t src, SD_task_t dst) -{ - XBT_DEBUG("SD_task_dependency_add: src = %s, dst = %s", src->get_cname(), dst->get_cname()); - src->dependency_add(dst); -} -void SD_task_dependency_remove(SD_task_t src, SD_task_t dst) -{ - XBT_DEBUG("SD_task_dependency_remove: src = %s, dst = %s", src->get_cname(), dst->get_cname()); - src->dependency_remove(dst); -} - -/** - * @brief Indicates whether there is a dependency between two tasks. - * If src is nullptr, checks whether dst has any pre-dependency. - * If dst is nullptr, checks whether src has any post-dependency. - */ -int SD_task_dependency_exists(const_SD_task_t src, SD_task_t dst) -{ - xbt_assert(src != nullptr || dst != nullptr, "Invalid parameter: both src and dst are nullptr"); - - if (src) - if (dst) - return src->dependency_exist(dst); - else - return static_cast(src->is_waited_by()); - else - return static_cast(dst->has_unsolved_dependencies()); -} - -void SD_task_watch(SD_task_t task, e_SD_task_state_t state) -{ - task->watch(state); -} - -void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state) -{ - task->unwatch(state); -} - -/** @brief Dumps the task in dotty formalism into the FILE* passed as second argument */ -void SD_task_dotty(const_SD_task_t task, void* out) -{ - auto* fout = static_cast(out); - fprintf(fout, " T%p [label=\"%.20s\"", task, task->get_cname()); - switch (task->get_kind()) { - case SD_TASK_COMM_E2E: - case SD_TASK_COMM_PAR_MXN_1D_BLOCK: - fprintf(fout, ", shape=box"); - break; - case SD_TASK_COMP_SEQ: - case SD_TASK_COMP_PAR_AMDAHL: - fprintf(fout, ", shape=circle"); - break; - default: - xbt_die("Unknown task type!"); - } - fprintf(fout, "];\n"); - for (auto const& it : task->get_dependencies()) - fprintf(fout, " T%p -> T%p;\n", it, task); -} - -/** - * @brief Returns an approximative estimation of the execution time of a task. - * - * The estimation is very approximative because the value returned is the time the task would take if it was executed - * now and if it was the only task. - * - * @param host_count number of hosts on which the task would be executed - * @param host_list the hosts on which the task would be executed - * @param flops_amount computation amount for each host(i.e., an array of host_count doubles) - * @param bytes_amount communication amount between each pair of hosts (i.e., a matrix of host_count*host_count doubles) - * @see SD_schedule() - */ -double SD_task_get_execution_time(const_SD_task_t /*task*/, int host_count, const sg_host_t* host_list, - const double* flops_amount, const double* bytes_amount) -{ - xbt_assert(host_count > 0, "Invalid parameter"); - double max_time = 0.0; - - /* the task execution time is the maximum execution time of the parallel tasks */ - for (int i = 0; i < host_count; i++) { - double time = 0.0; - if (flops_amount != nullptr) - time = flops_amount[i] / host_list[i]->get_speed(); - - if (bytes_amount != nullptr) - for (int j = 0; j < host_count; j++) - if (bytes_amount[i * host_count + j] != 0) - time += (sg_host_get_route_latency(host_list[i], host_list[j]) + - bytes_amount[i * host_count + j] / sg_host_get_route_bandwidth(host_list[i], host_list[j])); - - if (time > max_time) - max_time = time; - } - return max_time; -} - -/** - * @brief Schedules a task - * - * The task state must be #SD_NOT_SCHEDULED. - * Once scheduled, a task is executed as soon as possible in @see SD_simulate, i.e. when its dependencies are satisfied. - * - * @param task the task you want to schedule - * @param host_count number of hosts on which the task will be executed - * @param host_list the hosts on which the task will be executed - * @param flops_amount computation amount for each hosts (i.e., an array of host_count doubles) - * @param bytes_amount communication amount between each pair of hosts (i.e., a matrix of host_count*host_count doubles) - * @param rate task execution speed rate - * @see SD_task_unschedule() - */ -void SD_task_schedule(SD_task_t task, int host_count, const sg_host_t* host_list, const double* flops_amount, - const double* bytes_amount, double rate) -{ - xbt_assert(host_count > 0, "host_count must be positive"); - std::vector hosts(host_count); - - for (int i = 0; i < host_count; i++) - hosts[i] = host_list[i]; - - task->schedule(hosts, flops_amount, bytes_amount, rate); -} - -void SD_task_unschedule(SD_task_t task) -{ - task->unschedule(); -} - -/** @brief Auto-schedules a task. - * - * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at - * creation, and decouple them from the scheduling process where you just specify which resource should deliver the - * mandatory power. - * - * To be auto-schedulable, a task must be a typed computation SD_TASK_COMP_SEQ or SD_TASK_COMP_PAR_AMDAHL. - */ -void SD_task_schedulev(SD_task_t task, int count, const sg_host_t* host_list) -{ - std::vector list(count); - for (int i = 0; i < count; i++) - list[i] = host_list[i]; - task->schedulev(list); -} - -/** @brief autoschedule a task on a list of hosts - * - * This function is similar to SD_task_schedulev(), but takes the list of hosts to schedule onto as separate parameters. - * It builds a proper vector of hosts and then call SD_task_schedulev() - */ -void SD_task_schedulel(SD_task_t task, int count, ...) -{ - va_list ap; - std::vector list(count); - va_start(ap, count); - for (int i = 0; i < count; i++) - list[i] = va_arg(ap, sg_host_t); - - va_end(ap); - task->schedulev(list); -} diff --git a/src/simdag/simdag_private.hpp b/src/simdag/simdag_private.hpp index 5a19542891..5208fe3ca5 100644 --- a/src/simdag/simdag_private.hpp +++ b/src/simdag/simdag_private.hpp @@ -5,7 +5,6 @@ #include #include -#include #include #include @@ -14,164 +13,5 @@ #ifndef SIMDAG_PRIVATE_HPP #define SIMDAG_PRIVATE_HPP -#if SIMGRID_HAVE_JEDULE -#include "simgrid/jedule/jedule_sd_binding.h" -#endif - -namespace simgrid{ -extern template class XBT_PUBLIC xbt::Extendable; - -namespace sd{ -class Global; - -class Task : public xbt::Extendable { - friend sd::Global; - - std::string name_; - double amount_; - - e_SD_task_kind_t kind_ = SD_TASK_NOT_TYPED; - e_SD_task_state_t state_ = SD_NOT_SCHEDULED; - bool marked_ = false; /* used to check if the task DAG has some cycle*/ - double start_time_ = -1; - double finish_time_ = -1; - kernel::resource::Action* surf_action_; - unsigned short watch_points_ = 0; /* bit field xor()ed with masks */ - double rate_ = -1; - - double alpha_ = 0; /* used by typed parallel tasks */ - - /* dependencies */ - std::set dependencies_; - std::vector successors_; - - /* scheduling parameters (only exist in state SD_SCHEDULED) */ - std::vector* allocation_; - double* flops_amount_; - double* bytes_amount_; - -protected: - void set_start_time(double start) { start_time_ = start; } - - void set_sender_side_allocation(unsigned long count, const std::vector* sender); - void set_receiver_side_allocation(unsigned long count, const std::vector* receiver); - -public: - static Task* create(const std::string& name, double amount, void* userdata); - static Task* create_comm_e2e(const std::string& name, double amount, void* userdata); - static Task* create_comp_seq(const std::string& name, double amount, void* userdata); - static Task* create_comp_par_amdahl(const std::string& name, double amount, void* userdata, double alpha); - static Task* create_comm_par_mxn_1d_block(const std::string& name, double amount, void* userdata); - - void distribute_comp_amdahl(unsigned long count); - void build_MxN_1D_block_matrix(unsigned long src_nb, unsigned long dst_nb); - - /** @brief Adds a dependency between with 'task' - * @a task will depend on this Task, i.e., it cannot start before this task is finished. - */ - void dependency_add(Task* task); - bool dependency_exist(Task* task) const; - /** @brief Remove a dependency with 'task' */ - void dependency_remove(Task* task); - void clear_successors() { successors_.clear(); } - - void set_name(const std::string& name) { name_ = name; } - const std::string& get_name() const { return name_; } - const char* get_cname() const { return name_.c_str(); } - - /** @brief Sets the total amount of work of a task - * For sequential typed tasks (COMP_SEQ and COMM_E2E), it also sets the appropriate values in the flops_amount and - * bytes_amount arrays respectively. Nothing more than modifying task->amount is done for parallel typed tasks - * (COMP_PAR_AMDAHL and COMM_PAR_MXN_1D_BLOCK) as the distribution of the amount of work is done at scheduling time. - */ - void set_amount(double amount); - double get_amount() const { return amount_; } - /** @brief Returns the remaining amount of work (computation or data transfer) to do before completion */ - double get_remaining_amount() const; - /** @brief Returns the start time of a task */ - double get_start_time() const; - /** @brief Returns the finish time of a task - * If the state is not completed yet, the returned value is an estimation of the task finish time. This value can - * vary until the task is completed. - */ - double get_finish_time() const; - - void set_state(e_SD_task_state_t new_state); - e_SD_task_state_t get_state() const { return state_; } - - void mark() { marked_ = true; } - void unmark() { marked_ = false; } - bool is_marked() const { return marked_; } - - const std::set& get_dependencies() const { return dependencies_; } - std::set get_predecessors() const; - std::set get_inputs() const; - const std::vector& get_successors() const { return successors_; } - std::vector get_outputs() const; - - unsigned long has_unsolved_dependencies() const { return dependencies_.size(); } - unsigned long is_waited_by() const { return successors_.size(); } - void released_by(Task* pred); - void produced_by(Task* pred); - - void set_kind(e_SD_task_kind_t kind) { kind_ = kind; } - e_SD_task_kind_t get_kind() const { return kind_; } - - void set_alpha(double alpha) { alpha_ = alpha; } - /** @brief Sets the rate of a task - * - * This will change the network bandwidth a task can use. This rate cannot be dynamically changed. Once the task has - * started, this call is ineffective. This rate depends on both the nominal bandwidth on the route onto which the task - * is scheduled (@see SD_task_get_current_bandwidth) and the amount of data to transfer. - * - * To divide the nominal bandwidth by 2, the rate then has to be : - * rate = bandwidth/(2*amount) - */ - void set_rate(double rate); - - unsigned long get_allocation_size() const { return allocation_->size(); } - std::vector* get_allocation() const { return allocation_; } - - /** @brief Adds a watch point to a task - * sd::simulate() stops as soon as the @ref e_SD_task_state_t "state" of this task becomes the one given as argument. - * The watched state cannot be #SD_NOT_SCHEDULED - */ - void watch(e_SD_task_state_t state); - /** @brief Removes a watch point on 'state' from a task */ - void unwatch(e_SD_task_state_t state); - - /** @brief Displays debugging information about a task */ - void dump() const; - - void do_schedule(); - void schedule(const std::vector& hosts, const double* flops_amount, const double* bytes_amount, - double rate); - void schedulev(const std::vector& hosts); - /** - * @brief Unschedules a task. Its state becomes #SD_NOT_SCHEDULED. You can schedule it again afterwards */ - void unschedule(); - - void run(); - void destroy(); -}; - -class Global { -public: - explicit Global(int* argc, char** argv) : engine_(new simgrid::s4u::Engine(argc, argv)) {} - bool watch_point_reached = false; /* has a task just reached a watch point? */ - std::set initial_tasks; - std::set runnable_tasks; - std::set completed_tasks; - std::set return_set; - s4u::Engine* engine_; -}; - -} // namespace sd -} // namespace simgrid - -extern XBT_PRIVATE std::unique_ptr sd_global; - -/* SimDag private functions */ XBT_PRIVATE bool check_for_cycle(const std::vector& dag); -XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state); #endif diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 9669d1c132..1924341eac 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -473,8 +473,6 @@ set(MSG_SRC set(SIMDAG_SRC src/simdag/sd_daxloader.cpp src/simdag/sd_dotloader.cpp - src/simdag/sd_global.cpp - src/simdag/sd_task.cpp ) set(BINDINGS_SRC @@ -563,17 +561,6 @@ set(TRACING_SRC src/instr/instr_resource_utilization.cpp ) -set(JEDULE_SRC - include/simgrid/jedule/jedule_events.hpp - include/simgrid/jedule/jedule.hpp - include/simgrid/jedule/jedule_platform.hpp - include/simgrid/jedule/jedule_sd_binding.h - src/instr/jedule/jedule_events.cpp - src/instr/jedule/jedule.cpp - src/instr/jedule/jedule_platform.cpp - src/instr/jedule/jedule_sd_binding.cpp - ) - set(MC_SRC_BASE src/mc/mc_base.cpp src/mc/mc_base.hpp @@ -682,7 +669,6 @@ set(headers_to_install include/simgrid/plugins/ProducerConsumer.hpp include/simgrid/instr.h include/simgrid/mailbox.h - include/simgrid/simdag.h include/simgrid/modelchecker.h include/simgrid/forward.h include/simgrid/simix.h diff --git a/tools/cmake/Option.cmake b/tools/cmake/Option.cmake index 84bb93eb09..fe18f65c72 100644 --- a/tools/cmake/Option.cmake +++ b/tools/cmake/Option.cmake @@ -41,8 +41,6 @@ if(enable-model-checking) SET(enable_model-checking ON CACHE BOOL "Whether to compile the model-checker" FORCE) endif() -option(enable_jedule "Jedule output of SimDAG." off) - if(WIN32) option(enable_smpi "Whether SMPI is included in the library." off) else() diff --git a/tools/jenkins/Coverage.sh b/tools/jenkins/Coverage.sh index 4a5d0f4459..4e973345af 100755 --- a/tools/jenkins/Coverage.sh +++ b/tools/jenkins/Coverage.sh @@ -68,7 +68,7 @@ ctest -D ExperimentalStart || true cmake -Denable_documentation=OFF -Denable_lua=ON \ -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ - -Denable_jedule=ON -Denable_mallocators=ON \ + -Denable_mallocators=ON \ -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=ON \ -Denable_smpi_papi=ON \ -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON \ diff --git a/tools/jenkins/DynamicAnalysis.sh b/tools/jenkins/DynamicAnalysis.sh index 05e6a49415..abe1c1bac5 100755 --- a/tools/jenkins/DynamicAnalysis.sh +++ b/tools/jenkins/DynamicAnalysis.sh @@ -63,7 +63,7 @@ ctest -D ExperimentalStart || true cmake -Denable_documentation=OFF -Denable_lua=OFF -Denable_python=OFF \ -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ - -Denable_jedule=OFF -Denable_mallocators=OFF \ + -Denable_mallocators=OFF \ -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_model-checking=OFF \ -Denable_memcheck_xml=ON -DLTO_EXTRA_FLAG="auto" "$WORKSPACE" diff --git a/tools/jenkins/Flags.sh b/tools/jenkins/Flags.sh index cbc23d4c34..aae4c308f9 100755 --- a/tools/jenkins/Flags.sh +++ b/tools/jenkins/Flags.sh @@ -88,7 +88,7 @@ fi echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}, MSG=${buildmsg}" cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} -Denable_msg=${buildmsg} \ -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ - -Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \ + -Denable_mallocators=ON -Denable_debug=${builddebug} \ -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \ -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=OFF \ -Denable_ns3=$(onoff test "$buildmc" != "ON") -Denable_coverage=OFF -DLTO_EXTRA_FLAG="auto" "$WORKSPACE" diff --git a/tools/jenkins/Sanitizers.sh b/tools/jenkins/Sanitizers.sh index 5425f603ae..8c2569b065 100755 --- a/tools/jenkins/Sanitizers.sh +++ b/tools/jenkins/Sanitizers.sh @@ -76,7 +76,7 @@ ctest -D ExperimentalStart || true cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \ -Denable_compile_optimizations=ON -Denable_compile_warnings=ON \ - -Denable_jedule=ON -Denable_mallocators=OFF \ + -Denable_mallocators=OFF \ -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=OFF \ -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF\ -Denable_fortran=OFF -Denable_python=OFF -DLTO_EXTRA_FLAG="auto" ${SANITIZER_OPTIONS} "$WORKSPACE" diff --git a/tools/jenkins/build.sh b/tools/jenkins/build.sh index 7cffc16dd9..28ee7c0131 100755 --- a/tools/jenkins/build.sh +++ b/tools/jenkins/build.sh @@ -208,7 +208,7 @@ cmake -G"$GENERATOR" ${INSTALL:+-DCMAKE_INSTALL_PREFIX=$INSTALL} \ -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \ -Denable_compile_warnings=$(onoff test "$GENERATOR" != "MSYS Makefiles") -Denable_smpi=ON \ -Denable_ns3=$(onoff test "$have_NS3" = "yes" -a "$build_mode" = "Debug") \ - -Denable_jedule=OFF -Denable_lua=OFF ${MAY_DISABLE_SOURCE_CHANGE} ${MAY_DISABLE_LTO} \ + -Denable_lua=OFF ${MAY_DISABLE_SOURCE_CHANGE} ${MAY_DISABLE_LTO} \ -Denable_java=$(onoff test "$build_mode" = "ModelChecker") \ -Denable_msg=$(onoff test "$build_mode" = "ModelChecker") \ -DLTO_EXTRA_FLAG="auto" \