From: Martin Quinson Date: Sat, 18 Feb 2023 19:10:28 +0000 (+0100) Subject: Merge branch 'master' of framagit.org:simgrid/simgrid X-Git-Tag: v3.34~498 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4e68c6fc1ff039dd2cea2688981f4c19919874d4?hp=3f584ad9bef1ffdb69f38f7537a4524b8a590604 Merge branch 'master' of framagit.org:simgrid/simgrid --- diff --git a/.gitignore b/.gitignore index 6f53812238..c4b7ab787b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,7 @@ CTestResults.xml ### Maintainer mode src/dag/dax_dtd.l -src/surf/xml/simgrid_dtd.l +src/kernel/xml/simgrid_dtd.l ### Libraries links [Ss]im[Gg]rid-*.tar.gz ### Generated files @@ -841,10 +841,10 @@ teshsuite/smpi/type-hvector/type-hvector teshsuite/smpi/type-indexed/type-indexed teshsuite/smpi/type-struct/type-struct teshsuite/smpi/type-vector/type-vector -teshsuite/surf/lmm_usage/lmm_usage -teshsuite/surf/maxmin_bench/maxmin_bench -teshsuite/surf/surf_usage/surf_usage -teshsuite/surf/surf_usage2/surf_usage2 +teshsuite/models/lmm_usage/lmm_usage +teshsuite/models/maxmin_bench/maxmin_bench +teshsuite/models/core_usage/core_usage +teshsuite/models/core_usage2/core_usage2 teshsuite/xbt/cmdline/cmdline teshsuite/xbt/log_large/log_large teshsuite/xbt/log_usage/log_usage diff --git a/COPYING b/COPYING index 51835866d8..220071217c 100644 --- a/COPYING +++ b/COPYING @@ -67,8 +67,8 @@ License: other Files: src/dag/dax_dtd.c src/dag/dax_dtd.h - src/surf/xml/simgrid_dtd.c - src/surf/xml/simgrid_dtd.h + src/kernel/xml/simgrid_dtd.c + src/kernel/xml/simgrid_dtd.h Copyright: FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. FleXML is Copyright (C) 2003-2013 Martin Quinson. All rights reserved. diff --git a/MANIFEST.in b/MANIFEST.in index 47e097be08..ca7deaa6ec 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -628,8 +628,18 @@ include teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.cpp include teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.tesh include teshsuite/models/cm02-tcpgamma/cm02-tcpgamma.cpp include teshsuite/models/cm02-tcpgamma/cm02-tcpgamma.tesh +include teshsuite/models/core_usage/core_usage.cpp +include teshsuite/models/core_usage/core_usage.tesh +include teshsuite/models/core_usage2/core_usage2.cpp +include teshsuite/models/core_usage2/core_usage2.tesh include teshsuite/models/issue105/issue105.cpp include teshsuite/models/issue105/issue105.tesh +include teshsuite/models/lmm_usage/lmm_usage.cpp +include teshsuite/models/lmm_usage/lmm_usage.tesh +include teshsuite/models/maxmin_bench/maxmin_bench.cpp +include teshsuite/models/maxmin_bench/maxmin_bench_large.tesh +include teshsuite/models/maxmin_bench/maxmin_bench_medium.tesh +include teshsuite/models/maxmin_bench/maxmin_bench_small.tesh include teshsuite/models/ptask-subflows/ptask-subflows.cpp include teshsuite/models/ptask-subflows/ptask-subflows.tesh include teshsuite/models/ptask_L07_usage/ptask_L07_usage.cpp @@ -1545,16 +1555,6 @@ include teshsuite/smpi/type-struct/type-struct.c include teshsuite/smpi/type-struct/type-struct.tesh include teshsuite/smpi/type-vector/type-vector.c include teshsuite/smpi/type-vector/type-vector.tesh -include teshsuite/surf/lmm_usage/lmm_usage.cpp -include teshsuite/surf/lmm_usage/lmm_usage.tesh -include teshsuite/surf/maxmin_bench/maxmin_bench.cpp -include teshsuite/surf/maxmin_bench/maxmin_bench_large.tesh -include teshsuite/surf/maxmin_bench/maxmin_bench_medium.tesh -include teshsuite/surf/maxmin_bench/maxmin_bench_small.tesh -include teshsuite/surf/surf_usage/surf_usage.cpp -include teshsuite/surf/surf_usage/surf_usage.tesh -include teshsuite/surf/surf_usage2/surf_usage2.cpp -include teshsuite/surf/surf_usage2/surf_usage2.tesh include teshsuite/xbt/cmdline/cmdline.c include teshsuite/xbt/cmdline/cmdline.tesh include teshsuite/xbt/log_large/log_large.c @@ -1969,6 +1969,7 @@ include src/dag/loaders.cpp include src/include/catch.hpp include src/include/mc/datatypes.h include src/include/mc/mc.h +include src/include/simgrid/math_utils.h include src/include/simgrid/sg_config.hpp include src/include/xbt/coverage.h include src/include/xbt/mmalloc.h @@ -2089,6 +2090,8 @@ include src/kernel/resource/models/network_ib.cpp include src/kernel/resource/models/network_ib.hpp include src/kernel/resource/models/network_ns3.cpp include src/kernel/resource/models/network_ns3.hpp +include src/kernel/resource/models/ns3/ns3_simulator.cpp +include src/kernel/resource/models/ns3/ns3_simulator.hpp include src/kernel/resource/models/ptask_L07.cpp include src/kernel/resource/models/ptask_L07.hpp include src/kernel/resource/profile/Event.hpp @@ -2123,6 +2126,14 @@ include src/kernel/routing/TorusZone_test.cpp include src/kernel/routing/VivaldiZone.cpp include src/kernel/routing/WifiZone.cpp include src/kernel/timer/Timer.cpp +include src/kernel/xml/platf.hpp +include src/kernel/xml/platf_private.hpp +include src/kernel/xml/sg_platf.cpp +include src/kernel/xml/simgrid.dtd +include src/kernel/xml/simgrid_dtd.c +include src/kernel/xml/simgrid_dtd.h +include src/kernel/xml/surfxml_parseplatf.cpp +include src/kernel/xml/surfxml_sax_cb.cpp include src/mc/AddressSpace.hpp include src/mc/ModelChecker.cpp include src/mc/ModelChecker.hpp @@ -2433,17 +2444,7 @@ include src/smpi/smpitools.sh include src/sthread/sthread.c include src/sthread/sthread.h include src/sthread/sthread_impl.cpp -include src/surf/ns3/ns3_simulator.cpp -include src/surf/ns3/ns3_simulator.hpp -include src/surf/sg_platf.cpp include src/surf/surf_interface.hpp -include src/surf/xml/platf.hpp -include src/surf/xml/platf_private.hpp -include src/surf/xml/simgrid.dtd -include src/surf/xml/simgrid_dtd.c -include src/surf/xml/simgrid_dtd.h -include src/surf/xml/surfxml_parseplatf.cpp -include src/surf/xml/surfxml_sax_cb.cpp include src/xbt/OsSemaphore.hpp include src/xbt/PropertyHolder.cpp include src/xbt/automaton/automaton.c @@ -2541,7 +2542,6 @@ include teshsuite/smpi/mpich3-test/perf/CMakeLists.txt include teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt include teshsuite/smpi/mpich3-test/rma/CMakeLists.txt include teshsuite/smpi/mpich3-test/topo/CMakeLists.txt -include teshsuite/surf/CMakeLists.txt include teshsuite/xbt/CMakeLists.txt include tools/CMakeLists.txt include tools/cmake/CTestConfig.cmake diff --git a/docs/source/tuto_network_calibration/network_calibration_tutorial.ipynb b/docs/source/tuto_network_calibration/network_calibration_tutorial.ipynb index bac5f7507d..8f7ebf2414 100644 --- a/docs/source/tuto_network_calibration/network_calibration_tutorial.ipynb +++ b/docs/source/tuto_network_calibration/network_calibration_tutorial.ipynb @@ -10154,7 +10154,7 @@ "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/privatization' to '1'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/np' to '2'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/hostfile' to '/tmp/host.txt'\n", - "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9'\n", + "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'precision/timing' to '1e-9'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/simulate-computation' to '0'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/display-timing' to 'yes'\n", @@ -10246,7 +10246,7 @@ "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/privatization' to '1'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/np' to '2'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/hostfile' to '/tmp/host.txt'\n", - "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9'\n", + "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'precision/timing' to '1e-9'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/simulate-computation' to '0'\n", "[0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/display-timing' to 'yes'\n", diff --git a/examples/c/platform-failures/platform-failures.tesh b/examples/c/platform-failures/platform-failures.tesh index 54fae56b0e..74e5c71d88 100644 --- a/examples/c/platform-failures/platform-failures.tesh +++ b/examples/c/platform-failures/platform-failures.tesh @@ -214,7 +214,7 @@ p NOT testing the mixture of failures and CpuTI: p This test leads to a deadlock because of a bug somewhere in EngineImpl::solve. p We should debug this instead of ignoring the issue, but it's utterly p complex with such an integration test. One day, we will setup a set of -p unit tests for the surf solver, and such issues will be addressable again. +p unit tests for the model's solver, and such issues will be addressable again. p For the time being, I just give up, sorry. p $ ${bindir:=.}/c-platform-failures --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/../../cpp/platform-failures/s4u-platform-failures_d.xml --cfg=path:${srcdir} --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" --log=res_cpu.t:verbose diff --git a/examples/cpp/comm-pingpong/s4u-comm-pingpong.tesh b/examples/cpp/comm-pingpong/s4u-comm-pingpong.tesh index 861b0df694..72785640cb 100644 --- a/examples/cpp/comm-pingpong/s4u-comm-pingpong.tesh +++ b/examples/cpp/comm-pingpong/s4u-comm-pingpong.tesh @@ -39,7 +39,7 @@ $ ${bindir:=.}/s4u-comm-pingpong ${platfdir}/small_platform.xml --cfg=cpu/model: > [145.639041] (1:pinger@Tremblay) Pong time (bandwidth bound): 145.638 > [145.639041] (0:maestro@) Total simulation time: 145.639 -p Testing the surf network constant model +p Testing the network constant model $ ${bindir:=.}/s4u-comm-pingpong ${platfdir}/small_platform_routing_none.xml "--cfg=cpu/model:Cas01 network/model:Constant" "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" > [ 0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01' diff --git a/src/include/simgrid/math_utils.h b/src/include/simgrid/math_utils.h new file mode 100644 index 0000000000..7978f16267 --- /dev/null +++ b/src/include/simgrid/math_utils.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2004-2023. 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. */ + +#ifndef SIMGRID_MATH_UTILS_H_ +#define SIMGRID_MATH_UTILS_H_ + +#include +#include + +#include +#include + +static inline void double_update(double* variable, double value, double precision) +{ + if (false) { // debug + fprintf(stderr, "Updating %g -= %g +- %g\n", *variable, value, precision); + xbt_assert(value == 0.0 || value > precision); + // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding may + // happen, and the precision mechanism is not active... + xbt_assert(FLT_RADIX == 2 && *variable < precision * exp2(DBL_MANT_DIG)); + } + *variable -= value; + if (*variable < precision) + *variable = 0.0; +} + +static inline int double_positive(double value, double precision) +{ + return (value > precision); +} + +static inline int double_equals(double value1, double value2, double precision) +{ + return (fabs(value1 - value2) < precision); +} + +#endif /* SURF_MODEL_H_ */ diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index c27e814ea9..573b6994ed 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -11,13 +11,15 @@ #include #include "mc/mc.h" +#include "simgrid/math_utils.h" #include "src/kernel/EngineImpl.hpp" #include "src/kernel/resource/StandardLinkImpl.hpp" #include "src/kernel/resource/profile/Profile.hpp" +#include "src/kernel/xml/platf.hpp" #include "src/mc/mc_record.hpp" #include "src/mc/mc_replay.hpp" #include "src/smpi/include/smpi_actor.hpp" -#include "src/surf/xml/platf.hpp" +#include "src/surf/surf_interface.hpp" #include "xbt/module.h" #include "xbt/xbt_modinter.h" /* whether initialization was already done */ @@ -313,9 +315,9 @@ void EngineImpl::load_deployment(const std::string& file) const { sg_platf_parser_finalize(); - surf_parse_open(file); - surf_parse(); - surf_parse_close(); + simgrid_parse_open(file); + simgrid_parse(); + simgrid_parse_close(); } void EngineImpl::register_function(const std::string& name, const actor::ActorCodeFactory& code) @@ -556,8 +558,7 @@ double EngineImpl::solve(double max_date) const XBT_DEBUG("This event invalidates the next_occurring_event() computation of models. Next event set to %f", time_delta); } - // FIXME: I'm too lame to update now_ live, so I change it and restore it so that the real update with surf_min - // will work + // FIXME: I'm too lame to update now_ live, so I change it and restore it so that the real update works double round_start = now_; now_ = next_event_date; /* update state of the corresponding resource to the new value. Does not touch lmm. diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index c252e33cf3..4fb6bf5415 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -8,7 +8,9 @@ #include #include +#include "src/internal_config.h" #include "src/kernel/EngineImpl.hpp" +#include "src/surf/surf_interface.hpp" #if HAVE_SMPI #include "src/smpi/include/private.hpp" #endif diff --git a/src/kernel/lmm/System.cpp b/src/kernel/lmm/System.cpp index 6664f3a385..3589190d08 100644 --- a/src/kernel/lmm/System.cpp +++ b/src/kernel/lmm/System.cpp @@ -3,11 +3,14 @@ /* 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/math_utils.h" +#include "src/internal_config.h" #include "src/kernel/lmm/fair_bottleneck.hpp" #include "src/kernel/lmm/maxmin.hpp" #if SIMGRID_HAVE_EIGEN3 #include "src/kernel/lmm/bmf.hpp" #endif + #include #include diff --git a/src/kernel/lmm/System.hpp b/src/kernel/lmm/System.hpp index ab4684b837..d83ae01bad 100644 --- a/src/kernel/lmm/System.hpp +++ b/src/kernel/lmm/System.hpp @@ -9,7 +9,6 @@ #include "simgrid/kernel/resource/Action.hpp" #include "simgrid/kernel/resource/Model.hpp" #include "simgrid/s4u/Link.hpp" -#include "src/surf/surf_interface.hpp" #include "xbt/asserts.h" #include "xbt/ex.h" #include "xbt/mallocator.h" @@ -21,6 +20,11 @@ #include #include +/* user-visible parameters */ +XBT_PUBLIC_DATA double sg_precision_workamount; +XBT_PUBLIC_DATA double sg_precision_timing; +XBT_PUBLIC_DATA int sg_concurrency_limit; + namespace simgrid::kernel::lmm { /** @addtogroup SURF_lmm diff --git a/src/kernel/lmm/bmf.cpp b/src/kernel/lmm/bmf.cpp index b46c8c741e..c7de003b3d 100644 --- a/src/kernel/lmm/bmf.cpp +++ b/src/kernel/lmm/bmf.cpp @@ -4,6 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/lmm/bmf.hpp" +#include "simgrid/math_utils.h" #include #include diff --git a/src/kernel/lmm/bmf.hpp b/src/kernel/lmm/bmf.hpp index fbefd2c511..3bebff17d9 100644 --- a/src/kernel/lmm/bmf.hpp +++ b/src/kernel/lmm/bmf.hpp @@ -9,6 +9,8 @@ #include "src/kernel/lmm/System.hpp" #include "xbt/config.hpp" +#include + #ifdef __clang__ // Ignore deprecation warnings with Eigen < 4.0 (see https://gitlab.com/libeigen/eigen/-/issues/1850) #pragma clang diagnostic push diff --git a/src/kernel/lmm/bmf_test.cpp b/src/kernel/lmm/bmf_test.cpp index d2600565f9..f13e83da62 100644 --- a/src/kernel/lmm/bmf_test.cpp +++ b/src/kernel/lmm/bmf_test.cpp @@ -3,6 +3,7 @@ /* 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/math_utils.h" #include "src/include/catch.hpp" #include "src/kernel/lmm/bmf.hpp" #include "xbt/log.h" diff --git a/src/kernel/lmm/fair_bottleneck.cpp b/src/kernel/lmm/fair_bottleneck.cpp index cb108db156..931a16b40a 100644 --- a/src/kernel/lmm/fair_bottleneck.cpp +++ b/src/kernel/lmm/fair_bottleneck.cpp @@ -4,6 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/lmm/fair_bottleneck.hpp" +#include "simgrid/math_utils.h" #include "xbt/sysdep.h" #include diff --git a/src/kernel/lmm/maxmin.cpp b/src/kernel/lmm/maxmin.cpp index 574bef20cb..3bae1528da 100644 --- a/src/kernel/lmm/maxmin.cpp +++ b/src/kernel/lmm/maxmin.cpp @@ -4,6 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/lmm/maxmin.hpp" +#include "simgrid/math_utils.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_lmm); diff --git a/src/kernel/lmm/maxmin_test.cpp b/src/kernel/lmm/maxmin_test.cpp index d1c3a895a3..6d0c27cfd6 100644 --- a/src/kernel/lmm/maxmin_test.cpp +++ b/src/kernel/lmm/maxmin_test.cpp @@ -3,6 +3,7 @@ /* 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/math_utils.h" #include "src/include/catch.hpp" #include "src/kernel/lmm/maxmin.hpp" #include "xbt/log.h" diff --git a/src/kernel/resource/Action.cpp b/src/kernel/resource/Action.cpp index b74ac0961b..75294a3090 100644 --- a/src/kernel/resource/Action.cpp +++ b/src/kernel/resource/Action.cpp @@ -5,6 +5,7 @@ #include "simgrid/kernel/resource/Action.hpp" #include "simgrid/kernel/resource/Model.hpp" +#include "simgrid/math_utils.h" #include "src/kernel/EngineImpl.hpp" #include "src/kernel/lmm/maxmin.hpp" diff --git a/src/kernel/resource/CpuImpl.cpp b/src/kernel/resource/CpuImpl.cpp index 73ef40b6c9..77aa7a1f02 100644 --- a/src/kernel/resource/CpuImpl.cpp +++ b/src/kernel/resource/CpuImpl.cpp @@ -4,6 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/resource/CpuImpl.hpp" +#include "simgrid/math_utils.h" #include "src/kernel/resource/models/cpu_ti.hpp" #include "src/kernel/resource/profile/Profile.hpp" diff --git a/src/kernel/resource/FactorSet.cpp b/src/kernel/resource/FactorSet.cpp index 179498973b..8e42bb90c5 100644 --- a/src/kernel/resource/FactorSet.cpp +++ b/src/kernel/resource/FactorSet.cpp @@ -16,8 +16,8 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_resource); -extern std::string surf_parsed_filename; -extern int surf_parse_lineno; +extern std::string simgrid_parsed_filename; +extern int simgrid_parse_lineno; namespace simgrid::kernel::resource { @@ -62,7 +62,7 @@ void FactorSet::parse(const std::string& values) } } else { try { - fact.values.push_back(xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, *factor_iter, "")); + fact.values.push_back(xbt_parse_get_time(simgrid_parsed_filename, simgrid_parse_lineno, *factor_iter, "")); } catch (const std::invalid_argument&) { throw std::invalid_argument("Invalid factor value " + std::to_string(iteration) + " in chunk " + std::to_string(factors_.size() + 1) + ": " + *factor_iter + " for " + name_); diff --git a/src/kernel/resource/VirtualMachineImpl.cpp b/src/kernel/resource/VirtualMachineImpl.cpp index d2d1156466..224c1bf74f 100644 --- a/src/kernel/resource/VirtualMachineImpl.cpp +++ b/src/kernel/resource/VirtualMachineImpl.cpp @@ -14,12 +14,13 @@ #include "src/kernel/resource/VirtualMachineImpl.hpp" #include "src/kernel/resource/models/cpu_cas01.hpp" #include "src/kernel/resource/models/cpu_ti.hpp" +#include "src/simgrid/module.hpp" #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_vm, ker_resource, "Virtual Machines, containing actors and mobile across hosts"); -void surf_vm_model_init_HL13() +void simgrid_vm_model_init_HL13() { auto* cpu_pm_model = simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->get_cpu_pm_model().get(); auto vm_model = std::make_shared("VM_HL13"); @@ -333,7 +334,6 @@ void VirtualMachineImpl::shutdown(actor::ActorImpl* issuer) set_state(s4u::VirtualMachine::State::DESTROYED); s4u::VirtualMachine::on_shutdown(*get_iface()); - /* FIXME: we may have to do something at the surf layer, e.g., vcpu action */ } /** @brief Change the physical host on which the given VM is running diff --git a/src/kernel/resource/models/cpu_cas01.cpp b/src/kernel/resource/models/cpu_cas01.cpp index 8c9bd969f6..cb8a40df95 100644 --- a/src/kernel/resource/models/cpu_cas01.cpp +++ b/src/kernel/resource/models/cpu_cas01.cpp @@ -11,6 +11,7 @@ #include "src/kernel/resource/models/cpu_cas01.hpp" #include "src/kernel/resource/models/cpu_ti.hpp" #include "src/kernel/resource/profile/Event.hpp" +#include "src/simgrid/module.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cpu_cas, res_cpu, "CPU resource, CAS01 model (used by default)"); diff --git a/src/kernel/resource/models/cpu_ti.cpp b/src/kernel/resource/models/cpu_ti.cpp index 5fdaad6b4f..8142ff882d 100644 --- a/src/kernel/resource/models/cpu_ti.cpp +++ b/src/kernel/resource/models/cpu_ti.cpp @@ -5,6 +5,7 @@ #include "cpu_ti.hpp" #include "simgrid/kernel/routing/NetZoneImpl.hpp" +#include "simgrid/math_utils.h" #include "simgrid/s4u/Engine.hpp" #include "src/kernel/EngineImpl.hpp" #include "src/kernel/resource/profile/Event.hpp" @@ -55,7 +56,7 @@ CpuTiProfile::CpuTiProfile(const profile::Profile* profile) /** * @brief Integrate trace * - * Wrapper around surf_cpu_integrate_trace_simple() to get + * Wrapper around profile_->integrate_simple() to get * the cyclic effect. * * @param a Begin of interval diff --git a/src/kernel/resource/models/disk_s19.cpp b/src/kernel/resource/models/disk_s19.cpp index c88d038a4d..7789d9f575 100644 --- a/src/kernel/resource/models/disk_s19.cpp +++ b/src/kernel/resource/models/disk_s19.cpp @@ -13,6 +13,7 @@ #include "src/kernel/lmm/maxmin.hpp" #include "src/kernel/resource/models/disk_s19.hpp" #include "src/kernel/resource/profile/Event.hpp" +#include "src/simgrid/module.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_disk); /*********** diff --git a/src/kernel/resource/models/host_clm03.cpp b/src/kernel/resource/models/host_clm03.cpp index dc3be67bf6..3a44e40317 100644 --- a/src/kernel/resource/models/host_clm03.cpp +++ b/src/kernel/resource/models/host_clm03.cpp @@ -11,6 +11,7 @@ #include "src/kernel/EngineImpl.hpp" #include "src/kernel/resource/NetworkModel.hpp" #include "src/kernel/resource/models/host_clm03.hpp" +#include "src/simgrid/module.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_host); diff --git a/src/kernel/resource/models/network_cm02.cpp b/src/kernel/resource/models/network_cm02.cpp index acae09d624..117f661e85 100644 --- a/src/kernel/resource/models/network_cm02.cpp +++ b/src/kernel/resource/models/network_cm02.cpp @@ -5,6 +5,7 @@ #include "src/kernel/resource/models/network_cm02.hpp" #include "simgrid/kernel/routing/NetZoneImpl.hpp" +#include "simgrid/math_utils.h" #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Host.hpp" #include "simgrid/sg_config.hpp" @@ -12,6 +13,7 @@ #include "src/kernel/resource/StandardLinkImpl.hpp" #include "src/kernel/resource/WifiLinkImpl.hpp" #include "src/kernel/resource/profile/Event.hpp" +#include "src/simgrid/module.hpp" #include #include diff --git a/src/kernel/resource/models/network_constant.cpp b/src/kernel/resource/models/network_constant.cpp index 33c03673d8..23e7ebc4be 100644 --- a/src/kernel/resource/models/network_constant.cpp +++ b/src/kernel/resource/models/network_constant.cpp @@ -6,8 +6,10 @@ #include #include +#include "simgrid/math_utils.h" #include "src/kernel/EngineImpl.hpp" #include "src/kernel/resource/models/network_constant.hpp" +#include "src/simgrid/module.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network); diff --git a/src/kernel/resource/models/network_ib.cpp b/src/kernel/resource/models/network_ib.cpp index 56dabbb514..5f90cc55e7 100644 --- a/src/kernel/resource/models/network_ib.cpp +++ b/src/kernel/resource/models/network_ib.cpp @@ -5,24 +5,22 @@ #include +#include "simgrid/math_utils.h" #include "simgrid/sg_config.hpp" #include "src/kernel/EngineImpl.hpp" #include "src/kernel/activity/CommImpl.hpp" #include "src/kernel/resource/HostImpl.hpp" #include "src/kernel/resource/models/network_ib.hpp" +#include "src/simgrid/module.hpp" #include #include XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network); -/********* - * Model * - *********/ - -/************************************************************************/ -/* New model based on MPI contention model for Infiniband platforms */ -/************************************************************************/ +/****************************************************************/ +/* Model based on MPI contention model for Infiniband platforms */ +/****************************************************************/ /* @Inproceedings{mescal_vienne_phd, */ /* author={Jérôme Vienne}, */ /* title={prédiction de performances d’applications de calcul haute performance sur réseau Infiniband}, */ diff --git a/src/kernel/resource/models/network_ns3.cpp b/src/kernel/resource/models/network_ns3.cpp index 5187493758..6509ceeda2 100644 --- a/src/kernel/resource/models/network_ns3.cpp +++ b/src/kernel/resource/models/network_ns3.cpp @@ -9,6 +9,8 @@ #include #include +#include "src/include/simgrid/math_utils.h" +#include "src/simgrid/module.hpp" #include "xbt/config.hpp" #include "xbt/str.h" #include "xbt/string.hpp" @@ -29,7 +31,7 @@ #include "ns3/wifi-module.h" #include "network_ns3.hpp" -#include "src/surf/ns3/ns3_simulator.hpp" +#include "src/kernel/resource/models/ns3/ns3_simulator.hpp" #include "simgrid/kernel/routing/NetPoint.hpp" #include "simgrid/kernel/routing/NetZoneImpl.hpp" @@ -37,9 +39,9 @@ #include "simgrid/plugins/energy.h" #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/NetZone.hpp" -#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals +#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the signals #include "src/kernel/EngineImpl.hpp" -#include "src/surf/xml/platf_private.hpp" // ClusterCreationArgs +#include "src/kernel/xml/platf_private.hpp" // ClusterCreationArgs XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_ns3, res_network, "Network model based on ns-3"); @@ -397,9 +399,9 @@ double NetworkNS3Model::next_occurring_event(double now) if (double_equals(time_to_next_flow_completion, 0, sg_precision_timing)) time_to_next_flow_completion = 0.0; - XBT_DEBUG("min : %f", now); - XBT_DEBUG("ns3 time : %f", ns3::Simulator::Now().GetSeconds()); - XBT_DEBUG("surf time : %f", EngineImpl::get_clock()); + XBT_DEBUG("min : %f", now); + XBT_DEBUG("ns-3 time : %f", ns3::Simulator::Now().GetSeconds()); + XBT_DEBUG("simgrid time: %f", EngineImpl::get_clock()); XBT_DEBUG("Next completion %f :", time_to_next_flow_completion); return time_to_next_flow_completion; diff --git a/src/surf/ns3/ns3_simulator.cpp b/src/kernel/resource/models/ns3/ns3_simulator.cpp similarity index 94% rename from src/surf/ns3/ns3_simulator.cpp rename to src/kernel/resource/models/ns3/ns3_simulator.cpp index c4b3b5e76b..0c13eab9e2 100644 --- a/src/surf/ns3/ns3_simulator.cpp +++ b/src/kernel/resource/models/ns3/ns3_simulator.cpp @@ -3,16 +3,17 @@ /* 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 "src/surf/ns3/ns3_simulator.hpp" +#include "src/kernel/resource/models/ns3/ns3_simulator.hpp" + #include "xbt/log.h" #include "xbt/sysdep.h" -#include -#include #include -#include #include +#include #include +#include +#include #include @@ -56,7 +57,7 @@ static void receive_callback(ns3::Ptr socket) static void send_cb(ns3::Ptr sock, uint32_t /*txSpace*/) { - SgFlow* flow = getFlowFromSocket(sock); + SgFlow* flow = getFlowFromSocket(sock); const ns3::ApplicationContainer* sink = getSinkFromSocket(sock); XBT_DEBUG("Asked to write on F[%p, total: %u, remain: %u]", flow, flow->total_bytes_, flow->remaining_); @@ -83,14 +84,14 @@ static void send_cb(ns3::Ptr sock, uint32_t /*txSpace*/) flow->remaining_); } - if (flow->buffered_bytes_ >= flow->total_bytes_){ + if (flow->buffered_bytes_ >= flow->total_bytes_) { XBT_DEBUG("Closing Sockets of flow %p", flow); // Closing the sockets of the receiving application - ns3::Ptr app = ns3::DynamicCast(sink->Get(0)); + ns3::Ptr app = ns3::DynamicCast(sink->Get(0)); ns3::Ptr listening_sock = app->GetListeningSocket(); listening_sock->Close(); listening_sock->SetRecvCallback(ns3::MakeNullCallback>()); - for(ns3::Ptr accepted_sock : app->GetAcceptedSockets()) + for (ns3::Ptr accepted_sock : app->GetAcceptedSockets()) accepted_sock->Close(); // Closing the socket of the sender sock->Close(); diff --git a/src/surf/ns3/ns3_simulator.hpp b/src/kernel/resource/models/ns3/ns3_simulator.hpp similarity index 100% rename from src/surf/ns3/ns3_simulator.hpp rename to src/kernel/resource/models/ns3/ns3_simulator.hpp diff --git a/src/kernel/resource/models/ptask_L07.cpp b/src/kernel/resource/models/ptask_L07.cpp index 54dc3e6777..6e3edf4789 100644 --- a/src/kernel/resource/models/ptask_L07.cpp +++ b/src/kernel/resource/models/ptask_L07.cpp @@ -9,7 +9,9 @@ #include #include "simgrid/config.h" +#include "simgrid/math_utils.h" #include "src/kernel/EngineImpl.hpp" +#include "src/simgrid/module.hpp" #if SIMGRID_HAVE_EIGEN3 #include "src/kernel/lmm/bmf.hpp" #endif diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 0c33475040..03aed92435 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -7,7 +7,7 @@ #include #include "src/kernel/resource/NetworkModel.hpp" -#include "src/surf/xml/platf.hpp" // surf_parse_error() and surf_parse_assert() +#include "src/kernel/xml/platf.hpp" // simgrid_parse_error() and simgrid_parse_assert() #include #include @@ -232,9 +232,10 @@ void FatTreeZone::generate_switches(const s4u::ClusterCallbacks& set_callbacks) this->nodes_by_level_[0] *= this->num_children_per_node_[i]; if (this->nodes_by_level_[0] != this->nodes_.size()) { - surf_parse_error("The number of provided nodes does not fit with the wanted topology." - " Please check your platform description (We need " + - std::to_string(this->nodes_by_level_[0]) + "nodes, we got " + std::to_string(this->nodes_.size())); + simgrid_parse_error("The number of provided nodes does not fit with the wanted topology." + " Please check your platform description (We need " + + std::to_string(this->nodes_by_level_[0]) + "nodes, we got " + + std::to_string(this->nodes_.size())); } for (unsigned int i = 0; i < this->levels_; i++) { @@ -415,7 +416,7 @@ s4u::FatTreeParams FatTreeZone::parse_topo_parameters(const std::string& topo_pa std::vector count; boost::split(parameters, topo_parameters, boost::is_any_of(";")); - surf_parse_assert( + simgrid_parse_assert( parameters.size() == 4, "Fat trees are defined by the levels number and 3 vectors, see the documentation for more information."); @@ -423,41 +424,41 @@ s4u::FatTreeParams FatTreeZone::parse_topo_parameters(const std::string& topo_pa try { n_lev = std::stoi(parameters[0]); } catch (const std::invalid_argument&) { - surf_parse_error("First parameter is not the amount of levels: " + parameters[0]); + simgrid_parse_error("First parameter is not the amount of levels: " + parameters[0]); } // Then, a l-sized vector standing for the children number by level boost::split(tmp, parameters[1], boost::is_any_of(",")); - surf_parse_assert(tmp.size() == n_lev, "You specified " + std::to_string(n_lev) + - " levels but the child count vector (the first one) contains " + - std::to_string(tmp.size()) + " levels."); + simgrid_parse_assert(tmp.size() == n_lev, "You specified " + std::to_string(n_lev) + + " levels but the child count vector (the first one) contains " + + std::to_string(tmp.size()) + " levels."); for (std::string const& level : tmp) { try { down.push_back(std::stoi(level)); } catch (const std::invalid_argument&) { - surf_parse_error("Invalid child count: " + level); + simgrid_parse_error("Invalid child count: " + level); } } // Then, a l-sized vector standing for the parents number by level boost::split(tmp, parameters[2], boost::is_any_of(",")); - surf_parse_assert(tmp.size() == n_lev, "You specified " + std::to_string(n_lev) + - " levels but the parent count vector (the second one) contains " + - std::to_string(tmp.size()) + " levels."); + simgrid_parse_assert(tmp.size() == n_lev, "You specified " + std::to_string(n_lev) + + " levels but the parent count vector (the second one) contains " + + std::to_string(tmp.size()) + " levels."); for (std::string const& parent : tmp) { try { up.push_back(std::stoi(parent)); } catch (const std::invalid_argument&) { - surf_parse_error("Invalid parent count: " + parent); + simgrid_parse_error("Invalid parent count: " + parent); } } // Finally, a l-sized vector standing for the ports number with the lower level boost::split(tmp, parameters[3], boost::is_any_of(",")); - surf_parse_assert(tmp.size() == n_lev, "You specified " + std::to_string(n_lev) + - " levels but the port count vector (the third one) contains " + - std::to_string(tmp.size()) + " levels."); + simgrid_parse_assert(tmp.size() == n_lev, "You specified " + std::to_string(n_lev) + + " levels but the port count vector (the third one) contains " + + std::to_string(tmp.size()) + " levels."); for (std::string const& port : tmp) { try { count.push_back(std::stoi(port)); diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 14c1b88050..cb9ca40e87 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -18,6 +18,7 @@ #include "src/kernel/resource/SplitDuplexLinkImpl.hpp" #include "src/kernel/resource/StandardLinkImpl.hpp" #include "src/kernel/resource/VirtualMachineImpl.hpp" +#include "src/simgrid/module.hpp" #include "xbt/asserts.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_platform, kernel, "Kernel platform-related information"); @@ -33,15 +34,15 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name) { auto* engine = s4u::Engine::get_instance(); /* workaroud: first netzoneImpl will be the root netzone. - * Without globals and with current surf_*_model_description init functions, we need + * Without globals and with current model description init functions (see module.hpp), we need * the root netzone to exist when creating the models. - * This was usually done at sg_platf.cpp, during XML parsing */ + * This is usually done at sg_platf.cpp, during XML parsing */ if (not engine->get_netzone_root()) { engine->set_netzone_root(&piface_); /* root netzone set, initialize models */ simgrid::s4u::Engine::on_platform_creation(); - /* Initialize the surf models. That must be done after we got all config, and before we need the models. + /* Initialize the models. That must be done after we got all config, and before we need the models. * That is, after the last tag, if any, and before the first of cluster|peer|zone|trace|trace_cb * * I'm not sure for and , there may be a bug here @@ -49,7 +50,7 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name) * but cluster and peer come down to zone creations, so putting this verification here is correct. */ simgrid_host_models().init_from_flag_value(); - surf_vm_model_init_HL13(); + simgrid_vm_model_init_HL13(); } xbt_enforce(nullptr == engine->netpoint_by_name_or_null(get_name()), diff --git a/src/kernel/xml/platf.hpp b/src/kernel/xml/platf.hpp new file mode 100644 index 0000000000..5d07714fc8 --- /dev/null +++ b/src/kernel/xml/platf.hpp @@ -0,0 +1,29 @@ +/* Copyright (c) 2006-2023. 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. */ + +#ifndef SURF_SURFXML_PARSE_HPP +#define SURF_SURFXML_PARSE_HPP + +#include +#include +#include + +/* Module management functions */ +XBT_PUBLIC void sg_platf_parser_finalize(); + +XBT_PUBLIC void simgrid_parse_open(const std::string& file); +XBT_PUBLIC void simgrid_parse_close(); +XBT_PUBLIC void simgrid_parse_assert(bool cond, const std::string& msg); +XBT_ATTRIB_NORETURN XBT_PUBLIC void simgrid_parse_error(const std::string& msg); +XBT_PUBLIC void simgrid_parse_assert_netpoint(const std::string& hostname, const std::string& pre, + const std::string& post); + +XBT_PUBLIC double simgrid_parse_get_double(const std::string& s); +XBT_PUBLIC int simgrid_parse_get_int(const std::string& s); + +XBT_PUBLIC void simgrid_parse(); /* Entry-point to the parser */ +XBT_PUBLIC void parse_platform_file(const std::string& file); + +#endif diff --git a/src/surf/xml/platf_private.hpp b/src/kernel/xml/platf_private.hpp similarity index 91% rename from src/surf/xml/platf_private.hpp rename to src/kernel/xml/platf_private.hpp index bf3d72010a..4c74ac4256 100644 --- a/src/surf/xml/platf_private.hpp +++ b/src/kernel/xml/platf_private.hpp @@ -1,7 +1,6 @@ /* platf_private.h - Interface to the SimGrid platforms which visibility should be limited to this directory */ -/* Copyright (c) 2004-2023. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2004-2023. 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. */ @@ -11,7 +10,7 @@ #include "simgrid/host.h" #include "simgrid/s4u/Link.hpp" -#include "src/surf/xml/simgrid_dtd.h" +#include "src/kernel/xml/simgrid_dtd.h" #include #include @@ -207,17 +206,17 @@ XBT_PUBLIC void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* XBT_PRIVATE void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* trace_connect); /* Prototypes of the functions offered by flex */ -XBT_PUBLIC int surf_parse_lex(); -XBT_PUBLIC int surf_parse_get_lineno(); -XBT_PUBLIC FILE* surf_parse_get_in(); -XBT_PUBLIC FILE* surf_parse_get_out(); -XBT_PUBLIC int surf_parse_get_leng(); -XBT_PUBLIC char* surf_parse_get_text(); -XBT_PUBLIC void surf_parse_set_lineno(int line_number); -XBT_PUBLIC void surf_parse_set_in(FILE* in_str); -XBT_PUBLIC void surf_parse_set_out(FILE* out_str); -XBT_PUBLIC int surf_parse_get_debug(); -XBT_PUBLIC void surf_parse_set_debug(int bdebug); -XBT_PUBLIC int surf_parse_lex_destroy(); +XBT_PUBLIC int simgrid_parse_lex(); +XBT_PUBLIC int simgrid_parse_get_lineno(); +XBT_PUBLIC FILE* simgrid_parse_get_in(); +XBT_PUBLIC FILE* simgrid_parse_get_out(); +XBT_PUBLIC int simgrid_parse_get_leng(); +XBT_PUBLIC char* simgrid_parse_get_text(); +XBT_PUBLIC void simgrid_parse_set_lineno(int line_number); +XBT_PUBLIC void simgrid_parse_set_in(FILE* in_str); +XBT_PUBLIC void simgrid_parse_set_out(FILE* out_str); +XBT_PUBLIC int simgrid_parse_get_debug(); +XBT_PUBLIC void simgrid_parse_set_debug(int bdebug); +XBT_PUBLIC int simgrid_parse_lex_destroy(); #endif /* SG_PLATF_H */ diff --git a/src/surf/sg_platf.cpp b/src/kernel/xml/sg_platf.cpp similarity index 98% rename from src/surf/sg_platf.cpp rename to src/kernel/xml/sg_platf.cpp index 589285f4eb..95a9638bc7 100644 --- a/src/surf/sg_platf.cpp +++ b/src/kernel/xml/sg_platf.cpp @@ -23,8 +23,9 @@ #include "src/kernel/resource/DiskImpl.hpp" #include "src/kernel/resource/HostImpl.hpp" #include "src/kernel/resource/profile/Profile.hpp" -#include "src/surf/xml/platf.hpp" -#include "src/surf/xml/platf_private.hpp" +#include "src/kernel/xml/platf.hpp" +#include "src/kernel/xml/platf_private.hpp" +#include "src/surf/surf_interface.hpp" #include #include @@ -40,14 +41,14 @@ static simgrid::kernel::routing::ClusterZoneCreationArgs /** The current NetZone in the parsing */ static simgrid::kernel::routing::NetZoneImpl* current_routing = nullptr; -static simgrid::s4u::Host* current_host = nullptr; +static simgrid::s4u::Host* current_host = nullptr; /** Module management function: frees all internal data structures */ void sg_platf_parser_finalize() { simgrid::kernel::routing::on_cluster_creation.disconnect_slots(); - surf_parse_lex_destroy(); + simgrid_parse_lex_destroy(); } /** @brief Add a host to the current NetZone */ @@ -233,7 +234,7 @@ static void sg_platf_new_cluster_hierarchical(const simgrid::kernel::routing::Cl /** @brief Create regular Cluster */ static void sg_platf_new_cluster_flat(simgrid::kernel::routing::ClusterCreationArgs* cluster) { - auto* zone = simgrid::s4u::create_star_zone(cluster->id); + auto* zone = simgrid::s4u::create_star_zone(cluster->id); if (const auto* parent = current_routing ? current_routing->get_iface() : nullptr) zone->set_parent(parent); @@ -436,7 +437,7 @@ void sg_platf_new_bypass_route(simgrid::kernel::routing::RouteCreationArgs* rout void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor) { const auto* engine = simgrid::s4u::Engine::get_instance(); - sg_host_t host = sg_host_by_name(actor->host); + sg_host_t host = sg_host_by_name(actor->host); if (not host) { // The requested host does not exist. Do a nice message to the user std::string msg = std::string("Cannot create actor '") + actor->function + "': host '" + actor->host + diff --git a/src/surf/xml/simgrid.dtd b/src/kernel/xml/simgrid.dtd similarity index 100% rename from src/surf/xml/simgrid.dtd rename to src/kernel/xml/simgrid.dtd diff --git a/src/surf/xml/simgrid_dtd.c b/src/kernel/xml/simgrid_dtd.c similarity index 97% rename from src/surf/xml/simgrid_dtd.c rename to src/kernel/xml/simgrid_dtd.c index ed4f7374aa..5cc34983c9 100644 --- a/src/surf/xml/simgrid_dtd.c +++ b/src/kernel/xml/simgrid_dtd.c @@ -3,30 +3,30 @@ /* A lexical scanner generated by flex */ -#define yy_create_buffer surf_parse__create_buffer -#define yy_delete_buffer surf_parse__delete_buffer -#define yy_scan_buffer surf_parse__scan_buffer -#define yy_scan_string surf_parse__scan_string -#define yy_scan_bytes surf_parse__scan_bytes -#define yy_init_buffer surf_parse__init_buffer -#define yy_flush_buffer surf_parse__flush_buffer -#define yy_load_buffer_state surf_parse__load_buffer_state -#define yy_switch_to_buffer surf_parse__switch_to_buffer -#define yypush_buffer_state surf_parse_push_buffer_state -#define yypop_buffer_state surf_parse_pop_buffer_state -#define yyensure_buffer_stack surf_parse_ensure_buffer_stack -#define yy_flex_debug surf_parse__flex_debug -#define yyin surf_parse_in -#define yyleng surf_parse_leng -#define yylex surf_parse_lex -#define yylineno surf_parse_lineno -#define yyout surf_parse_out -#define yyrestart surf_parse_restart -#define yytext surf_parse_text -#define yywrap surf_parse_wrap -#define yyalloc surf_parse_alloc -#define yyrealloc surf_parse_realloc -#define yyfree surf_parse_free +#define yy_create_buffer simgrid_parse__create_buffer +#define yy_delete_buffer simgrid_parse__delete_buffer +#define yy_scan_buffer simgrid_parse__scan_buffer +#define yy_scan_string simgrid_parse__scan_string +#define yy_scan_bytes simgrid_parse__scan_bytes +#define yy_init_buffer simgrid_parse__init_buffer +#define yy_flush_buffer simgrid_parse__flush_buffer +#define yy_load_buffer_state simgrid_parse__load_buffer_state +#define yy_switch_to_buffer simgrid_parse__switch_to_buffer +#define yypush_buffer_state simgrid_parse_push_buffer_state +#define yypop_buffer_state simgrid_parse_pop_buffer_state +#define yyensure_buffer_stack simgrid_parse_ensure_buffer_stack +#define yy_flex_debug simgrid_parse__flex_debug +#define yyin simgrid_parse_in +#define yyleng simgrid_parse_leng +#define yylex simgrid_parse_lex +#define yylineno simgrid_parse_lineno +#define yyout simgrid_parse_out +#define yyrestart simgrid_parse_restart +#define yytext simgrid_parse_text +#define yywrap simgrid_parse_wrap +#define yyalloc simgrid_parse_alloc +#define yyrealloc simgrid_parse_realloc +#define yyfree simgrid_parse_free #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 @@ -37,237 +37,237 @@ #endif #ifdef yy_create_buffer -#define surf_parse__create_buffer_ALREADY_DEFINED +#define simgrid_parse__create_buffer_ALREADY_DEFINED #else -#define yy_create_buffer surf_parse__create_buffer +#define yy_create_buffer simgrid_parse__create_buffer #endif #ifdef yy_delete_buffer -#define surf_parse__delete_buffer_ALREADY_DEFINED +#define simgrid_parse__delete_buffer_ALREADY_DEFINED #else -#define yy_delete_buffer surf_parse__delete_buffer +#define yy_delete_buffer simgrid_parse__delete_buffer #endif #ifdef yy_scan_buffer -#define surf_parse__scan_buffer_ALREADY_DEFINED +#define simgrid_parse__scan_buffer_ALREADY_DEFINED #else -#define yy_scan_buffer surf_parse__scan_buffer +#define yy_scan_buffer simgrid_parse__scan_buffer #endif #ifdef yy_scan_string -#define surf_parse__scan_string_ALREADY_DEFINED +#define simgrid_parse__scan_string_ALREADY_DEFINED #else -#define yy_scan_string surf_parse__scan_string +#define yy_scan_string simgrid_parse__scan_string #endif #ifdef yy_scan_bytes -#define surf_parse__scan_bytes_ALREADY_DEFINED +#define simgrid_parse__scan_bytes_ALREADY_DEFINED #else -#define yy_scan_bytes surf_parse__scan_bytes +#define yy_scan_bytes simgrid_parse__scan_bytes #endif #ifdef yy_init_buffer -#define surf_parse__init_buffer_ALREADY_DEFINED +#define simgrid_parse__init_buffer_ALREADY_DEFINED #else -#define yy_init_buffer surf_parse__init_buffer +#define yy_init_buffer simgrid_parse__init_buffer #endif #ifdef yy_flush_buffer -#define surf_parse__flush_buffer_ALREADY_DEFINED +#define simgrid_parse__flush_buffer_ALREADY_DEFINED #else -#define yy_flush_buffer surf_parse__flush_buffer +#define yy_flush_buffer simgrid_parse__flush_buffer #endif #ifdef yy_load_buffer_state -#define surf_parse__load_buffer_state_ALREADY_DEFINED +#define simgrid_parse__load_buffer_state_ALREADY_DEFINED #else -#define yy_load_buffer_state surf_parse__load_buffer_state +#define yy_load_buffer_state simgrid_parse__load_buffer_state #endif #ifdef yy_switch_to_buffer -#define surf_parse__switch_to_buffer_ALREADY_DEFINED +#define simgrid_parse__switch_to_buffer_ALREADY_DEFINED #else -#define yy_switch_to_buffer surf_parse__switch_to_buffer +#define yy_switch_to_buffer simgrid_parse__switch_to_buffer #endif #ifdef yypush_buffer_state -#define surf_parse_push_buffer_state_ALREADY_DEFINED +#define simgrid_parse_push_buffer_state_ALREADY_DEFINED #else -#define yypush_buffer_state surf_parse_push_buffer_state +#define yypush_buffer_state simgrid_parse_push_buffer_state #endif #ifdef yypop_buffer_state -#define surf_parse_pop_buffer_state_ALREADY_DEFINED +#define simgrid_parse_pop_buffer_state_ALREADY_DEFINED #else -#define yypop_buffer_state surf_parse_pop_buffer_state +#define yypop_buffer_state simgrid_parse_pop_buffer_state #endif #ifdef yyensure_buffer_stack -#define surf_parse_ensure_buffer_stack_ALREADY_DEFINED +#define simgrid_parse_ensure_buffer_stack_ALREADY_DEFINED #else -#define yyensure_buffer_stack surf_parse_ensure_buffer_stack +#define yyensure_buffer_stack simgrid_parse_ensure_buffer_stack #endif #ifdef yylex -#define surf_parse_lex_ALREADY_DEFINED +#define simgrid_parse_lex_ALREADY_DEFINED #else -#define yylex surf_parse_lex +#define yylex simgrid_parse_lex #endif #ifdef yyrestart -#define surf_parse_restart_ALREADY_DEFINED +#define simgrid_parse_restart_ALREADY_DEFINED #else -#define yyrestart surf_parse_restart +#define yyrestart simgrid_parse_restart #endif #ifdef yylex_init -#define surf_parse_lex_init_ALREADY_DEFINED +#define simgrid_parse_lex_init_ALREADY_DEFINED #else -#define yylex_init surf_parse_lex_init +#define yylex_init simgrid_parse_lex_init #endif #ifdef yylex_init_extra -#define surf_parse_lex_init_extra_ALREADY_DEFINED +#define simgrid_parse_lex_init_extra_ALREADY_DEFINED #else -#define yylex_init_extra surf_parse_lex_init_extra +#define yylex_init_extra simgrid_parse_lex_init_extra #endif #ifdef yylex_destroy -#define surf_parse_lex_destroy_ALREADY_DEFINED +#define simgrid_parse_lex_destroy_ALREADY_DEFINED #else -#define yylex_destroy surf_parse_lex_destroy +#define yylex_destroy simgrid_parse_lex_destroy #endif #ifdef yyget_debug -#define surf_parse_get_debug_ALREADY_DEFINED +#define simgrid_parse_get_debug_ALREADY_DEFINED #else -#define yyget_debug surf_parse_get_debug +#define yyget_debug simgrid_parse_get_debug #endif #ifdef yyset_debug -#define surf_parse_set_debug_ALREADY_DEFINED +#define simgrid_parse_set_debug_ALREADY_DEFINED #else -#define yyset_debug surf_parse_set_debug +#define yyset_debug simgrid_parse_set_debug #endif #ifdef yyget_extra -#define surf_parse_get_extra_ALREADY_DEFINED +#define simgrid_parse_get_extra_ALREADY_DEFINED #else -#define yyget_extra surf_parse_get_extra +#define yyget_extra simgrid_parse_get_extra #endif #ifdef yyset_extra -#define surf_parse_set_extra_ALREADY_DEFINED +#define simgrid_parse_set_extra_ALREADY_DEFINED #else -#define yyset_extra surf_parse_set_extra +#define yyset_extra simgrid_parse_set_extra #endif #ifdef yyget_in -#define surf_parse_get_in_ALREADY_DEFINED +#define simgrid_parse_get_in_ALREADY_DEFINED #else -#define yyget_in surf_parse_get_in +#define yyget_in simgrid_parse_get_in #endif #ifdef yyset_in -#define surf_parse_set_in_ALREADY_DEFINED +#define simgrid_parse_set_in_ALREADY_DEFINED #else -#define yyset_in surf_parse_set_in +#define yyset_in simgrid_parse_set_in #endif #ifdef yyget_out -#define surf_parse_get_out_ALREADY_DEFINED +#define simgrid_parse_get_out_ALREADY_DEFINED #else -#define yyget_out surf_parse_get_out +#define yyget_out simgrid_parse_get_out #endif #ifdef yyset_out -#define surf_parse_set_out_ALREADY_DEFINED +#define simgrid_parse_set_out_ALREADY_DEFINED #else -#define yyset_out surf_parse_set_out +#define yyset_out simgrid_parse_set_out #endif #ifdef yyget_leng -#define surf_parse_get_leng_ALREADY_DEFINED +#define simgrid_parse_get_leng_ALREADY_DEFINED #else -#define yyget_leng surf_parse_get_leng +#define yyget_leng simgrid_parse_get_leng #endif #ifdef yyget_text -#define surf_parse_get_text_ALREADY_DEFINED +#define simgrid_parse_get_text_ALREADY_DEFINED #else -#define yyget_text surf_parse_get_text +#define yyget_text simgrid_parse_get_text #endif #ifdef yyget_lineno -#define surf_parse_get_lineno_ALREADY_DEFINED +#define simgrid_parse_get_lineno_ALREADY_DEFINED #else -#define yyget_lineno surf_parse_get_lineno +#define yyget_lineno simgrid_parse_get_lineno #endif #ifdef yyset_lineno -#define surf_parse_set_lineno_ALREADY_DEFINED +#define simgrid_parse_set_lineno_ALREADY_DEFINED #else -#define yyset_lineno surf_parse_set_lineno +#define yyset_lineno simgrid_parse_set_lineno #endif #ifdef yywrap -#define surf_parse_wrap_ALREADY_DEFINED +#define simgrid_parse_wrap_ALREADY_DEFINED #else -#define yywrap surf_parse_wrap +#define yywrap simgrid_parse_wrap #endif #ifdef yyalloc -#define surf_parse_alloc_ALREADY_DEFINED +#define simgrid_parse_alloc_ALREADY_DEFINED #else -#define yyalloc surf_parse_alloc +#define yyalloc simgrid_parse_alloc #endif #ifdef yyrealloc -#define surf_parse_realloc_ALREADY_DEFINED +#define simgrid_parse_realloc_ALREADY_DEFINED #else -#define yyrealloc surf_parse_realloc +#define yyrealloc simgrid_parse_realloc #endif #ifdef yyfree -#define surf_parse_free_ALREADY_DEFINED +#define simgrid_parse_free_ALREADY_DEFINED #else -#define yyfree surf_parse_free +#define yyfree simgrid_parse_free #endif #ifdef yytext -#define surf_parse_text_ALREADY_DEFINED +#define simgrid_parse_text_ALREADY_DEFINED #else -#define yytext surf_parse_text +#define yytext simgrid_parse_text #endif #ifdef yyleng -#define surf_parse_leng_ALREADY_DEFINED +#define simgrid_parse_leng_ALREADY_DEFINED #else -#define yyleng surf_parse_leng +#define yyleng simgrid_parse_leng #endif #ifdef yyin -#define surf_parse_in_ALREADY_DEFINED +#define simgrid_parse_in_ALREADY_DEFINED #else -#define yyin surf_parse_in +#define yyin simgrid_parse_in #endif #ifdef yyout -#define surf_parse_out_ALREADY_DEFINED +#define simgrid_parse_out_ALREADY_DEFINED #else -#define yyout surf_parse_out +#define yyout simgrid_parse_out #endif #ifdef yy_flex_debug -#define surf_parse__flex_debug_ALREADY_DEFINED +#define simgrid_parse__flex_debug_ALREADY_DEFINED #else -#define yy_flex_debug surf_parse__flex_debug +#define yy_flex_debug simgrid_parse__flex_debug #endif #ifdef yylineno -#define surf_parse_lineno_ALREADY_DEFINED +#define simgrid_parse_lineno_ALREADY_DEFINED #else -#define yylineno surf_parse_lineno +#define yylineno simgrid_parse_lineno #endif /* First, we deal with platform-specific or compiler-specific issues. */ @@ -599,7 +599,7 @@ void yyfree ( void * ); /* Begin user sect3 */ -#define surf_parse_wrap() (/*CONSTCOND*/1) +#define simgrid_parse_wrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef flex_uint8_t YY_CHAR; @@ -5367,7 +5367,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -/* Validating XML processor for src/surf/xml/simgrid.dtd. +/* Validating XML processor for src/kernel/xml/simgrid.dtd. * * This program was generated with the FleXML XML processor generator. * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. @@ -7280,8 +7280,8 @@ YY_RULE_SETUP if (!AX_simgrid_parse_backbone_latency) FAIL("Required attribute `latency' not set for `backbone' element."); LEAVE; STag_simgrid_parse_backbone(); simgrid_parse_pcdata_ix = 0; ETag_simgrid_parse_backbone(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: case S_simgrid_parse_zone_6: SET(S_simgrid_parse_zone_6); break; } @@ -7307,8 +7307,8 @@ YY_RULE_SETUP ETag_simgrid_parse_backbone(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: case S_simgrid_parse_zone_6: SET(S_simgrid_parse_zone_6); break; } @@ -7796,8 +7796,8 @@ YY_RULE_SETUP if (!AX_simgrid_parse_cabinet_suffix) FAIL("Required attribute `suffix' not set for `cabinet' element."); LEAVE; STag_simgrid_parse_cabinet(); simgrid_parse_pcdata_ix = 0; ETag_simgrid_parse_cabinet(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; @@ -7824,8 +7824,8 @@ YY_RULE_SETUP ETag_simgrid_parse_cabinet(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; @@ -8693,8 +8693,8 @@ YY_RULE_SETUP if (!AX_simgrid_parse_include_file) FAIL("Required attribute `file' not set for `include' element."); LEAVE; STag_simgrid_parse_include(); simgrid_parse_pcdata_ix = 0; ETag_simgrid_parse_include(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; @@ -8722,8 +8722,8 @@ YY_RULE_SETUP ETag_simgrid_parse_include(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; @@ -8883,8 +8883,8 @@ YY_RULE_SETUP if (!AX_simgrid_parse_link_id) FAIL("Required attribute `id' not set for `link' element."); LEAVE; STag_simgrid_parse_link(); simgrid_parse_pcdata_ix = 0; ETag_simgrid_parse_link(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: case S_simgrid_parse_zone_6: SET(S_simgrid_parse_zone_6); break; } @@ -8910,8 +8910,8 @@ YY_RULE_SETUP ETag_simgrid_parse_link(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: case S_simgrid_parse_AS_3: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: case S_simgrid_parse_AS_6: SET(S_simgrid_parse_AS_6); break; case S_simgrid_parse_zone: case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: case S_simgrid_parse_zone_6: SET(S_simgrid_parse_zone_6); break; } @@ -10534,18 +10534,18 @@ YY_RULE_SETUP if (!AX_simgrid_parse_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element."); LEAVE; STag_simgrid_parse_trace(); simgrid_parse_pcdata_ix = 0; ETag_simgrid_parse_trace(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; - case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_16); break; - case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; - case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; + case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: SET(S_simgrid_parse_AS_16); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; - case S_simgrid_parse_zone: case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: SET(S_simgrid_parse_zone_11); break; - case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; - case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: case S_simgrid_parse_zone_1: SET(S_simgrid_parse_zone_16); break; - case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; - case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_9); break; + case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_11); break; + case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: SET(S_simgrid_parse_zone_14); break; + case S_simgrid_parse_zone: case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: SET(S_simgrid_parse_zone_16); break; + case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; + case S_simgrid_parse_zone_3: case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: SET(S_simgrid_parse_zone_9); break; } } YY_BREAK @@ -10571,18 +10571,18 @@ YY_RULE_SETUP simgrid_parse_pcdata_ix = popbuffer(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; - case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_16); break; - case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; - case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; + case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: SET(S_simgrid_parse_AS_16); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; - case S_simgrid_parse_zone: case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: SET(S_simgrid_parse_zone_11); break; - case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; - case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: case S_simgrid_parse_zone_1: SET(S_simgrid_parse_zone_16); break; - case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; - case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_9); break; + case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_11); break; + case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: SET(S_simgrid_parse_zone_14); break; + case S_simgrid_parse_zone: case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: SET(S_simgrid_parse_zone_16); break; + case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; + case S_simgrid_parse_zone_3: case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: SET(S_simgrid_parse_zone_9); break; } } YY_BREAK @@ -10684,18 +10684,18 @@ YY_RULE_SETUP if (!AX_simgrid_parse_trace___connect_trace) FAIL("Required attribute `trace' not set for `trace_connect' element."); LEAVE; STag_simgrid_parse_trace___connect(); simgrid_parse_pcdata_ix = 0; ETag_simgrid_parse_trace___connect(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; - case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_16); break; - case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; - case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; + case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: SET(S_simgrid_parse_AS_16); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; - case S_simgrid_parse_zone: case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: SET(S_simgrid_parse_zone_11); break; - case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; - case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: case S_simgrid_parse_zone_1: SET(S_simgrid_parse_zone_16); break; - case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; - case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_9); break; + case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_11); break; + case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: SET(S_simgrid_parse_zone_14); break; + case S_simgrid_parse_zone: case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: SET(S_simgrid_parse_zone_16); break; + case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; + case S_simgrid_parse_zone_3: case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: SET(S_simgrid_parse_zone_9); break; } } YY_BREAK @@ -10719,18 +10719,18 @@ YY_RULE_SETUP ETag_simgrid_parse_trace___connect(); popbuffer(); /* attribute */ switch (YY_START) { - case S_simgrid_parse_AS: case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; - case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: SET(S_simgrid_parse_AS_14); break; - case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_16); break; - case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; - case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; + case S_simgrid_parse_AS_10: case S_simgrid_parse_AS_11: case S_simgrid_parse_AS_6: case S_simgrid_parse_AS_7: case S_simgrid_parse_AS_9: SET(S_simgrid_parse_AS_11); break; + case S_simgrid_parse_AS_13: case S_simgrid_parse_AS_14: case S_simgrid_parse_AS_1: SET(S_simgrid_parse_AS_14); break; + case S_simgrid_parse_AS_12: case S_simgrid_parse_AS_15: case S_simgrid_parse_AS_16: SET(S_simgrid_parse_AS_16); break; + case S_simgrid_parse_AS: case S_simgrid_parse_AS_3: case S_simgrid_parse_AS_5: SET(S_simgrid_parse_AS_6); break; + case S_simgrid_parse_AS_4: case S_simgrid_parse_AS_8: SET(S_simgrid_parse_AS_9); break; case S_simgrid_parse_include: case S_simgrid_parse_include_1: case S_simgrid_parse_include_2: SET(S_simgrid_parse_include_2); break; case S_simgrid_parse_platform: case S_simgrid_parse_platform_1: case S_simgrid_parse_platform_3: case S_simgrid_parse_platform_5: case S_simgrid_parse_platform_6: SET(S_simgrid_parse_platform_6); break; - case S_simgrid_parse_zone: case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: SET(S_simgrid_parse_zone_11); break; - case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: case S_simgrid_parse_zone_3: SET(S_simgrid_parse_zone_14); break; - case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: case S_simgrid_parse_zone_1: SET(S_simgrid_parse_zone_16); break; - case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; - case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_9); break; + case S_simgrid_parse_zone_10: case S_simgrid_parse_zone_11: case S_simgrid_parse_zone_6: case S_simgrid_parse_zone_7: case S_simgrid_parse_zone_9: SET(S_simgrid_parse_zone_11); break; + case S_simgrid_parse_zone_13: case S_simgrid_parse_zone_14: SET(S_simgrid_parse_zone_14); break; + case S_simgrid_parse_zone: case S_simgrid_parse_zone_12: case S_simgrid_parse_zone_15: case S_simgrid_parse_zone_16: SET(S_simgrid_parse_zone_16); break; + case S_simgrid_parse_zone_1: case S_simgrid_parse_zone_5: SET(S_simgrid_parse_zone_6); break; + case S_simgrid_parse_zone_3: case S_simgrid_parse_zone_4: case S_simgrid_parse_zone_8: SET(S_simgrid_parse_zone_9); break; } } YY_BREAK @@ -12272,7 +12272,7 @@ static int fail(const char* fmt, ...) #ifndef FLEXML_quiet_parser /* print directly to sdterr */ - surf_parse_error(flexml_err_msg); + simgrid_parse_error(flexml_err_msg); flexml_err_msg[0] = '\0'; #endif diff --git a/src/surf/xml/simgrid_dtd.h b/src/kernel/xml/simgrid_dtd.h similarity index 99% rename from src/surf/xml/simgrid_dtd.h rename to src/kernel/xml/simgrid_dtd.h index dd5f1ea499..87c97e92fe 100644 --- a/src/surf/xml/simgrid_dtd.h +++ b/src/kernel/xml/simgrid_dtd.h @@ -1,4 +1,4 @@ -/* XML processor/application API for src/surf/xml/simgrid.dtd. +/* XML processor/application API for src/kernel/xml/simgrid.dtd. * * This program was generated with the FleXML XML processor generator. * FleXML is Copyright (C) 1999-2005 Kristoffer Rose. All rights reserved. diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/kernel/xml/surfxml_parseplatf.cpp similarity index 65% rename from src/surf/xml/surfxml_parseplatf.cpp rename to src/kernel/xml/surfxml_parseplatf.cpp index 86d89c0359..c5e7c0359c 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/kernel/xml/surfxml_parseplatf.cpp @@ -7,8 +7,8 @@ #include "src/kernel/resource/CpuImpl.hpp" #include "src/kernel/resource/LinkImpl.hpp" -#include "src/surf/xml/platf.hpp" -#include "src/surf/xml/platf_private.hpp" +#include "src/kernel/xml/platf.hpp" +#include "src/kernel/xml/platf_private.hpp" #include @@ -22,9 +22,9 @@ static std::unordered_map trace_connect_list_link_lat; void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* trace_connect) { - surf_parse_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(), - "Cannot connect trace " + trace_connect->trace + " to " + trace_connect->element + - ": trace unknown"); + simgrid_parse_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(), + "Cannot connect trace " + trace_connect->trace + " to " + trace_connect->element + + ": trace unknown"); switch (trace_connect->kind) { case simgrid::kernel::routing::TraceConnectKind::HOST_AVAIL: @@ -43,8 +43,8 @@ void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* trace_connect_list_link_lat.try_emplace(trace_connect->trace, trace_connect->element); break; default: - surf_parse_error("Cannot connect trace " + trace_connect->trace + " to " + trace_connect->element + - ": unknown kind of trace"); + simgrid_parse_error("Cannot connect trace " + trace_connect->trace + " to " + trace_connect->element + + ": unknown kind of trace"); } } @@ -52,64 +52,64 @@ void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* void parse_platform_file(const std::string& file) { /* init the flex parser */ - surf_parse_open(file); + simgrid_parse_open(file); /* Do the actual parsing */ - surf_parse(); + simgrid_parse(); /* Get the Engine singleton once and for all*/ const auto engine = simgrid::s4u::Engine::get_instance(); /* connect all profiles relative to hosts */ for (auto const& [trace, name] : trace_connect_list_host_avail) { - surf_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), - ": Trace " + trace + " undefined."); + simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), + ": Trace " + trace + " undefined."); auto profile = traces_set_list.at(trace); auto host = engine->host_by_name_or_null(name); - surf_parse_assert(host, ": Host " + name + " undefined."); + simgrid_parse_assert(host, ": Host " + name + " undefined."); host->set_state_profile(profile); } for (auto const& [trace, name] : trace_connect_list_host_speed) { - surf_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), - ": Trace " + trace + " undefined."); + simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), + ": Trace " + trace + " undefined."); auto profile = traces_set_list.at(trace); auto host = engine->host_by_name_or_null(name); - surf_parse_assert(host, ": Host " + name + " undefined."); + simgrid_parse_assert(host, ": Host " + name + " undefined."); host->set_speed_profile(profile); } for (auto const& [trace, name] : trace_connect_list_link_avail) { - surf_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), - ": Trace " + trace + " undefined."); + simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), + ": Trace " + trace + " undefined."); auto profile = traces_set_list.at(trace); auto link = engine->link_by_name_or_null(name); - surf_parse_assert(link, ": Link " + name + " undefined."); + simgrid_parse_assert(link, ": Link " + name + " undefined."); link->set_state_profile(profile); } for (auto const& [trace, name] : trace_connect_list_link_bw) { - surf_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), - ": Trace " + trace + " undefined."); + simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), + ": Trace " + trace + " undefined."); auto profile = traces_set_list.at(trace); auto link = engine->link_by_name_or_null(name); - surf_parse_assert(link, ": Link " + name + " undefined."); + simgrid_parse_assert(link, ": Link " + name + " undefined."); link->set_bandwidth_profile(profile); } for (auto const& [trace, name] : trace_connect_list_link_lat) { - surf_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), - ": Trace " + trace + " undefined."); + simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(), + ": Trace " + trace + " undefined."); auto profile = traces_set_list.at(trace); auto link = engine->link_by_name_or_null(name); - surf_parse_assert(link, ": Link " + name + " undefined."); + simgrid_parse_assert(link, ": Link " + name + " undefined."); link->set_latency_profile(profile); } - surf_parse_close(); + simgrid_parse_close(); } diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/kernel/xml/surfxml_sax_cb.cpp similarity index 69% rename from src/surf/xml/surfxml_sax_cb.cpp rename to src/kernel/xml/surfxml_sax_cb.cpp index fc566c5fd0..a41490ded5 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/kernel/xml/surfxml_sax_cb.cpp @@ -13,8 +13,8 @@ #include "src/kernel/resource/LinkImpl.hpp" #include "src/kernel/resource/profile/FutureEvtSet.hpp" #include "src/kernel/resource/profile/Profile.hpp" -#include "src/surf/xml/platf.hpp" -#include "src/surf/xml/platf_private.hpp" +#include "src/kernel/xml/platf.hpp" +#include "src/kernel/xml/platf_private.hpp" #include #include @@ -27,22 +27,22 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(platf_parse, ker_platform, "Logging specific to the parsing of platform files"); -std::string surf_parsed_filename; // Currently parsed file (for the error messages) +std::string simgrid_parsed_filename; // Currently parsed file (for the error messages) static std::vector parsed_link_list; /* temporary store of current link list of a route */ /* Helping functions */ -void surf_parse_assert(bool cond, const std::string& msg) +void simgrid_parse_assert(bool cond, const std::string& msg) { if (not cond) - surf_parse_error(msg); + simgrid_parse_error(msg); } -void surf_parse_error(const std::string& msg) +void simgrid_parse_error(const std::string& msg) { - throw simgrid::ParseError(surf_parsed_filename, surf_parse_lineno, msg); + throw simgrid::ParseError(simgrid_parsed_filename, simgrid_parse_lineno, msg); } -void surf_parse_assert_netpoint(const std::string& hostname, const std::string& pre, const std::string& post) +void simgrid_parse_assert_netpoint(const std::string& hostname, const std::string& pre, const std::string& post) { if (simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(hostname) != nullptr) // found return; @@ -70,24 +70,24 @@ void surf_parse_assert_netpoint(const std::string& hostname, const std::string& break; } } - surf_parse_error(msg); + simgrid_parse_error(msg); } -double surf_parse_get_double(const std::string& s) +double simgrid_parse_get_double(const std::string& s) { try { return std::stod(s); } catch (const std::invalid_argument&) { - surf_parse_error(s + " is not a double"); + simgrid_parse_error(s + " is not a double"); } } -int surf_parse_get_int(const std::string& s) +int simgrid_parse_get_int(const std::string& s) { try { return std::stoi(s); } catch (const std::invalid_argument&) { - surf_parse_error(s + " is not an int"); + simgrid_parse_error(s + " is not an int"); } } @@ -100,7 +100,7 @@ static void explodesRadical(const std::string& radicals, std::vector* explo for (auto const& group : radical_elements) { std::vector radical_ends; boost::split(radical_ends, group, boost::is_any_of("-")); - int start = surf_parse_get_int(radical_ends.front()); + int start = simgrid_parse_get_int(radical_ends.front()); int end = 0; switch (radical_ends.size()) { @@ -108,10 +108,10 @@ static void explodesRadical(const std::string& radicals, std::vector* explo end = start; break; case 2: - end = surf_parse_get_int(radical_ends.back()); + end = simgrid_parse_get_int(radical_ends.back()); break; default: - surf_parse_error("Malformed radical: " + group); + simgrid_parse_error("Malformed radical: " + group); } for (int i = start; i <= end; i++) exploded->push_back(i); @@ -128,7 +128,7 @@ static void explodesRadical(const std::string& radicals, std::vector* explo static std::vector> property_sets; -static FILE* surf_file_to_parse = nullptr; +static FILE* file_to_parse = nullptr; /* Stuff relative to storage */ void STag_simgrid_parse_storage() @@ -173,26 +173,26 @@ void ETag_simgrid_parse_include() void STag_simgrid_parse_platform() { /* Use fixed point arithmetic to avoid rounding errors ("4.1" for example cannot be represented exactly as a floating * point number) */ - const long int version = lround(100.0 * surf_parse_get_double(A_simgrid_parse_platform_version)); + const long int version = lround(100.0 * simgrid_parse_get_double(A_simgrid_parse_platform_version)); const std::string version_string = std::to_string(version / 100) + "." + std::to_string(version % 100); - surf_parse_assert(version >= 100L, "******* BIG FAT WARNING *********\n " - "You're using an ancient XML file.\n" - "Since SimGrid 3.1, units are Bytes, Flops, and seconds " - "instead of MBytes, MFlops and seconds.\n" - - "Use simgrid_update_xml to update your file automatically. " - "This program is installed automatically with SimGrid, or " - "available in the tools/ directory of the source archive.\n" - - "Please check also out the SURF section of the ChangeLog for " - "the 3.1 version for more information."); - surf_parse_assert(version >= 300L, "******* BIG FAT WARNING *********\n " - "You're using an old XML file.\n" - "Use simgrid_update_xml to update your file automatically. " - "This program is installed automatically with SimGrid, or " - "available in the tools/ directory of the source archive."); - surf_parse_assert( + simgrid_parse_assert(version >= 100L, "******* BIG FAT WARNING *********\n " + "You're using an ancient XML file.\n" + "Since SimGrid 3.1, units are Bytes, Flops, and seconds " + "instead of MBytes, MFlops and seconds.\n" + + "Use simgrid_update_xml to update your file automatically. " + "This program is installed automatically with SimGrid, or " + "available in the tools/ directory of the source archive.\n" + + "Please check also out the SURF section of the ChangeLog for " + "the 3.1 version for more information."); + simgrid_parse_assert(version >= 300L, "******* BIG FAT WARNING *********\n " + "You're using an old XML file.\n" + "Use simgrid_update_xml to update your file automatically. " + "This program is installed automatically with SimGrid, or " + "available in the tools/ directory of the source archive."); + simgrid_parse_assert( version >= 400L, "******* THIS FILE IS TOO OLD (v:" + version_string + ") *********\n " @@ -211,12 +211,13 @@ void STag_simgrid_parse_platform() { "Use simgrid_update_xml to update your file automatically to get rid of this warning. " "This program is installed automatically with SimGrid, or " "available in the tools/ directory of the source archive.", - version_string.c_str(), surf_parsed_filename.c_str()); + version_string.c_str(), simgrid_parsed_filename.c_str()); } - surf_parse_assert(version <= 410L, "******* THIS FILE COMES FROM THE FUTURE (v:" + version_string + - ") *********\n " - "The most recent formalism that this version of SimGrid understands is v4.1.\n" - "Please update your code, or use another, more adapted, file."); + simgrid_parse_assert(version <= 410L, + "******* THIS FILE COMES FROM THE FUTURE (v:" + version_string + + ") *********\n " + "The most recent formalism that this version of SimGrid understands is v4.1.\n" + "Please update your code, or use another, more adapted, file."); } void ETag_simgrid_parse_platform(){ simgrid::s4u::Engine::on_platform_created(); @@ -235,11 +236,11 @@ void STag_simgrid_parse_host() property_sets.emplace_back(); host.id = A_simgrid_parse_host_id; - host.speed_per_pstate = xbt_parse_get_all_speeds(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_host_speed, - "speed of host " + host.id); + host.speed_per_pstate = xbt_parse_get_all_speeds(simgrid_parsed_filename, simgrid_parse_lineno, + A_simgrid_parse_host_speed, "speed of host " + host.id); XBT_DEBUG("pstate: %s", A_simgrid_parse_host_pstate); - host.core_amount = surf_parse_get_int(A_simgrid_parse_host_core); + host.core_amount = simgrid_parse_get_int(A_simgrid_parse_host_core); if (A_simgrid_parse_host_availability___file[0] != '\0') { XBT_WARN("The availability_file attribute in is now deprecated. Please, use 'speed_file' instead."); @@ -260,7 +261,7 @@ void ETag_simgrid_parse_host() sg_platf_new_host_set_properties(property_sets.back()); property_sets.pop_back(); - sg_platf_new_host_seal(surf_parse_get_int(A_simgrid_parse_host_pstate)); + sg_platf_new_host_seal(simgrid_parse_get_int(A_simgrid_parse_host_pstate)); } void STag_simgrid_parse_disk() { @@ -273,10 +274,10 @@ void ETag_simgrid_parse_disk() { property_sets.pop_back(); disk.id = A_simgrid_parse_disk_id; - disk.read_bw = xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_disk_read___bw, - "read_bw of disk " + disk.id); - disk.write_bw = xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_disk_write___bw, - "write_bw of disk " + disk.id); + disk.read_bw = xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_disk_read___bw, + "read_bw of disk " + disk.id); + disk.write_bw = xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, + A_simgrid_parse_disk_write___bw, "write_bw of disk " + disk.id); sg_platf_new_disk(&disk); } @@ -305,30 +306,31 @@ void ETag_simgrid_parse_cluster(){ cluster.suffix = A_simgrid_parse_cluster_suffix; explodesRadical(A_simgrid_parse_cluster_radical, &cluster.radicals); - cluster.speeds = xbt_parse_get_all_speeds(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_speed, - "speed of cluster " + cluster.id); - cluster.core_amount = surf_parse_get_int(A_simgrid_parse_cluster_core); - cluster.bw = xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_bw, - "bw of cluster " + cluster.id); - cluster.lat = xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_lat, + cluster.speeds = xbt_parse_get_all_speeds(simgrid_parsed_filename, simgrid_parse_lineno, + A_simgrid_parse_cluster_speed, "speed of cluster " + cluster.id); + cluster.core_amount = simgrid_parse_get_int(A_simgrid_parse_cluster_core); + cluster.bw = xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cluster_bw, + "bw of cluster " + cluster.id); + cluster.lat = xbt_parse_get_time(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cluster_lat, "lat of cluster " + cluster.id); if(strcmp(A_simgrid_parse_cluster_bb___bw,"")) - cluster.bb_bw = xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_bb___bw, - "bb_bw of cluster " + cluster.id); + cluster.bb_bw = xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, + A_simgrid_parse_cluster_bb___bw, "bb_bw of cluster " + cluster.id); if(strcmp(A_simgrid_parse_cluster_bb___lat,"")) - cluster.bb_lat = xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_bb___lat, + cluster.bb_lat = xbt_parse_get_time(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cluster_bb___lat, "bb_lat of cluster " + cluster.id); if(strcmp(A_simgrid_parse_cluster_limiter___link,"")) cluster.limiter_link = - xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_limiter___link, + xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cluster_limiter___link, "limiter_link of cluster " + cluster.id); if(strcmp(A_simgrid_parse_cluster_loopback___bw,"")) cluster.loopback_bw = - xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_loopback___bw, + xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cluster_loopback___bw, "loopback_bw of cluster " + cluster.id); if(strcmp(A_simgrid_parse_cluster_loopback___lat,"")) - cluster.loopback_lat = xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cluster_loopback___lat, - "loopback_lat of cluster " + cluster.id); + cluster.loopback_lat = + xbt_parse_get_time(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cluster_loopback___lat, + "loopback_lat of cluster " + cluster.id); switch(AX_simgrid_parse_cluster_topology){ case A_simgrid_parse_cluster_topology_FLAT: @@ -344,7 +346,7 @@ void ETag_simgrid_parse_cluster(){ cluster.topology = simgrid::kernel::routing::ClusterTopology::DRAGONFLY; break; default: - surf_parse_error("Invalid cluster topology for cluster " + cluster.id); + simgrid_parse_error("Invalid cluster topology for cluster " + cluster.id); } cluster.topo_parameters = A_simgrid_parse_cluster_topo___parameters; cluster.router_id = A_simgrid_parse_cluster_router___id; @@ -364,7 +366,7 @@ void ETag_simgrid_parse_cluster(){ cluster.sharing_policy = simgrid::s4u::Link::SharingPolicy::FATPIPE; break; default: - surf_parse_error("Invalid cluster sharing policy for cluster " + cluster.id); + simgrid_parse_error("Invalid cluster sharing policy for cluster " + cluster.id); } switch (AX_simgrid_parse_cluster_bb___sharing___policy) { case A_simgrid_parse_cluster_bb___sharing___policy_FATPIPE: @@ -374,7 +376,7 @@ void ETag_simgrid_parse_cluster(){ cluster.bb_sharing_policy = simgrid::s4u::Link::SharingPolicy::SHARED; break; default: - surf_parse_error("Invalid bb sharing policy in cluster " + cluster.id); + simgrid_parse_error("Invalid bb sharing policy in cluster " + cluster.id); } sg_platf_new_tag_cluster(&cluster); @@ -389,12 +391,12 @@ void STag_simgrid_parse_cabinet(){ cabinet.id = A_simgrid_parse_cabinet_id; cabinet.prefix = A_simgrid_parse_cabinet_prefix; cabinet.suffix = A_simgrid_parse_cabinet_suffix; - cabinet.speed = xbt_parse_get_speed(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cabinet_speed, - "speed of cabinet " + cabinet.id); - cabinet.bw = xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cabinet_bw, - "bw of cabinet " + cabinet.id); - cabinet.lat = xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_cabinet_lat, - "lat of cabinet " + cabinet.id); + cabinet.speed = xbt_parse_get_speed(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cabinet_speed, + "speed of cabinet " + cabinet.id); + cabinet.bw = xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cabinet_bw, + "bw of cabinet " + cabinet.id); + cabinet.lat = xbt_parse_get_time(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_cabinet_lat, + "lat of cabinet " + cabinet.id); explodesRadical(A_simgrid_parse_cabinet_radical, &cabinet.radicals); sg_platf_new_cabinet(&cabinet); @@ -404,11 +406,11 @@ void STag_simgrid_parse_peer(){ simgrid::kernel::routing::PeerCreationArgs peer; peer.id = A_simgrid_parse_peer_id; - peer.speed = - xbt_parse_get_speed(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_peer_speed, "speed of peer " + peer.id); - peer.bw_in = xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_peer_bw___in, - "bw_in of peer " + peer.id); - peer.bw_out = xbt_parse_get_bandwidth(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_peer_bw___out, + peer.speed = xbt_parse_get_speed(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_peer_speed, + "speed of peer " + peer.id); + peer.bw_in = xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_peer_bw___in, + "bw_in of peer " + peer.id); + peer.bw_out = xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_peer_bw___out, "bw_out of peer " + peer.id); peer.coord = A_simgrid_parse_peer_coordinates; peer.speed_trace = nullptr; @@ -440,13 +442,13 @@ void ETag_simgrid_parse_link(){ property_sets.pop_back(); link.id = A_simgrid_parse_link_id; - link.bandwidths = xbt_parse_get_bandwidths(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_link_bandwidth, - "bandwidth of link " + link.id); + link.bandwidths = xbt_parse_get_bandwidths(simgrid_parsed_filename, simgrid_parse_lineno, + A_simgrid_parse_link_bandwidth, "bandwidth of link " + link.id); link.bandwidth_trace = A_simgrid_parse_link_bandwidth___file[0] ? simgrid::kernel::profile::ProfileBuilder::from_file(A_simgrid_parse_link_bandwidth___file) : nullptr; - link.latency = - xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_link_latency, "latency of link " + link.id); + link.latency = xbt_parse_get_time(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_link_latency, + "latency of link " + link.id); link.latency_trace = A_simgrid_parse_link_latency___file[0] ? simgrid::kernel::profile::ProfileBuilder::from_file(A_simgrid_parse_link_latency___file) : nullptr; @@ -472,7 +474,7 @@ void ETag_simgrid_parse_link(){ link.policy = simgrid::s4u::Link::SharingPolicy::WIFI; break; default: - surf_parse_error("Invalid sharing policy in link " + link.id); + simgrid_parse_error("Invalid sharing policy in link " + link.id); } sg_platf_new_link(&link); @@ -497,7 +499,7 @@ void STag_simgrid_parse_link___ctn() direction = simgrid::s4u::LinkInRoute::Direction::DOWN; break; default: - surf_parse_error(std::string("Invalid direction for link ") + A_simgrid_parse_link___ctn_id); + simgrid_parse_error(std::string("Invalid direction for link ") + A_simgrid_parse_link___ctn_id); } const char* dirname; @@ -511,7 +513,7 @@ void STag_simgrid_parse_link___ctn() default: dirname = ""; } - surf_parse_assert(link != nullptr, std::string("No such link: '") + A_simgrid_parse_link___ctn_id + "'" + dirname); + simgrid_parse_assert(link != nullptr, std::string("No such link: '") + A_simgrid_parse_link___ctn_id + "'" + dirname); parsed_link_list.emplace_back(link, direction); } @@ -520,9 +522,10 @@ void ETag_simgrid_parse_backbone() auto link = std::make_unique(); link->id = A_simgrid_parse_backbone_id; - link->bandwidths.push_back(xbt_parse_get_bandwidth( - surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_backbone_bandwidth, "bandwidth of backbone " + link->id)); - link->latency = xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, A_simgrid_parse_backbone_latency, + link->bandwidths.push_back(xbt_parse_get_bandwidth(simgrid_parsed_filename, simgrid_parse_lineno, + A_simgrid_parse_backbone_bandwidth, + "bandwidth of backbone " + link->id)); + link->latency = xbt_parse_get_time(simgrid_parsed_filename, simgrid_parse_lineno, A_simgrid_parse_backbone_latency, "latency of backbone " + link->id); link->policy = simgrid::s4u::Link::SharingPolicy::SHARED; @@ -530,40 +533,44 @@ void ETag_simgrid_parse_backbone() } void STag_simgrid_parse_route(){ - surf_parse_assert_netpoint(A_simgrid_parse_route_src, "Route src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_route_dst, "Route dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_route_src, "Route src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_route_dst, "Route dst='", "' does name a node."); } void STag_simgrid_parse_ASroute(){ - surf_parse_assert_netpoint(A_simgrid_parse_ASroute_src, "ASroute src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_ASroute_dst, "ASroute dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_ASroute_src, "ASroute src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_ASroute_dst, "ASroute dst='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_ASroute_gw___src, "ASroute gw_src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_ASroute_gw___dst, "ASroute gw_dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_ASroute_gw___src, "ASroute gw_src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_ASroute_gw___dst, "ASroute gw_dst='", "' does name a node."); } void STag_simgrid_parse_zoneRoute(){ - surf_parse_assert_netpoint(A_simgrid_parse_zoneRoute_src, "zoneRoute src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_zoneRoute_dst, "zoneRoute dst='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_zoneRoute_gw___src, "zoneRoute gw_src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_zoneRoute_gw___dst, "zoneRoute gw_dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_zoneRoute_src, "zoneRoute src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_zoneRoute_dst, "zoneRoute dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_zoneRoute_gw___src, "zoneRoute gw_src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_zoneRoute_gw___dst, "zoneRoute gw_dst='", "' does name a node."); } void STag_simgrid_parse_bypassRoute(){ - surf_parse_assert_netpoint(A_simgrid_parse_bypassRoute_src, "bypassRoute src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_bypassRoute_dst, "bypassRoute dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassRoute_src, "bypassRoute src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassRoute_dst, "bypassRoute dst='", "' does name a node."); } void STag_simgrid_parse_bypassASroute(){ - surf_parse_assert_netpoint(A_simgrid_parse_bypassASroute_src, "bypassASroute src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_bypassASroute_dst, "bypassASroute dst='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_bypassASroute_gw___src, "bypassASroute gw_src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_bypassASroute_gw___dst, "bypassASroute gw_dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassASroute_src, "bypassASroute src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassASroute_dst, "bypassASroute dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassASroute_gw___src, "bypassASroute gw_src='", + "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassASroute_gw___dst, "bypassASroute gw_dst='", + "' does name a node."); } void STag_simgrid_parse_bypassZoneRoute(){ - surf_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_src, "bypassZoneRoute src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_dst, "bypassZoneRoute dst='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_gw___src, "bypassZoneRoute gw_src='", "' does name a node."); - surf_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_gw___dst, "bypassZoneRoute gw_dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_src, "bypassZoneRoute src='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_dst, "bypassZoneRoute dst='", "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_gw___src, "bypassZoneRoute gw_src='", + "' does name a node."); + simgrid_parse_assert_netpoint(A_simgrid_parse_bypassZoneRoute_gw___dst, "bypassZoneRoute gw_dst='", + "' does name a node."); } void ETag_simgrid_parse_route(){ @@ -649,7 +656,7 @@ void ETag_simgrid_parse_trace(){ trace.id = A_simgrid_parse_trace_id; trace.file = A_simgrid_parse_trace_file; - trace.periodicity = surf_parse_get_double(A_simgrid_parse_trace_periodicity); + trace.periodicity = simgrid_parse_get_double(A_simgrid_parse_trace_periodicity); trace.pc_data = simgrid_parse_pcdata; sg_platf_new_trace(&trace); @@ -680,7 +687,7 @@ void STag_simgrid_parse_trace___connect() trace_connect.kind = simgrid::kernel::routing::TraceConnectKind::LINK_AVAIL; break; default: - surf_parse_error("Invalid trace kind"); + simgrid_parse_error("Invalid trace kind"); } sg_platf_trace_connect(&trace_connect); } @@ -718,8 +725,9 @@ void STag_simgrid_parse_config() property_sets.emplace_back(); XBT_DEBUG("START configuration name = %s",A_simgrid_parse_config_id); if (_sg_cfg_init_status == 2) { - surf_parse_error("All tags must be given before any platform elements (such as , , , " - ", etc)."); + simgrid_parse_error( + "All tags must be given before any platform elements (such as , , , " + ", etc)."); } } @@ -780,8 +788,8 @@ void ETag_simgrid_parse_actor() actor.args.swap(arguments); actor.host = A_simgrid_parse_actor_host; actor.function = A_simgrid_parse_actor_function; - actor.start_time = surf_parse_get_double(A_simgrid_parse_actor_start___time); - actor.kill_time = surf_parse_get_double(A_simgrid_parse_actor_kill___time); + actor.start_time = simgrid_parse_get_double(A_simgrid_parse_actor_start___time); + actor.kill_time = simgrid_parse_get_double(A_simgrid_parse_actor_kill___time); switch (A_simgrid_parse_actor_on___failure) { case AU_simgrid_parse_actor_on___failure: @@ -792,7 +800,7 @@ void ETag_simgrid_parse_actor() actor.restart_on_failure = true; break; default: - surf_parse_error("Invalid on failure behavior"); + simgrid_parse_error("Invalid on failure behavior"); } sg_platf_new_actor(&actor); @@ -825,37 +833,37 @@ void ETag_simgrid_parse_argument(){/* Nothing to do */} void ETag_simgrid_parse_model___prop(){/* Nothing to do */} /* Open and Close parse file */ -static YY_BUFFER_STATE surf_input_buffer; +static YY_BUFFER_STATE input_buffer; -void surf_parse_open(const std::string& file) +void simgrid_parse_open(const std::string& file) { - surf_parsed_filename = file; + simgrid_parsed_filename = file; std::string dir = simgrid::xbt::Path(file).get_dir_name(); simgrid::xbt::path_push(dir); - surf_file_to_parse = simgrid::xbt::path_fopen(file, "r"); - if (surf_file_to_parse == nullptr) + file_to_parse = simgrid::xbt::path_fopen(file, "r"); + if (file_to_parse == nullptr) throw std::invalid_argument("Unable to open '" + file + "' from '" + simgrid::xbt::Path().get_name() + "'. Does this file exist?"); - surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE); - surf_parse__switch_to_buffer(surf_input_buffer); - surf_parse_lineno = 1; + input_buffer = simgrid_parse__create_buffer(file_to_parse, YY_BUF_SIZE); + simgrid_parse__switch_to_buffer(input_buffer); + simgrid_parse_lineno = 1; } -void surf_parse_close() +void simgrid_parse_close() { - simgrid::xbt::path_pop(); // remove the dirname of the opened file, that was added in surf_parse_open() + simgrid::xbt::path_pop(); // remove the dirname of the opened file, that was added in simgrid_parse_open() - if (surf_file_to_parse) { - surf_parse__delete_buffer(surf_input_buffer); - fclose(surf_file_to_parse); - surf_file_to_parse = nullptr; //Must be reset for Bypass + if (file_to_parse) { + simgrid_parse__delete_buffer(input_buffer); + fclose(file_to_parse); + file_to_parse = nullptr; // Must be reset for Bypass } } /* Call the lexer to parse the currently opened file */ -void surf_parse() +void simgrid_parse() { - bool err = surf_parse_lex(); - surf_parse_assert(not err, "Flex returned an error code"); + bool err = simgrid_parse_lex(); + simgrid_parse_assert(not err, "Flex returned an error code"); } diff --git a/src/plugins/host_dvfs.cpp b/src/plugins/host_dvfs.cpp index c152cc5a76..f89923311f 100644 --- a/src/plugins/host_dvfs.cpp +++ b/src/plugins/host_dvfs.cpp @@ -14,6 +14,7 @@ #include "src/internal_config.h" // HAVE_SMPI #include "src/kernel/activity/CommImpl.hpp" #include "src/kernel/resource/NetworkModel.hpp" +#include "src/simgrid/module.hpp" #if HAVE_SMPI #include "src/smpi/include/smpi_request.hpp" #include "src/smpi/plugins/ampi/ampi.hpp" diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index 422ff2a6a9..2bf95b1065 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -12,6 +12,7 @@ #include #include "src/kernel/resource/CpuImpl.hpp" +#include "src/simgrid/module.hpp" #include #include diff --git a/src/plugins/link_energy_wifi.cpp b/src/plugins/link_energy_wifi.cpp index be74ee658c..481f1f2400 100644 --- a/src/plugins/link_energy_wifi.cpp +++ b/src/plugins/link_energy_wifi.cpp @@ -10,6 +10,7 @@ #include "src/kernel/activity/CommImpl.hpp" #include "src/kernel/resource/StandardLinkImpl.hpp" #include "src/kernel/resource/WifiLinkImpl.hpp" +#include "src/simgrid/module.hpp" #include #include diff --git a/src/simgrid/module.hpp b/src/simgrid/module.hpp index 9a1d7bc00a..771fe09c92 100644 --- a/src/simgrid/module.hpp +++ b/src/simgrid/module.hpp @@ -104,4 +104,6 @@ inline auto& simgrid_host_models() // Function to avoid static initialization or return models; } +XBT_PUBLIC void simgrid_vm_model_init_HL13(); + #endif diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 794fa3e9fc..82752a6e5f 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -12,8 +12,8 @@ #include "smpi_comm.hpp" #include "smpi_utils.hpp" #include "src/internal_config.h" +#include "src/kernel/lmm/System.hpp" // sg_precision_timing #include "src/mc/mc_replay.hpp" -#include "src/surf/surf_interface.hpp" // sg_precision_timing #include "xbt/config.hpp" #include "xbt/file.hpp" diff --git a/src/smpi/internals/smpi_utils.cpp b/src/smpi/internals/smpi_utils.cpp index 46249714c6..09688d88f2 100644 --- a/src/smpi/internals/smpi_utils.cpp +++ b/src/smpi/internals/smpi_utils.cpp @@ -7,7 +7,7 @@ #include "private.hpp" #include "smpi_config.hpp" -#include "src/surf/xml/platf.hpp" +#include "src/kernel/xml/platf.hpp" #include "xbt/ex.h" #include "xbt/file.hpp" #include "xbt/log.h" diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index a63cd3f2cb..45944a44c6 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -6,29 +6,10 @@ #ifndef SURF_MODEL_H_ #define SURF_MODEL_H_ -#include "src/simgrid/module.hpp" -#include -#include - -#include "src/internal_config.h" #include "src/kernel/resource/profile/Profile.hpp" -#include -#include -#include #include #include -#include -#include - -/********* - * Utils * - *********/ - -/* user-visible parameters */ -XBT_PUBLIC_DATA double sg_precision_workamount; -XBT_PUBLIC_DATA double sg_precision_timing; -XBT_PUBLIC_DATA int sg_concurrency_limit; extern XBT_PRIVATE std::unordered_map traces_set_list; @@ -38,31 +19,4 @@ inline auto& watched_hosts() // avoid static initialization order fiasco static std::set> value; return value; } - -static inline void double_update(double* variable, double value, double precision) -{ - if (false) { // debug - fprintf(stderr, "Updating %g -= %g +- %g\n", *variable, value, precision); - xbt_assert(value == 0.0 || value > precision); - // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding may - // happen, and the precision mechanism is not active... - xbt_assert(FLT_RADIX == 2 && *variable < precision * exp2(DBL_MANT_DIG)); - } - *variable -= value; - if (*variable < precision) - *variable = 0.0; -} - -static inline int double_positive(double value, double precision) -{ - return (value > precision); -} - -static inline int double_equals(double value1, double value2, double precision) -{ - return (fabs(value1 - value2) < precision); -} - -XBT_PUBLIC void surf_vm_model_init_HL13(); - #endif /* SURF_MODEL_H_ */ diff --git a/src/surf/xml/platf.hpp b/src/surf/xml/platf.hpp deleted file mode 100644 index 203ca09b1e..0000000000 --- a/src/surf/xml/platf.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2006-2023. 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. */ - -#ifndef SURF_SURFXML_PARSE_HPP -#define SURF_SURFXML_PARSE_HPP - -#include -#include -#include - -/* Module management functions */ -XBT_PUBLIC void sg_platf_parser_finalize(); - -XBT_PUBLIC void surf_parse_open(const std::string& file); -XBT_PUBLIC void surf_parse_close(); -XBT_PUBLIC void surf_parse_assert(bool cond, const std::string& msg); -XBT_ATTRIB_NORETURN XBT_PUBLIC void surf_parse_error(const std::string& msg); -XBT_PUBLIC void surf_parse_assert_netpoint(const std::string& hostname, const std::string& pre, - const std::string& post); - -XBT_PUBLIC double surf_parse_get_double(const std::string& s); -XBT_PUBLIC int surf_parse_get_int(const std::string& s); - -XBT_PUBLIC void surf_parse(); /* Entry-point to the parser */ -XBT_PUBLIC void parse_platform_file(const std::string& file); - -#endif diff --git a/teshsuite/models/CMakeLists.txt b/teshsuite/models/CMakeLists.txt index 2a3644e9a2..407b1bb124 100644 --- a/teshsuite/models/CMakeLists.txt +++ b/teshsuite/models/CMakeLists.txt @@ -6,7 +6,8 @@ else() set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh) endforeach() endif() -foreach(x cloud-sharing ptask_L07_usage wifi_usage wifi_usage_decay cm02-set-lat-bw cm02-tcpgamma issue105 ${optional_examples}) +foreach(x lmm_usage core_usage core_usage2 + cloud-sharing ptask_L07_usage wifi_usage wifi_usage_decay cm02-set-lat-bw cm02-tcpgamma issue105 ${optional_examples}) add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp) target_link_libraries(${x} simgrid) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) @@ -34,6 +35,17 @@ foreach(x cm02-set-lat-bw) endif() endforeach() +# Benchmarking MaxMin +add_executable (maxmin_bench EXCLUDE_FROM_ALL maxmin_bench/maxmin_bench.cpp) +target_link_libraries(maxmin_bench simgrid) +set_target_properties(maxmin_bench PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/maxmin_bench) +set_property(TARGET maxmin_bench APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}") +add_dependencies(tests maxmin_bench) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench/maxmin_bench.cpp) +foreach(x small medium large) + set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench/maxmin_bench_${x}.tesh) + ADD_TESH(tesh-maxmin-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/models/maxmin_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/models/maxmin_bench maxmin_bench_${x}.tesh) +endforeach() set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) set(tesh_files ${tesh_files} PARENT_SCOPE) diff --git a/teshsuite/surf/surf_usage/surf_usage.cpp b/teshsuite/models/core_usage/core_usage.cpp similarity index 96% rename from teshsuite/surf/surf_usage/surf_usage.cpp rename to teshsuite/models/core_usage/core_usage.cpp index aa78b59ca1..a7388e0a14 100644 --- a/teshsuite/surf/surf_usage/surf_usage.cpp +++ b/teshsuite/models/core_usage/core_usage.cpp @@ -1,4 +1,4 @@ -/* A few basic tests for the surf library */ +/* A few basic tests for the model solving mechanism */ /* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved. */ @@ -14,7 +14,7 @@ #include "src/kernel/resource/NetworkModel.hpp" #include "xbt/config.hpp" -XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(core_usage, "Messages specific to this test case"); static const char* string_action(simgrid::kernel::resource::Action::State state) { diff --git a/teshsuite/models/core_usage/core_usage.tesh b/teshsuite/models/core_usage/core_usage.tesh new file mode 100644 index 0000000000..6fc4741b26 --- /dev/null +++ b/teshsuite/models/core_usage/core_usage.tesh @@ -0,0 +1,68 @@ +#!/usr/bin/env tesh + +$ ${bindir:=.}/core_usage ${platfdir}/two_hosts_profiles.xml +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' +> [0.000000] [core_usage/INFO] actionA state: SURF_ACTION_RUNNING +> [0.000000] [core_usage/INFO] actionB state: SURF_ACTION_RUNNING +> [0.000000] [core_usage/INFO] actionC state: SURF_ACTION_RUNNING +> [0.200000] [core_usage/INFO] Next Event : 0.2 +> [0.200016] [core_usage/INFO] Next Event : 0.200016 +> [0.200016] [core_usage/INFO] Network Done action +> [1.000000] [core_usage/INFO] Next Event : 1 +> [1.000000] [core_usage/INFO] CPU Failed action +> [2.000000] [core_usage/INFO] Next Event : 2 +> [7.320000] [core_usage/INFO] Next Event : 7.32 +> [7.320000] [core_usage/INFO] CPU Done action +> [10.000000] [core_usage/INFO] Next Event : 10 +> [11.000000] [core_usage/INFO] Next Event : 11 +> [12.000000] [core_usage/INFO] Next Event : 12 +> [20.000000] [core_usage/INFO] Next Event : 20 +> [21.000000] [core_usage/INFO] Next Event : 21 +> [22.000000] [core_usage/INFO] Next Event : 22 +> [30.000000] [core_usage/INFO] Next Event : 30 +> [31.000000] [core_usage/INFO] Next Event : 31 +> [32.000000] [core_usage/INFO] Next Event : 32 +> [40.000000] [core_usage/INFO] Next Event : 40 +> [41.000000] [core_usage/INFO] Next Event : 41 +> [42.000000] [core_usage/INFO] Next Event : 42 +> [50.000000] [core_usage/INFO] Next Event : 50 +> [51.000000] [core_usage/INFO] Next Event : 51 +> [52.000000] [core_usage/INFO] Next Event : 52 +> [53.000000] [core_usage/INFO] Next Event : 53 +> [60.000000] [core_usage/INFO] Next Event : 60 +> [61.000000] [core_usage/INFO] Next Event : 61 +> [62.000000] [core_usage/INFO] Next Event : 62 +> [63.000000] [core_usage/INFO] Next Event : 63 +> [70.000000] [core_usage/INFO] Next Event : 70 +> [71.000000] [core_usage/INFO] Next Event : 71 +> [72.000000] [core_usage/INFO] Next Event : 72 +> [74.000000] [core_usage/INFO] Next Event : 74 +> [80.000000] [core_usage/INFO] Next Event : 80 +> [81.000000] [core_usage/INFO] Next Event : 81 +> [82.000000] [core_usage/INFO] Next Event : 82 +> [83.000000] [core_usage/INFO] Next Event : 83 +> [84.000000] [core_usage/INFO] Next Event : 84 +> [90.000000] [core_usage/INFO] Next Event : 90 +> [91.000000] [core_usage/INFO] Next Event : 91 +> [92.000000] [core_usage/INFO] Next Event : 92 +> [95.000000] [core_usage/INFO] Next Event : 95 +> [100.000000] [core_usage/INFO] Next Event : 100 +> [101.000000] [core_usage/INFO] Next Event : 101 +> [102.000000] [core_usage/INFO] Next Event : 102 +> [104.000000] [core_usage/INFO] Next Event : 104 +> [105.000000] [core_usage/INFO] Next Event : 105 +> [110.000000] [core_usage/INFO] Next Event : 110 +> [111.000000] [core_usage/INFO] Next Event : 111 +> [112.000000] [core_usage/INFO] Next Event : 112 +> [116.000000] [core_usage/INFO] Next Event : 116 +> [120.000000] [core_usage/INFO] Next Event : 120 +> [121.000000] [core_usage/INFO] Next Event : 121 +> [122.000000] [core_usage/INFO] Next Event : 122 +> [125.000000] [core_usage/INFO] Next Event : 125 +> [126.000000] [core_usage/INFO] Next Event : 126 +> [130.000000] [core_usage/INFO] Next Event : 130 +> [131.000000] [core_usage/INFO] Next Event : 131 +> [132.000000] [core_usage/INFO] Next Event : 132 +> [132.500000] [core_usage/INFO] Next Event : 132.5 +> [132.500000] [core_usage/INFO] CPU Done action diff --git a/teshsuite/surf/surf_usage2/surf_usage2.cpp b/teshsuite/models/core_usage2/core_usage2.cpp similarity index 94% rename from teshsuite/surf/surf_usage2/surf_usage2.cpp rename to teshsuite/models/core_usage2/core_usage2.cpp index 2bec300c2b..608c7ac1a8 100644 --- a/teshsuite/surf/surf_usage2/surf_usage2.cpp +++ b/teshsuite/models/core_usage2/core_usage2.cpp @@ -1,4 +1,4 @@ -/* A few basic tests for the surf library */ +/* A few basic tests for the model solving mechanism */ /* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved. */ @@ -14,7 +14,7 @@ #include "src/kernel/resource/NetworkModel.hpp" #include "xbt/config.hpp" -XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(core_usage2, "Messages specific to this test case"); int main(int argc, char** argv) { diff --git a/teshsuite/models/core_usage2/core_usage2.tesh b/teshsuite/models/core_usage2/core_usage2.tesh new file mode 100644 index 0000000000..9be15bce43 --- /dev/null +++ b/teshsuite/models/core_usage2/core_usage2.tesh @@ -0,0 +1,66 @@ +#!/usr/bin/env tesh + +$ ${bindir:=.}/core_usage2 ${platfdir}/two_hosts_profiles.xml +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' +> [0.200000] [core_usage2/INFO] Next Event : 0.2 +> [0.200016] [core_usage2/INFO] Next Event : 0.200016 +> [0.200016] [core_usage2/INFO] * Done Action +> [1.000000] [core_usage2/INFO] Next Event : 1 +> [1.000000] [core_usage2/INFO] * Done Action +> [2.000000] [core_usage2/INFO] Next Event : 2 +> [7.320000] [core_usage2/INFO] Next Event : 7.32 +> [7.320000] [core_usage2/INFO] * Done Action +> [10.000000] [core_usage2/INFO] Next Event : 10 +> [11.000000] [core_usage2/INFO] Next Event : 11 +> [12.000000] [core_usage2/INFO] Next Event : 12 +> [20.000000] [core_usage2/INFO] Next Event : 20 +> [21.000000] [core_usage2/INFO] Next Event : 21 +> [22.000000] [core_usage2/INFO] Next Event : 22 +> [30.000000] [core_usage2/INFO] Next Event : 30 +> [31.000000] [core_usage2/INFO] Next Event : 31 +> [32.000000] [core_usage2/INFO] Next Event : 32 +> [40.000000] [core_usage2/INFO] Next Event : 40 +> [41.000000] [core_usage2/INFO] Next Event : 41 +> [42.000000] [core_usage2/INFO] Next Event : 42 +> [50.000000] [core_usage2/INFO] Next Event : 50 +> [51.000000] [core_usage2/INFO] Next Event : 51 +> [52.000000] [core_usage2/INFO] Next Event : 52 +> [53.000000] [core_usage2/INFO] Next Event : 53 +> [60.000000] [core_usage2/INFO] Next Event : 60 +> [61.000000] [core_usage2/INFO] Next Event : 61 +> [62.000000] [core_usage2/INFO] Next Event : 62 +> [63.000000] [core_usage2/INFO] Next Event : 63 +> [70.000000] [core_usage2/INFO] Next Event : 70 +> [71.000000] [core_usage2/INFO] Next Event : 71 +> [72.000000] [core_usage2/INFO] Next Event : 72 +> [74.000000] [core_usage2/INFO] Next Event : 74 +> [80.000000] [core_usage2/INFO] Next Event : 80 +> [81.000000] [core_usage2/INFO] Next Event : 81 +> [82.000000] [core_usage2/INFO] Next Event : 82 +> [83.000000] [core_usage2/INFO] Next Event : 83 +> [84.000000] [core_usage2/INFO] Next Event : 84 +> [90.000000] [core_usage2/INFO] Next Event : 90 +> [91.000000] [core_usage2/INFO] Next Event : 91 +> [92.000000] [core_usage2/INFO] Next Event : 92 +> [95.000000] [core_usage2/INFO] Next Event : 95 +> [100.000000] [core_usage2/INFO] Next Event : 100 +> [101.000000] [core_usage2/INFO] Next Event : 101 +> [102.000000] [core_usage2/INFO] Next Event : 102 +> [104.000000] [core_usage2/INFO] Next Event : 104 +> [105.000000] [core_usage2/INFO] Next Event : 105 +> [110.000000] [core_usage2/INFO] Next Event : 110 +> [111.000000] [core_usage2/INFO] Next Event : 111 +> [112.000000] [core_usage2/INFO] Next Event : 112 +> [116.000000] [core_usage2/INFO] Next Event : 116 +> [120.000000] [core_usage2/INFO] Next Event : 120 +> [121.000000] [core_usage2/INFO] Next Event : 121 +> [122.000000] [core_usage2/INFO] Next Event : 122 +> [125.000000] [core_usage2/INFO] Next Event : 125 +> [126.000000] [core_usage2/INFO] Next Event : 126 +> [130.000000] [core_usage2/INFO] Next Event : 130 +> [131.000000] [core_usage2/INFO] Next Event : 131 +> [132.000000] [core_usage2/INFO] Next Event : 132 +> [132.500000] [core_usage2/INFO] Next Event : 132.5 +> [132.500000] [core_usage2/INFO] * Done Action +> [132.500000] [core_usage2/INFO] Simulation Terminated diff --git a/teshsuite/surf/lmm_usage/lmm_usage.cpp b/teshsuite/models/lmm_usage/lmm_usage.cpp similarity index 81% rename from teshsuite/surf/lmm_usage/lmm_usage.cpp rename to teshsuite/models/lmm_usage/lmm_usage.cpp index 3e40583aba..c37cfdc0c1 100644 --- a/teshsuite/surf/lmm_usage/lmm_usage.cpp +++ b/teshsuite/models/lmm_usage/lmm_usage.cpp @@ -14,7 +14,7 @@ #include #include -XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific for this example"); namespace lmm = simgrid::kernel::lmm; @@ -110,21 +110,21 @@ static void test3() } /*matrix that store the constraints/topology */ - A[0][1] = A[0][7] = 1.0; - A[1][1] = A[1][7] = A[1][8] = 1.0; - A[2][1] = A[2][8] = 1.0; - A[3][8] = 1.0; - A[4][0] = A[4][3] = A[4][9] = 1.0; - A[5][0] = A[5][3] = A[5][4] = A[5][9] = 1.0; - A[6][0] = A[6][4] = A[6][9] = A[6][10] = 1.0; + A[0][1] = A[0][7] = 1.0; + A[1][1] = A[1][7] = A[1][8] = 1.0; + A[2][1] = A[2][8] = 1.0; + A[3][8] = 1.0; + A[4][0] = A[4][3] = A[4][9] = 1.0; + A[5][0] = A[5][3] = A[5][4] = A[5][9] = 1.0; + A[6][0] = A[6][4] = A[6][9] = A[6][10] = 1.0; A[7][2] = A[7][4] = A[7][6] = A[7][9] = A[7][10] = 1.0; - A[8][2] = A[8][10] = 1.0; - A[9][5] = A[9][6] = A[9][9] = 1.0; - A[10][11] = 1.0; - A[11][12] = 1.0; - A[12][13] = 1.0; - A[13][14] = 1.0; - A[14][15] = 1.0; + A[8][2] = A[8][10] = 1.0; + A[9][5] = A[9][6] = A[9][9] = 1.0; + A[10][11] = 1.0; + A[11][12] = 1.0; + A[12][13] = 1.0; + A[13][14] = 1.0; + A[14][15] = 1.0; lmm::MaxMin Sys(false); diff --git a/teshsuite/models/lmm_usage/lmm_usage.tesh b/teshsuite/models/lmm_usage/lmm_usage.tesh new file mode 100644 index 0000000000..77ce1b73dc --- /dev/null +++ b/teshsuite/models/lmm_usage/lmm_usage.tesh @@ -0,0 +1,6 @@ +#!/usr/bin/env tesh + +$ ${bindir:=.}/lmm_usage +> [0.000000] [test/INFO] ***** Test 1 +> [0.000000] [test/INFO] ***** Test 2 +> [0.000000] [test/INFO] ***** Test 3 diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp b/teshsuite/models/maxmin_bench/maxmin_bench.cpp similarity index 71% rename from teshsuite/surf/maxmin_bench/maxmin_bench.cpp rename to teshsuite/models/maxmin_bench/maxmin_bench.cpp index d316afdf42..d905956d18 100644 --- a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp +++ b/teshsuite/models/maxmin_bench/maxmin_bench.cpp @@ -5,8 +5,8 @@ /* 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 "src/kernel/lmm/maxmin.hpp" #include "simgrid/s4u/Engine.hpp" +#include "src/kernel/lmm/maxmin.hpp" #include "xbt/module.h" #include "xbt/random.hpp" #include "xbt/sysdep.h" /* time manipulation for benchmarking */ @@ -41,7 +41,7 @@ static double test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_li for (auto& var : variables) { var = Sys.variable_new(nullptr, 1.0, -1.0, nb_elem); - //Have a few variables with a concurrency share of two (e.g. cross-traffic in some cases) + // Have a few variables with a concurrency share of two (e.g. cross-traffic in some cases) short concurrency_share = 1 + static_cast(simgrid::xbt::random::uniform_int(0, max_share - 1)); std::vector used(nb_cnst, 0); @@ -61,22 +61,22 @@ static double test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_li Sys.solve(); date = (xbt_os_time() - date) * 1e6; - if(mode==2){ - fprintf(stderr,"Max concurrency:\n"); - int l=0; + if (mode == 2) { + fprintf(stderr, "Max concurrency:\n"); + int l = 0; for (int i = 0; i < nb_cnst; i++) { int j = constraints[i]->get_concurrency_maximum(); int k = constraints[i]->get_concurrency_limit(); - xbt_assert(k<0 || j<=k); - if(j>l) - l=j; - fprintf(stderr,"(%i):%i/%i ",i,j,k); + xbt_assert(k < 0 || j <= k); + if (j > l) + l = j; + fprintf(stderr, "(%i):%i/%i ", i, j, k); constraints[i]->reset_concurrency_maximum(); xbt_assert(not constraints[i]->get_concurrency_maximum()); - if(i%10==9) - fprintf(stderr,"\n"); + if (i % 10 == 9) + fprintf(stderr, "\n"); } - fprintf(stderr,"\nTotal maximum concurrency is %i\n",l); + fprintf(stderr, "\nTotal maximum concurrency is %i\n", l); Sys.print(); } @@ -95,7 +95,7 @@ constexpr std::array, 4> TestClasses{{ {{20000, 20000, 7, 10}} // huge }}; -int main(int argc, char **argv) +int main(int argc, char** argv) { simgrid::s4u::Engine e(&argc, argv); @@ -104,12 +104,12 @@ int main(int argc, char **argv) double acc_date2 = 0.0; int testclass; - if(argc<3) { + if (argc < 3) { fprintf(stderr, "Syntax: [test|debug|perf]\n"); return -1; } - //what class? + // what class? if (not strcmp(argv[1], "small")) testclass = 0; else if (not strcmp(argv[1], "medium")) @@ -119,57 +119,58 @@ int main(int argc, char **argv) else if (not strcmp(argv[1], "huge")) testclass = 3; else { - fprintf(stderr, "Unknown class \"%s\", aborting!\n",argv[1]); + fprintf(stderr, "Unknown class \"%s\", aborting!\n", argv[1]); return -2; } - //How many times? - int testcount=atoi(argv[2]); + // How many times? + int testcount = atoi(argv[2]); - //Show me everything (debug or performance)! - int mode=0; - if(argc>=4 && strcmp(argv[3],"test")==0) - mode=1; - if(argc>=4 && strcmp(argv[3],"debug")==0) - mode=2; - if(argc>=4 && strcmp(argv[3],"perf")==0) - mode=3; + // Show me everything (debug or performance)! + int mode = 0; + if (argc >= 4 && strcmp(argv[3], "test") == 0) + mode = 1; + if (argc >= 4 && strcmp(argv[3], "debug") == 0) + mode = 2; + if (argc >= 4 && strcmp(argv[3], "perf") == 0) + mode = 3; - if(mode==1) + if (mode == 1) xbt_log_control_set("ker_lmm.threshold:DEBUG ker_lmm.fmt:'[%r]: [%c/%p] %m%n' " "kernel.threshold:DEBUG kernel.fmt:'[%r]: [%c/%p] %m%n' "); - if(mode==2) + if (mode == 2) xbt_log_control_set("ker_lmm.threshold:DEBUG kernel.threshold:DEBUG"); - unsigned int nb_cnst= TestClasses[testclass][0]; - unsigned int nb_var= TestClasses[testclass][1]; - unsigned int pw_base_limit= TestClasses[testclass][2]; - unsigned int pw_max_limit= TestClasses[testclass][3]; - unsigned int max_share = 2; // 1<<(pw_base_limit/2+1) + unsigned int nb_cnst = TestClasses[testclass][0]; + unsigned int nb_var = TestClasses[testclass][1]; + unsigned int pw_base_limit = TestClasses[testclass][2]; + unsigned int pw_max_limit = TestClasses[testclass][3]; + unsigned int max_share = 2; // 1<<(pw_base_limit/2+1) - //If you want to test concurrency, you need nb_elem >> 2^pw_base_limit: - unsigned int nb_elem= (1<> 2^pw_base_limit: + unsigned int nb_elem = (1 << pw_base_limit) + (1 << (8 * pw_max_limit / 10)); + // Otherwise, just set it to a constant value (and set rate_no_limit to 1.0): + // nb_elem=200 - for(int i=0;i(testcount); double stdev_date = sqrt(acc_date2 / static_cast(testcount) - mean_date * mean_date); - fprintf(stderr, "%ix One shot execution time for a total of %u constraints, " - "%u variables with %u active constraint each, concurrency in [%i,%i] and max concurrency share %u\n", + fprintf(stderr, + "%ix One shot execution time for a total of %u constraints, " + "%u variables with %u active constraint each, concurrency in [%i,%i] and max concurrency share %u\n", testcount, nb_cnst, nb_var, nb_elem, (1 << pw_base_limit), (1 << pw_base_limit) + (1 << pw_max_limit), max_share); - if(mode==3) - fprintf(stderr, "Execution time: %g +- %g microseconds \n",mean_date, stdev_date); + if (mode == 3) + fprintf(stderr, "Execution time: %g +- %g microseconds \n", mean_date, stdev_date); return 0; } diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench_large.tesh b/teshsuite/models/maxmin_bench/maxmin_bench_large.tesh similarity index 100% rename from teshsuite/surf/maxmin_bench/maxmin_bench_large.tesh rename to teshsuite/models/maxmin_bench/maxmin_bench_large.tesh diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench_medium.tesh b/teshsuite/models/maxmin_bench/maxmin_bench_medium.tesh similarity index 100% rename from teshsuite/surf/maxmin_bench/maxmin_bench_medium.tesh rename to teshsuite/models/maxmin_bench/maxmin_bench_medium.tesh diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench_small.tesh b/teshsuite/models/maxmin_bench/maxmin_bench_small.tesh similarity index 100% rename from teshsuite/surf/maxmin_bench/maxmin_bench_small.tesh rename to teshsuite/models/maxmin_bench/maxmin_bench_small.tesh diff --git a/teshsuite/s4u/activity-lifecycle/testing_comm.cpp b/teshsuite/s4u/activity-lifecycle/testing_comm.cpp index 04fb363b5e..9f16b73953 100644 --- a/teshsuite/s4u/activity-lifecycle/testing_comm.cpp +++ b/teshsuite/s4u/activity-lifecycle/testing_comm.cpp @@ -172,7 +172,7 @@ TEST_CASE("Activity lifecycle: comm activities") simgrid::s4u::this_actor::sleep_for(2); receiver_basic(recv_done, true, 1); - // Sleep long enough to let the test ends by itself. 1 + surf_precision should be enough. + // Sleep long enough to let the test ends by itself. 1 + precision_timing should be enough. simgrid::s4u::this_actor::sleep_for(4); INFO("Sender or receiver killed somehow. It shouldn't"); REQUIRE(dsend_done); @@ -191,7 +191,7 @@ TEST_CASE("Activity lifecycle: comm activities") simgrid::s4u::this_actor::sleep_for(2); sender_dtach(dsend_done, true, 0); - // Sleep long enough to let the test ends by itself. 3 + surf_precision should be enough. + // Sleep long enough to let the test ends by itself. 3 + precision_timing should be enough. simgrid::s4u::this_actor::sleep_for(4); INFO("Sender or receiver killed somehow. It shouldn't"); REQUIRE(dsend_done); @@ -219,7 +219,7 @@ TEST_CASE("Activity lifecycle: comm activities") simgrid::s4u::this_actor::sleep_for(2); sender->kill(); - // let the test ends by itself. waiting for surf_precision should be enough. + // let the test ends by itself. waiting for precision_timing should be enough. simgrid::s4u::this_actor::sleep_for(0.00001); INFO("Sender was not killed properly or receiver killed somehow. It shouldn't"); diff --git a/teshsuite/surf/CMakeLists.txt b/teshsuite/surf/CMakeLists.txt deleted file mode 100644 index a9346ba940..0000000000 --- a/teshsuite/surf/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -foreach(x lmm_usage surf_usage surf_usage2) - add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp) - target_link_libraries(${x} simgrid) - set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) - set_property(TARGET ${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}") - add_dependencies(tests ${x}) - - set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh) - set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp) - - ADD_TESH(tesh-surf-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/${x} ${x}.tesh) -endforeach() - -add_executable (maxmin_bench EXCLUDE_FROM_ALL maxmin_bench/maxmin_bench.cpp) -target_link_libraries(maxmin_bench simgrid) -set_target_properties(maxmin_bench PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/maxmin_bench) -set_property(TARGET maxmin_bench APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}") -add_dependencies(tests maxmin_bench) - -foreach(x small medium large) - set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench/maxmin_bench_${x}.tesh) -endforeach() - -set(tesh_files ${tesh_files} PARENT_SCOPE) -set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench/maxmin_bench.cpp PARENT_SCOPE) - -ADD_TESH(tesh-surf-maxmin-large --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/maxmin_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/maxmin_bench maxmin_bench_large.tesh) - -if(enable_debug) - foreach(x small medium) - ADD_TESH(tesh-surf-maxmin-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/maxmin_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/maxmin_bench maxmin_bench_${x}.tesh) - endforeach() -endif() \ No newline at end of file diff --git a/teshsuite/surf/lmm_usage/lmm_usage.tesh b/teshsuite/surf/lmm_usage/lmm_usage.tesh deleted file mode 100644 index 1ab150d6b2..0000000000 --- a/teshsuite/surf/lmm_usage/lmm_usage.tesh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env tesh - -$ ${bindir:=.}/lmm_usage -> [0.000000] [surf_test/INFO] ***** Test 1 -> [0.000000] [surf_test/INFO] ***** Test 2 -> [0.000000] [surf_test/INFO] ***** Test 3 diff --git a/teshsuite/surf/surf_usage/surf_usage.tesh b/teshsuite/surf/surf_usage/surf_usage.tesh deleted file mode 100644 index 083d5528b8..0000000000 --- a/teshsuite/surf/surf_usage/surf_usage.tesh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env tesh - -$ ${bindir:=.}/surf_usage ${platfdir}/two_hosts_profiles.xml -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' -> [0.000000] [surf_test/INFO] actionA state: SURF_ACTION_RUNNING -> [0.000000] [surf_test/INFO] actionB state: SURF_ACTION_RUNNING -> [0.000000] [surf_test/INFO] actionC state: SURF_ACTION_RUNNING -> [0.200000] [surf_test/INFO] Next Event : 0.2 -> [0.200016] [surf_test/INFO] Next Event : 0.200016 -> [0.200016] [surf_test/INFO] Network Done action -> [1.000000] [surf_test/INFO] Next Event : 1 -> [1.000000] [surf_test/INFO] CPU Failed action -> [2.000000] [surf_test/INFO] Next Event : 2 -> [7.320000] [surf_test/INFO] Next Event : 7.32 -> [7.320000] [surf_test/INFO] CPU Done action -> [10.000000] [surf_test/INFO] Next Event : 10 -> [11.000000] [surf_test/INFO] Next Event : 11 -> [12.000000] [surf_test/INFO] Next Event : 12 -> [20.000000] [surf_test/INFO] Next Event : 20 -> [21.000000] [surf_test/INFO] Next Event : 21 -> [22.000000] [surf_test/INFO] Next Event : 22 -> [30.000000] [surf_test/INFO] Next Event : 30 -> [31.000000] [surf_test/INFO] Next Event : 31 -> [32.000000] [surf_test/INFO] Next Event : 32 -> [40.000000] [surf_test/INFO] Next Event : 40 -> [41.000000] [surf_test/INFO] Next Event : 41 -> [42.000000] [surf_test/INFO] Next Event : 42 -> [50.000000] [surf_test/INFO] Next Event : 50 -> [51.000000] [surf_test/INFO] Next Event : 51 -> [52.000000] [surf_test/INFO] Next Event : 52 -> [53.000000] [surf_test/INFO] Next Event : 53 -> [60.000000] [surf_test/INFO] Next Event : 60 -> [61.000000] [surf_test/INFO] Next Event : 61 -> [62.000000] [surf_test/INFO] Next Event : 62 -> [63.000000] [surf_test/INFO] Next Event : 63 -> [70.000000] [surf_test/INFO] Next Event : 70 -> [71.000000] [surf_test/INFO] Next Event : 71 -> [72.000000] [surf_test/INFO] Next Event : 72 -> [74.000000] [surf_test/INFO] Next Event : 74 -> [80.000000] [surf_test/INFO] Next Event : 80 -> [81.000000] [surf_test/INFO] Next Event : 81 -> [82.000000] [surf_test/INFO] Next Event : 82 -> [83.000000] [surf_test/INFO] Next Event : 83 -> [84.000000] [surf_test/INFO] Next Event : 84 -> [90.000000] [surf_test/INFO] Next Event : 90 -> [91.000000] [surf_test/INFO] Next Event : 91 -> [92.000000] [surf_test/INFO] Next Event : 92 -> [95.000000] [surf_test/INFO] Next Event : 95 -> [100.000000] [surf_test/INFO] Next Event : 100 -> [101.000000] [surf_test/INFO] Next Event : 101 -> [102.000000] [surf_test/INFO] Next Event : 102 -> [104.000000] [surf_test/INFO] Next Event : 104 -> [105.000000] [surf_test/INFO] Next Event : 105 -> [110.000000] [surf_test/INFO] Next Event : 110 -> [111.000000] [surf_test/INFO] Next Event : 111 -> [112.000000] [surf_test/INFO] Next Event : 112 -> [116.000000] [surf_test/INFO] Next Event : 116 -> [120.000000] [surf_test/INFO] Next Event : 120 -> [121.000000] [surf_test/INFO] Next Event : 121 -> [122.000000] [surf_test/INFO] Next Event : 122 -> [125.000000] [surf_test/INFO] Next Event : 125 -> [126.000000] [surf_test/INFO] Next Event : 126 -> [130.000000] [surf_test/INFO] Next Event : 130 -> [131.000000] [surf_test/INFO] Next Event : 131 -> [132.000000] [surf_test/INFO] Next Event : 132 -> [132.500000] [surf_test/INFO] Next Event : 132.5 -> [132.500000] [surf_test/INFO] CPU Done action diff --git a/teshsuite/surf/surf_usage2/surf_usage2.tesh b/teshsuite/surf/surf_usage2/surf_usage2.tesh deleted file mode 100644 index a89c4fe129..0000000000 --- a/teshsuite/surf/surf_usage2/surf_usage2.tesh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env tesh - -$ ${bindir:=.}/surf_usage2 ${platfdir}/two_hosts_profiles.xml -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' -> [0.200000] [surf_test/INFO] Next Event : 0.2 -> [0.200016] [surf_test/INFO] Next Event : 0.200016 -> [0.200016] [surf_test/INFO] * Done Action -> [1.000000] [surf_test/INFO] Next Event : 1 -> [1.000000] [surf_test/INFO] * Done Action -> [2.000000] [surf_test/INFO] Next Event : 2 -> [7.320000] [surf_test/INFO] Next Event : 7.32 -> [7.320000] [surf_test/INFO] * Done Action -> [10.000000] [surf_test/INFO] Next Event : 10 -> [11.000000] [surf_test/INFO] Next Event : 11 -> [12.000000] [surf_test/INFO] Next Event : 12 -> [20.000000] [surf_test/INFO] Next Event : 20 -> [21.000000] [surf_test/INFO] Next Event : 21 -> [22.000000] [surf_test/INFO] Next Event : 22 -> [30.000000] [surf_test/INFO] Next Event : 30 -> [31.000000] [surf_test/INFO] Next Event : 31 -> [32.000000] [surf_test/INFO] Next Event : 32 -> [40.000000] [surf_test/INFO] Next Event : 40 -> [41.000000] [surf_test/INFO] Next Event : 41 -> [42.000000] [surf_test/INFO] Next Event : 42 -> [50.000000] [surf_test/INFO] Next Event : 50 -> [51.000000] [surf_test/INFO] Next Event : 51 -> [52.000000] [surf_test/INFO] Next Event : 52 -> [53.000000] [surf_test/INFO] Next Event : 53 -> [60.000000] [surf_test/INFO] Next Event : 60 -> [61.000000] [surf_test/INFO] Next Event : 61 -> [62.000000] [surf_test/INFO] Next Event : 62 -> [63.000000] [surf_test/INFO] Next Event : 63 -> [70.000000] [surf_test/INFO] Next Event : 70 -> [71.000000] [surf_test/INFO] Next Event : 71 -> [72.000000] [surf_test/INFO] Next Event : 72 -> [74.000000] [surf_test/INFO] Next Event : 74 -> [80.000000] [surf_test/INFO] Next Event : 80 -> [81.000000] [surf_test/INFO] Next Event : 81 -> [82.000000] [surf_test/INFO] Next Event : 82 -> [83.000000] [surf_test/INFO] Next Event : 83 -> [84.000000] [surf_test/INFO] Next Event : 84 -> [90.000000] [surf_test/INFO] Next Event : 90 -> [91.000000] [surf_test/INFO] Next Event : 91 -> [92.000000] [surf_test/INFO] Next Event : 92 -> [95.000000] [surf_test/INFO] Next Event : 95 -> [100.000000] [surf_test/INFO] Next Event : 100 -> [101.000000] [surf_test/INFO] Next Event : 101 -> [102.000000] [surf_test/INFO] Next Event : 102 -> [104.000000] [surf_test/INFO] Next Event : 104 -> [105.000000] [surf_test/INFO] Next Event : 105 -> [110.000000] [surf_test/INFO] Next Event : 110 -> [111.000000] [surf_test/INFO] Next Event : 111 -> [112.000000] [surf_test/INFO] Next Event : 112 -> [116.000000] [surf_test/INFO] Next Event : 116 -> [120.000000] [surf_test/INFO] Next Event : 120 -> [121.000000] [surf_test/INFO] Next Event : 121 -> [122.000000] [surf_test/INFO] Next Event : 122 -> [125.000000] [surf_test/INFO] Next Event : 125 -> [126.000000] [surf_test/INFO] Next Event : 126 -> [130.000000] [surf_test/INFO] Next Event : 130 -> [131.000000] [surf_test/INFO] Next Event : 131 -> [132.000000] [surf_test/INFO] Next Event : 132 -> [132.500000] [surf_test/INFO] Next Event : 132.5 -> [132.500000] [surf_test/INFO] * Done Action -> [132.500000] [surf_test/INFO] Simulation Terminated diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index e2b8ac2557..78cb9a4a12 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -9,6 +9,7 @@ set(EXTRA_DIST src/include/mc/datatypes.h src/include/mc/mc.h src/include/simgrid/sg_config.hpp + src/include/simgrid/math_utils.h src/include/xbt/coverage.h src/include/xbt/mmalloc.h src/include/xbt/parmap.hpp @@ -30,7 +31,7 @@ set(EXTRA_DIST src/kernel/resource/models/network_constant.hpp src/kernel/resource/models/network_ib.hpp src/kernel/resource/models/network_ns3.hpp - src/surf/ns3/ns3_simulator.hpp + src/kernel/resource/models/ns3/ns3_simulator.hpp src/kernel/resource/models/ptask_L07.hpp src/mc/mc_mmu.hpp @@ -43,10 +44,10 @@ set(EXTRA_DIST src/smpi/smpi_main.c src/smpi/smpi_replay_main.cpp src/surf/surf_interface.hpp - src/surf/xml/simgrid.dtd - src/surf/xml/simgrid_dtd.c - src/surf/xml/simgrid_dtd.h - src/surf/xml/surfxml_sax_cb.cpp + src/kernel/xml/simgrid.dtd + src/kernel/xml/simgrid_dtd.c + src/kernel/xml/simgrid_dtd.h + src/kernel/xml/surfxml_sax_cb.cpp src/xbt/automaton/automaton_lexer.yy.c src/xbt/automaton/parserPromela.lex @@ -294,7 +295,7 @@ endif() set(NS3_SRC src/kernel/resource/models/network_ns3.cpp - src/surf/ns3/ns3_simulator.cpp + src/kernel/resource/models/ns3/ns3_simulator.cpp ) set(SURF_SRC @@ -360,11 +361,11 @@ set(SURF_SRC src/kernel/timer/Timer.cpp - src/surf/sg_platf.cpp - src/surf/xml/platf.hpp - src/surf/xml/platf_private.hpp - src/surf/xml/surfxml_parseplatf.cpp - src/surf/xml/surfxml_sax_cb.cpp + src/kernel/xml/platf.hpp + src/kernel/xml/platf_private.hpp + src/kernel/xml/sg_platf.cpp + src/kernel/xml/surfxml_parseplatf.cpp + src/kernel/xml/surfxml_sax_cb.cpp ) if (Eigen3_FOUND) set(SURF_SRC @@ -985,7 +986,6 @@ set(CMAKEFILES_TXT teshsuite/smpi/mpich3-test/rma/CMakeLists.txt teshsuite/smpi/mpich3-test/topo/CMakeLists.txt - teshsuite/surf/CMakeLists.txt teshsuite/xbt/CMakeLists.txt tools/CMakeLists.txt tools/graphicator/CMakeLists.txt diff --git a/tools/cmake/Distrib.cmake b/tools/cmake/Distrib.cmake index 9ce7f2b516..61aa173470 100644 --- a/tools/cmake/Distrib.cmake +++ b/tools/cmake/Distrib.cmake @@ -205,14 +205,6 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_NAME}-${release_version}/) add_dependencies(dist dist-dir) -if(NOT enable_maintainer_mode) - add_custom_target(echo-dist - COMMAND ${CMAKE_COMMAND} -E echo "WARNING: ----------------------------------------------------" - COMMAND ${CMAKE_COMMAND} -E echo "WARNING: Distrib is generated without option maintainer mode " - COMMAND ${CMAKE_COMMAND} -E echo "WARNING: ----------------------------------------------------") - add_dependencies(dist echo-dist) -endif() - ########################################### ### Fill in the "make distcheck" target ### ########################################### diff --git a/tools/cmake/Flags.cmake b/tools/cmake/Flags.cmake index 5d5a132b0c..796fec4290 100644 --- a/tools/cmake/Flags.cmake +++ b/tools/cmake/Flags.cmake @@ -218,11 +218,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE") endif() -# Avoid a failure seen with some combinations of compiler and ns3 versions -if(enable_ns3) - set_source_files_properties(src/kernel/resource/models/network_ns3.cpp PROPERTIES COMPILE_FLAGS " -Wno-unused-local-typedef") -endif() - set(TESH_OPTION "") if(enable_coverage) find_program(GCOV_PATH NAMES ENV{GCOV} gcov) diff --git a/tools/cmake/MaintainerMode.cmake b/tools/cmake/MaintainerMode.cmake index 56f5d958e6..b31d336099 100644 --- a/tools/cmake/MaintainerMode.cmake +++ b/tools/cmake/MaintainerMode.cmake @@ -135,20 +135,20 @@ if(enable_maintainer_mode) set(string14 "'\\!^ \\* Generated [0-9/]\\{10\\} [0-9:]\\{8\\}\\.$$!d'") ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h + OUTPUT ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.h ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.h - ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c + ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.c ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.c - DEPENDS ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd + DEPENDS ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid.dtd ${CMAKE_HOME_DIRECTORY}/src/dag/dax.dtd - #${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/surf/xml - COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P simgrid_parse --sysid=https://simgrid.org/simgrid.dtd -S src/surf/xml/simgrid_dtd.l -L src/surf/xml/simgrid.dtd - COMMAND ${PERL_EXE} ${CMAKE_HOME_DIRECTORY}/tools/cmake/scripts/fixup_simgrid_dtd_l.pl < src/surf/xml/simgrid_dtd.l > src/surf/xml/simgrid_dtd.l.tmp - COMMAND mv src/surf/xml/simgrid_dtd.l.tmp src/surf/xml/simgrid_dtd.l - COMMAND ${CMAKE_COMMAND} -E echo " Generated src/surf/xml/simgrid_dtd.l" + #${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid.dtd + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/kernel/xml + COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P simgrid_parse --sysid=https://simgrid.org/simgrid.dtd -S src/kernel/xml/simgrid_dtd.l -L src/kernel/xml/simgrid.dtd + COMMAND ${PERL_EXE} ${CMAKE_HOME_DIRECTORY}/tools/cmake/scripts/fixup_simgrid_dtd_l.pl < src/kernel/xml/simgrid_dtd.l > src/kernel/xml/simgrid_dtd.l.tmp + COMMAND mv src/kernel/xml/simgrid_dtd.l.tmp src/kernel/xml/simgrid_dtd.l + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/kernel/xml/simgrid_dtd.l" #${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/dag/dax.dtd COMMAND ${FLEXML_EXE} -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S src/dag/dax_dtd.l -L src/dag/dax.dtd @@ -156,15 +156,14 @@ if(enable_maintainer_mode) COMMAND ${SED_EXE} -i ${string14} src/dag/dax_dtd.l COMMAND ${CMAKE_COMMAND} -E echo " Generated src/dag/dax_dtd.l" - #${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd - COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid.h - COMMAND ${FLEXML_EXE} --root-tags platform -P simgrid_parse --sysid=https://simgrid.org/simgrid.dtd -H src/surf/xml/simgrid_dtd.h -L src/surf/xml/simgrid.dtd - COMMAND ${SED_EXE} -i ${string1} src/surf/xml/simgrid_dtd.h - COMMAND ${SED_EXE} -i ${string2} src/surf/xml/simgrid_dtd.h - COMMAND ${SED_EXE} -i ${string3} src/surf/xml/simgrid_dtd.h - COMMAND ${SED_EXE} -i ${string4} src/surf/xml/simgrid_dtd.h - COMMAND ${SED_EXE} -i ${string14} src/surf/xml/simgrid_dtd.h - COMMAND ${CMAKE_COMMAND} -E echo " Generated src/surf/xml/simgrid_dtd.h" + #${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid.dtd + COMMAND ${FLEXML_EXE} --root-tags platform -P simgrid_parse --sysid=https://simgrid.org/simgrid.dtd -H src/kernel/xml/simgrid_dtd.h -L src/kernel/xml/simgrid.dtd + COMMAND ${SED_EXE} -i ${string1} src/kernel/xml/simgrid_dtd.h + COMMAND ${SED_EXE} -i ${string2} src/kernel/xml/simgrid_dtd.h + COMMAND ${SED_EXE} -i ${string3} src/kernel/xml/simgrid_dtd.h + COMMAND ${SED_EXE} -i ${string4} src/kernel/xml/simgrid_dtd.h + COMMAND ${SED_EXE} -i ${string14} src/kernel/xml/simgrid_dtd.h + COMMAND ${CMAKE_COMMAND} -E echo " Generated src/kernel/xml/simgrid_dtd.h" #${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/dag/dax.dtd COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.h @@ -174,10 +173,10 @@ if(enable_maintainer_mode) COMMAND ${SED_EXE} -i ${string14} src/dag/dax_dtd.h COMMAND ${CMAKE_COMMAND} -E echo " Generated src/dag/dax_dtd.h" - #surf/xml/simgrid_dtd.c: surf/xml/simgrid_dtd.l - COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c - COMMAND ${FLEX_EXE} -o src/surf/xml/simgrid_dtd.c -Psurf_parse_ --noline src/surf/xml/simgrid_dtd.l - COMMAND ${CMAKE_COMMAND} -E echo " Generated surf/xml/simgrid_dtd.c" + #kernel/xml/simgrid_dtd.c: kernel/xml/simgrid_dtd.l + COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.c + COMMAND ${FLEX_EXE} -o src/kernel/xml/simgrid_dtd.c -Psimgrid_parse_ --noline src/kernel/xml/simgrid_dtd.l + COMMAND ${CMAKE_COMMAND} -E echo " Generated kernel/xml/simgrid_dtd.c" #dag/dax_dtd.c: dag/dax_dtd.l COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.c @@ -206,8 +205,8 @@ if(enable_maintainer_mode) endif() add_custom_target(maintainer_files - DEPENDS ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h - ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c + DEPENDS ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.h + ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.c ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.h ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.c ) diff --git a/tools/cmake/scripts/fixup_simgrid_dtd_l.pl b/tools/cmake/scripts/fixup_simgrid_dtd_l.pl index bbf0c17ed5..7a2d251526 100755 --- a/tools/cmake/scripts/fixup_simgrid_dtd_l.pl +++ b/tools/cmake/scripts/fixup_simgrid_dtd_l.pl @@ -15,7 +15,7 @@ while (<>) { # Completely rewrite the error handling mechanism to use exceptions instead of printing to stderr if (/fprintf.stderr, .*? flexml_err_msg.;/) { - print(' surf_parse_error(flexml_err_msg);'."\n"); + print(' simgrid_parse_error(flexml_err_msg);'."\n"); next; }