From 768866d55ef9d86790049e605bc2f6c62f59199c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 22 Mar 2022 13:54:44 +0100 Subject: [PATCH] Remove deprecated features for next release (3.32). FIXME: NetZoneImpl::on_route_creation is not removed. --- docs/source/Doxyfile | 1 - include/simgrid/s4u/Comm.hpp | 23 ---------------- include/simgrid/s4u/Exec.hpp | 7 ----- include/simgrid/s4u/NetZone.hpp | 36 +------------------------ include/simgrid/s4u/VirtualMachine.hpp | 3 --- include/simgrid/simix.h | 4 --- include/xbt/base.h | 2 -- src/bindings/python/simgrid_python.cpp | 7 +++-- src/kernel/EngineImpl.cpp | 8 ------ src/kernel/routing/RoutedZone.cpp | 2 -- src/s4u/s4u_Engine.cpp | 5 ---- src/s4u/s4u_Netzone.cpp | 37 -------------------------- 12 files changed, 4 insertions(+), 131 deletions(-) diff --git a/docs/source/Doxyfile b/docs/source/Doxyfile index 35eefa048e..cc03b94436 100644 --- a/docs/source/Doxyfile +++ b/docs/source/Doxyfile @@ -69,7 +69,6 @@ PREDEFINED += \ XBT_ATTRIB_NORETURN= \ XBT_ATTRIB_UNUSED= \ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname,parent,desc)= \ - XBT_ATTRIB_DEPRECATED_v332(mesg)= \ XBT_ATTRIB_DEPRECATED_v333(mesg)= \ XBT_ATTRIB_DEPRECATED_v334(mesg)= \ XBT_ATTRIB_DEPRECATED_v335(mesg)= diff --git a/include/simgrid/s4u/Comm.hpp b/include/simgrid/s4u/Comm.hpp index 60705438ff..d2ca5481d1 100644 --- a/include/simgrid/s4u/Comm.hpp +++ b/include/simgrid/s4u/Comm.hpp @@ -176,29 +176,6 @@ public: /*! Same as wait_all, but with a timeout. Return the number of terminated comm (less than comms.size() if the timeout * occurs). */ static size_t wait_all_for(const std::vector& comms, double timeout); - -#ifndef DOXYGEN - XBT_ATTRIB_DEPRECATED_v332("Please use a plain vector for parameter") static int wait_any( - const std::vector* comms) - { - return static_cast(wait_any_for(*comms, -1)); - } - XBT_ATTRIB_DEPRECATED_v332("Please use a plain vector for first parameter") static int wait_any_for( - const std::vector* comms, double timeout) - { - return static_cast(wait_any_for(*comms, timeout)); - } - XBT_ATTRIB_DEPRECATED_v332("Please use a plain vector for parameter") static void wait_all( - const std::vector* comms) - { - wait_all(*comms); - } - XBT_ATTRIB_DEPRECATED_v332("Please use a plain vector for parameter") static int test_any( - const std::vector* comms) - { - return static_cast(test_any(*comms)); - } -#endif }; } // namespace s4u } // namespace simgrid diff --git a/include/simgrid/s4u/Exec.hpp b/include/simgrid/s4u/Exec.hpp index 3458593e8e..b0cdbf259f 100644 --- a/include/simgrid/s4u/Exec.hpp +++ b/include/simgrid/s4u/Exec.hpp @@ -61,13 +61,6 @@ public: /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/ static ssize_t wait_any_for(const std::vector& execs, double timeout); -#ifndef DOXYGEN - XBT_ATTRIB_DEPRECATED_v332("Please use a plain vector for parameter") - static int wait_any(std::vector* execs) { return static_cast(wait_any_for(*execs, -1)); } - XBT_ATTRIB_DEPRECATED_v332("Please use a plain vector for first parameter") - static int wait_any_for(std::vector* execs, double timeout) { return static_cast(wait_any_for(*execs, timeout)); } -#endif - /** @brief On sequential executions, returns the amount of flops that remain to be done; This cannot be used on * parallel executions. */ double get_remaining() const override; diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index 1eadf706b3..bb6fb7fcb9 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -59,11 +59,6 @@ public: /** @brief Get the netpoint associated to this netzone */ kernel::routing::NetPoint* get_netpoint(); -#ifndef DOXYGEN - XBT_ATTRIB_DEPRECATED_v332("Please use set_parent() to manage NetZone's relationship") NetZone* add_child( - NetZone* new_zone); -#endif - void extract_xbt_graph(const s_xbt_graph_t* graph, std::map>* nodes, std::map>* edges); @@ -87,34 +82,12 @@ public: void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, const std::vector& link_list, bool symmetrical = true); -#ifndef DOXYGEN - XBT_ATTRIB_DEPRECATED_v332( - "Please use add_route() method which uses s4u::LinkInRoute instead of " - "LinkImpl") void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - const std::vector& link_list, bool symmetrical); - - XBT_ATTRIB_DEPRECATED_v332( - "Please use add_bypass_route() method which uses s4u::LinkInRoute instead of " - "LinkImpl") void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - const std::vector& link_list, - bool /*symmetrical*/); -#endif - void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, const std::vector& link_list); -#ifndef DOXYGEN - /*** Called on each newly created regular route (not on bypass routes) */ - static xbt::signal const& link_list)> - on_route_creation; // XBT_ATTRIB_DEPRECATED_v332 : should not be used by users, used by ns3.. if necessary, - // signal shouldn't use LinkImpl* - private: +#ifndef DOXYGEN static xbt::signal on_creation; static xbt::signal on_seal; #endif @@ -180,13 +153,6 @@ public: /** @brief Seal this netzone configuration */ NetZone* seal(); - -private: -#ifndef DOXYGEN - /** @brief XBT_ATTRIB_DEPRECATED_v332 Auxiliary function to convert types */ - static std::vector - convert_to_linkInRoute(const std::vector& link_list); -#endif }; // External constructors so that the types (and the types of their content) remain hidden diff --git a/include/simgrid/s4u/VirtualMachine.hpp b/include/simgrid/s4u/VirtualMachine.hpp index 8a7a33cd6d..f902d648cb 100644 --- a/include/simgrid/s4u/VirtualMachine.hpp +++ b/include/simgrid/s4u/VirtualMachine.hpp @@ -61,9 +61,6 @@ public: SUSPENDED, /**< Suspend/resume does not involve disk I/O, so we assume there is no transition states. */ DESTROYED ); -#ifndef DOXYGEN - using state XBT_ATTRIB_DEPRECATED_v332("Please use VirtualMachine::State") = State; -#endif kernel::resource::VirtualMachineImpl* get_vm_impl() const { return pimpl_vm_; } void start(); diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 4d77ec2eb6..a7b67054ab 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -35,10 +35,6 @@ XBT_ATTRIB_DEPRECATED_v333("Please use Actor::is_maestro()") XBT_PUBLIC int SIMI XBT_ATTRIB_DEPRECATED_v333("Please use simgrid_set_maestro()") XBT_PUBLIC void SIMIX_set_maestro(void (*code)(void*), void* data); -/* Simulation execution */ -XBT_ATTRIB_DEPRECATED_v332("Please use EngineImpl:run()") XBT_PUBLIC void SIMIX_run(); -XBT_ATTRIB_DEPRECATED_v332("Please use simgrid_get_clock() or Engine::get_clock()") XBT_PUBLIC double SIMIX_get_clock(); - SG_END_DECL /********************************* Process ************************************/ diff --git a/include/xbt/base.h b/include/xbt/base.h index 8698afe6de..3f680db449 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -53,8 +53,6 @@ #define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg))) #endif -#define XBT_ATTRIB_DEPRECATED_v332(mesg) \ - XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.31)") #define XBT_ATTRIB_DEPRECATED_v333(mesg) \ XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.32)") #define XBT_ATTRIB_DEPRECATED_v334(mesg) \ diff --git a/src/bindings/python/simgrid_python.cpp b/src/bindings/python/simgrid_python.cpp index d08e791dca..c7762da72c 100644 --- a/src/bindings/python/simgrid_python.cpp +++ b/src/bindings/python/simgrid_python.cpp @@ -719,9 +719,8 @@ PYBIND11_MODULE(simgrid, m) py::return_value_policy::reference_internal, py::call_guard(), "Start the comm, and ignore its result. It can be completely forgotten after that.") - // use py::overload_cast for wait_all/wait_any, until the overload marked XBT_ATTRIB_DEPRECATED_v332 is removed .def_static( - "wait_all", py::overload_cast&>(&simgrid::s4u::Comm::wait_all), + "wait_all", &simgrid::s4u::Comm::wait_all, py::arg("comms"), py::call_guard(), "Block until the completion of all communications in the list.") @@ -731,13 +730,13 @@ PYBIND11_MODULE(simgrid, m) "Block until the completion of all communications in the list, or raises TimeoutException after " "the specified timeout.") .def_static( - "wait_any", py::overload_cast&>(&simgrid::s4u::Comm::wait_any), + "wait_any", &simgrid::s4u::Comm::wait_any, py::arg("comms"), py::call_guard(), "Block until the completion of any communication in the list and return the index of the terminated one.") .def_static( "wait_any_for", - py::overload_cast&, double>(&simgrid::s4u::Comm::wait_any_for), + &simgrid::s4u::Comm::wait_any_for, py::arg("comms"), py::arg("timeout"), py::call_guard(), "Block until the completion of any communication in the list and return the index of the terminated " diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index bb3d098cfa..6572a174e4 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -10,9 +10,6 @@ #include #include -#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v332) -#include - #include "mc/mc.h" #include "src/kernel/EngineImpl.hpp" #include "src/kernel/resource/StandardLinkImpl.hpp" @@ -769,8 +766,3 @@ double EngineImpl::get_clock() } } // namespace kernel } // namespace simgrid - -void SIMIX_run() // XBT_ATTRIB_DEPRECATED_v332 -{ - simgrid::kernel::EngineImpl::get_instance()->run(-1); -} diff --git a/src/kernel/routing/RoutedZone.cpp b/src/kernel/routing/RoutedZone.cpp index 021c7b8b4e..ebdeeee108 100644 --- a/src/kernel/routing/RoutedZone.cpp +++ b/src/kernel/routing/RoutedZone.cpp @@ -165,7 +165,6 @@ void RoutedZone::add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* xbt_assert(not dst->is_netzone(), "When defining a route, dst cannot be a netzone such as '%s'. Did you meant to have a NetzoneRoute?", dstName); - s4u::NetZone::on_route_creation(symmetrical, src, dst, gw_src, gw_dst, get_link_list_impl(link_list, false)); NetZoneImpl::on_route_creation(symmetrical, src, dst, gw_src, gw_dst, get_link_list_impl(link_list, false)); } else { XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", srcName, gw_src->get_cname(), dstName, gw_dst->get_cname()); @@ -196,7 +195,6 @@ void RoutedZone::add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* "Invalid NetzoneRoute from %s@%s to %s@%s: gw_dst %s belongs to %s, not to %s.", srcName, gw_src->get_cname(), dstName, gw_dst->get_cname(), gw_dst->get_cname(), gw_dst->get_englobing_zone()->get_cname(), dst->get_cname()); - s4u::NetZone::on_route_creation(symmetrical, gw_src, gw_dst, gw_src, gw_dst, get_link_list_impl(link_list, false)); NetZoneImpl::on_route_creation(symmetrical, gw_src, gw_dst, gw_src, gw_dst, get_link_list_impl(link_list, false)); } } diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index ea62433321..9f4dd40973 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -462,11 +462,6 @@ Engine* Engine::set_default_comm_data_copy_callback( } // namespace s4u } // namespace simgrid -double SIMIX_get_clock() // XBT_ATTRIB_DEPRECATED_v332 -{ - return simgrid::s4u::Engine::get_clock(); -} - /* **************************** Public C interface *************************** */ void simgrid_init(int* argc, char** argv) { diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index 06950ef004..699116c9ed 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -18,10 +18,6 @@ namespace simgrid { namespace s4u { -xbt::signal const& link_list)> - NetZone::on_route_creation; xbt::signal NetZone::on_creation; xbt::signal NetZone::on_seal; @@ -50,12 +46,6 @@ std::vector NetZone::get_children() const return res; } -NetZone* NetZone::add_child(NetZone* new_zone) // XBT_ATTRIB_DEPRECATED_v332 -{ - new_zone->set_parent(this); - return this; -} - const std::string& NetZone::get_name() const { return pimpl_->get_name(); @@ -97,17 +87,6 @@ unsigned long NetZone::add_component(kernel::routing::NetPoint* elm) return pimpl_->add_component(elm); } -// XBT_ATTRIB_DEPRECATED_v332 -std::vector -NetZone::convert_to_linkInRoute(const std::vector& link_list) -{ - std::vector links; - for (const auto* link : link_list) { - links.emplace_back(LinkInRoute(link->get_iface())); - } - return links; -} - void NetZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, const std::vector& link_list, bool symmetrical) @@ -115,22 +94,6 @@ void NetZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoin pimpl_->add_route(src, dst, gw_src, gw_dst, link_list, symmetrical); } -// XBT_ATTRIB_DEPRECATED_v332 -void NetZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - const std::vector& link_list, bool symmetrical) -{ - pimpl_->add_route(src, dst, gw_src, gw_dst, convert_to_linkInRoute(link_list), symmetrical); -} - -// XBT_ATTRIB_DEPRECATED_v332 -void NetZone::add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - const std::vector& link_list, bool /*symmetrical*/) -{ - pimpl_->add_bypass_route(src, dst, gw_src, gw_dst, convert_to_linkInRoute(link_list)); -} - void NetZone::add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, const std::vector& link_list) -- 2.20.1