From 17288b1b642b369a5377677875d08a82d37a5f67 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 28 Mar 2021 15:50:57 +0200 Subject: [PATCH] Remove deprecated features for next release. --- MANIFEST.in | 1 - docs/source/Doxyfile | 1 - include/simgrid/Exception.hpp | 5 -- include/simgrid/host.h | 4 -- include/simgrid/simix.h | 6 -- include/xbt/base.h | 2 - include/xbt/synchro.h | 117 ------------------------------- src/plugins/host_energy.cpp | 65 ----------------- src/s4u/s4u_Host.cpp | 12 ---- src/simix/libsmx.cpp | 10 --- tools/cmake/DefinePackages.cmake | 1 - 11 files changed, 224 deletions(-) delete mode 100644 include/xbt/synchro.h diff --git a/MANIFEST.in b/MANIFEST.in index d97b8e53f9..f45069bd88 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2051,7 +2051,6 @@ include include/xbt/replay.hpp include include/xbt/signal.hpp include include/xbt/str.h include include/xbt/string.hpp -include include/xbt/synchro.h include include/xbt/sysdep.h include include/xbt/system_error.hpp include include/xbt/utility.hpp diff --git a/docs/source/Doxyfile b/docs/source/Doxyfile index e352050b3e..588e2ae1d7 100644 --- a/docs/source/Doxyfile +++ b/docs/source/Doxyfile @@ -63,7 +63,6 @@ PREDEFINED += \ XBT_ATTRIB_NORETURN= \ XBT_ATTRIB_UNUSED= \ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s,c,l)= \ - XBT_ATTRIB_DEPRECATED_v328(m)= \ XBT_ATTRIB_DEPRECATED_v329(m)= \ XBT_ATTRIB_DEPRECATED_v330(m)= \ XBT_ATTRIB_DEPRECATED_v331(m)= diff --git a/include/simgrid/Exception.hpp b/include/simgrid/Exception.hpp index 000a0e206b..fa3d7aa1fb 100644 --- a/include/simgrid/Exception.hpp +++ b/include/simgrid/Exception.hpp @@ -123,8 +123,6 @@ private: /** Exception raised when a timeout elapsed */ DECLARE_SIMGRID_EXCEPTION(TimeoutException); -using TimeoutError XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::TimeoutException") = TimeoutException; - /** Exception raised when a host fails */ DECLARE_SIMGRID_EXCEPTION(HostFailureException); @@ -194,7 +192,4 @@ private: }; } // namespace simgrid - -using xbt_ex XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::Exception") = simgrid::Exception; - #endif diff --git a/include/simgrid/host.h b/include/simgrid/host.h index ced19beee4..d8ff8f4e6a 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -46,7 +46,6 @@ XBT_PUBLIC const char* sg_host_get_name(const_sg_host_t host); */ XBT_PUBLIC void* sg_host_get_data(const_sg_host_t host); XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_data()") XBT_PUBLIC void* sg_host_data(const_sg_host_t host); -XBT_ATTRIB_DEPRECATED_v328("Please use sg_host_get_data()") XBT_PUBLIC void* sg_host_user(sg_host_t host); /** @brief Set the user data of a #sg_host_t. * * This functions attach @a data to @a host. @@ -54,9 +53,6 @@ XBT_ATTRIB_DEPRECATED_v328("Please use sg_host_get_data()") XBT_PUBLIC void* sg_ XBT_PUBLIC void sg_host_set_data(sg_host_t host, void* userdata); XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_set_data()") XBT_PUBLIC void sg_host_data_set(sg_host_t host, void* userdata); -XBT_ATTRIB_DEPRECATED_v328("Please use sg_host_set_data()") XBT_PUBLIC - void sg_host_user_set(sg_host_t host, void* userdata); -XBT_ATTRIB_DEPRECATED_v328("Please use sg_host_set_data(h, NULL)") XBT_PUBLIC void sg_host_user_destroy(sg_host_t host); #endif // ========= storage related functions ============ diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index cfd127b02f..189c36b47b 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -130,12 +130,6 @@ XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Exec::test()") XBT_PUBLIC SG_BEGIN_DECL XBT_ATTRIB_DEPRECATED_v329("This function will be removed") void simcall_process_set_data(smx_actor_t process, void* data); -XBT_ATTRIB_DEPRECATED_v328("Please use sg_actor_suspend()") XBT_PUBLIC - void simcall_process_suspend(smx_actor_t process); - -XBT_ATTRIB_DEPRECATED_v328("Please use sg_actor_join()") XBT_PUBLIC - void simcall_process_join(smx_actor_t process, double timeout); - XBT_ATTRIB_DEPRECATED_v329("Please use sg_actor_sleep_for()") XBT_PUBLIC #ifdef __cplusplus simgrid::kernel::activity::State diff --git a/include/xbt/base.h b/include/xbt/base.h index a04230bdce..dec1d63bf7 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_v328(mesg) \ - XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.27)") #define XBT_ATTRIB_DEPRECATED_v329(mesg) \ XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.28)") #define XBT_ATTRIB_DEPRECATED_v330(mesg) \ diff --git a/include/xbt/synchro.h b/include/xbt/synchro.h deleted file mode 100644 index 62f34ec19f..0000000000 --- a/include/xbt/synchro.h +++ /dev/null @@ -1,117 +0,0 @@ -/* xbt/synchro.h -- Simulated synchronization */ - -/* Copyright (c) 2009-2021. The SimGrid Team. */ - -/* 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 XBT_SYNCHRO_H -#define XBT_SYNCHRO_H - -#include "simgrid/cond.h" -#include "simgrid/mutex.h" -#include /* SG_BEGIN_DECL */ - -#warning xbt/synchro.h is deprecated and will be removed in v3.28. - -SG_BEGIN_DECL - -/** @addtogroup XBT_synchro - * @brief XBT synchronization tools - * - * This section describes the simulated synchronization mechanisms, - * that you can use in your simulation without deadlocks. See @ref - * faq_MIA_thread_synchronization for details. - * - * @{ - */ - -/** @brief Thread mutex data type (opaque object) - * @hideinitializer - */ -typedef sg_mutex_t xbt_mutex_t; - -/** @brief Creates a new mutex variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_mutex_init") static inline xbt_mutex_t xbt_mutex_init(void) -{ - return sg_mutex_init(); -} - -/** @brief Blocks onto the given mutex variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_mutex_lock") static inline void xbt_mutex_acquire(xbt_mutex_t mutex) -{ - sg_mutex_lock(mutex); -} - -/** @brief Tries to block onto the given mutex variable - * Tries to lock a mutex, return 1 if the mutex is unlocked, else 0. - * This function does not block and wait for the mutex to be unlocked. - * @param mutex The mutex - * @return 1 - mutex free, 0 - mutex used - */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_mutex_try_lock") static inline int xbt_mutex_try_acquire(xbt_mutex_t mutex) -{ - return sg_mutex_try_lock(mutex); -} - -/** @brief Releases the given mutex variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_mutex_unlock") static inline void xbt_mutex_release(xbt_mutex_t mutex) -{ - sg_mutex_unlock(mutex); -} - -/** @brief Destroys the given mutex variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_mutex_destroy") static inline void xbt_mutex_destroy(xbt_mutex_t mutex) -{ - sg_mutex_destroy(mutex); -} - -/** @brief Thread condition data type (opaque object) - * @hideinitializer - */ -typedef sg_cond_t xbt_cond_t; - -/** @brief Creates a condition variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_init") static inline xbt_cond_t xbt_cond_init(void) -{ - return sg_cond_init(); -} - -/** @brief Blocks onto the given condition variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_wait") static inline void xbt_cond_wait(xbt_cond_t cond, - xbt_mutex_t mutex) -{ - sg_cond_wait(cond, mutex); -} - -/** @brief Blocks onto the given condition variable, but only for the given amount of time. - * @return 0 on success, 1 on timeout */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_wait_for") static inline int xbt_cond_timedwait(xbt_cond_t cond, - xbt_mutex_t mutex, - double delay) -{ - return sg_cond_wait_for(cond, mutex, delay); -} - -/** @brief Signals the given mutex variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_notify_one") static inline void xbt_cond_signal(xbt_cond_t cond) -{ - sg_cond_notify_one(cond); -} - -/** @brief Broadcasts the given mutex variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_notify_all") static inline void xbt_cond_broadcast(xbt_cond_t cond) -{ - sg_cond_notify_all(cond); -} - -/** @brief Destroys the given mutex variable */ -XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_destroy") static inline void xbt_cond_destroy(xbt_cond_t cond) -{ - sg_cond_destroy(cond); -} - -/** @} */ - -SG_END_DECL -#endif /* XBT_SYNCHRO_H */ diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index a1033c8b06..906718ef52 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -206,15 +206,6 @@ HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host_(ptr) init_watts_range_list(); const char* off_power_str = host_->get_property("wattage_off"); - if (off_power_str == nullptr) { - off_power_str = host_->get_property("watt_off"); - - static bool warned = false; - if (off_power_str != nullptr && not warned) { - warned = true; - XBT_WARN("Please use 'wattage_off' instead of 'watt_off' to define the idle wattage of hosts in your XML."); - } - } if (off_power_str != nullptr) { try { this->watts_off_ = std::stod(std::string(off_power_str)); @@ -340,62 +331,6 @@ double HostEnergy::get_consumed_energy() void HostEnergy::init_watts_range_list() { - const char* old_prop = host_->get_property("watt_per_state"); - if (old_prop != nullptr) { - std::vector all_power_values; - boost::split(all_power_values, old_prop, boost::is_any_of(",")); - - xbt_assert(all_power_values.size() == (unsigned)host_->get_pstate_count(), - "Invalid XML file. Found %zu energetic profiles for %d pstates", all_power_values.size(), - host_->get_pstate_count()); - - // XBT_ATTRIB_DEPRECATED_v328: putting this macro name here so that we find it during the deprecation cleanups - std::string msg = "DEPRECATION WARNING: Property 'watt_per_state' will only work until v3.28.\n"; - msg += std::string("The old syntax 'Idle:OneCore:AllCores' must be converted into 'Idle:Epsilon:AllCores' to " - "properly model the consumption of non-whole tasks on mono-core hosts. Here are the values to " - "use for host '") + - host_->get_cname() + "' in your XML file:\n"; - msg += " current_power_values; - boost::split(current_power_values, current_power_values_str, boost::is_any_of(":")); - double p_idle = xbt_str_parse_double((current_power_values.at(0)).c_str(), - "Invalid obsolete XML file. Fix your watt_per_state property."); - double p_full; - double p_epsilon; - - if (current_power_values.size() == 3) { - double p_one_core = xbt_str_parse_double((current_power_values.at(1)).c_str(), - "Invalid obsolete XML file. Fix your watt_per_state property."); - p_full = xbt_str_parse_double((current_power_values.at(2)).c_str(), - "Invalid obsolete XML file. Fix your watt_per_state property."); - if (host_->get_core_count() == 1) { - p_epsilon = p_full; - } else { - p_epsilon = p_one_core - ((p_full - p_one_core) / (host_->get_core_count() - 1)); - } - } else { // consumption given with idle and full only - p_full = xbt_str_parse_double((current_power_values.at(1)).c_str(), - "Invalid obsolete XML file. Fix your watt_per_state property."); - if (host_->get_core_count() == 1) { - p_epsilon = p_full; - } else { - p_epsilon = p_idle; - } - } - - PowerRange range(p_idle, p_epsilon, p_full); - power_range_watts_list_.push_back(range); - - msg += std::to_string(p_idle) + ":" + std::to_string(p_epsilon) + ":" + std::to_string(p_full); - msg += ","; - } - msg.pop_back(); // Remove the extraneous ',' - msg += "\" />"; - XBT_WARN("%s", msg.c_str()); - return; - } - const char* all_power_values_str = host_->get_property("wattage_per_state"); if (all_power_values_str == nullptr) { /* If no power values are given, we assume it's 0 everywhere */ diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index ab974c3b0c..918d7574e4 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -395,18 +395,6 @@ void sg_host_data_set(sg_host_t host, void* userdata) // XBT_ATTRIB_DEPRECATED_v { sg_host_set_data(host, userdata); } -void* sg_host_user(sg_host_t host) // XBT_ATTRIB_DEPRECATED_v328 -{ - return host->get_data(); -} -void sg_host_user_set(sg_host_t host, void* userdata) // XBT_ATTRIB_DEPRECATED_v328 -{ - host->set_data(userdata); -} -void sg_host_user_destroy(sg_host_t host) // XBT_ATTRIB_DEPRECATED_v328 -{ - host->set_data(nullptr); -} // ========= Disk related functions ============ void sg_host_get_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks) diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index c3290854ae..41a204bbf7 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -71,16 +71,6 @@ unsigned int simcall_execution_waitany_for(simgrid::kernel::activity::ExecImpl* &observer); } -void simcall_process_join(smx_actor_t process, double timeout) // XBT_ATTRIB_DEPRECATED_v328 -{ - simgrid::kernel::actor::ActorImpl::self()->join(process, timeout); -} - -void simcall_process_suspend(smx_actor_t process) // XBT_ATTRIB_DEPRECATED_v328 -{ - process->get_iface()->suspend(); -} - simgrid::kernel::activity::State simcall_process_sleep(double duration) // XBT_ATTRIB_DEPRECATED_v329 { simgrid::kernel::actor::ActorImpl::self()->sleep(duration); diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 3007a3a065..f2c8d7e3a5 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -770,7 +770,6 @@ set(headers_to_install include/xbt/signal.hpp include/xbt/str.h include/xbt/string.hpp - include/xbt/synchro.h include/xbt/sysdep.h include/xbt/system_error.hpp include/xbt/utility.hpp -- 2.20.1