From 3ef6ce6e499e5400eea06facd1896d1b5e94fde9 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 28 Jan 2016 21:11:37 +0100 Subject: [PATCH 1/1] Kill all deprecated code in MSG -- yeah --- ChangeLog | 6 +- doc/Doxyfile.in | 3 +- doc/doxygen/FAQ.doc | 63 ++------ doc/doxygen/install.doc | 6 - doc/doxygen/module-msg.doc | 14 -- include/simgrid/msg.h | 71 --------- src/msg/msg_global.cpp | 45 ------ src/msg/msg_gos.cpp | 317 ------------------------------------- src/msg/msg_host.cpp | 39 ----- src/msg/msg_mailbox.cpp | 13 -- src/msg/msg_mailbox.h | 18 --- src/msg/msg_private.h | 17 +- tools/cmake/GCCFlags.cmake | 4 - tools/cmake/Option.cmake | 1 - 14 files changed, 16 insertions(+), 601 deletions(-) diff --git a/ChangeLog b/ChangeLog index a19ce2e43a..5fe765cbaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,11 @@ SimGrid (3.13) UNRELEASED; urgency=low * s4u::Host is now the prefered public interface to the Host features. sg_host_* functions are C bindings to the exact same behavior MSG_host_* and SD_workstation_* are #define to the sg_host_* ones - + + MSG + * Kill all deprecated functions. They were deprecated since a few + releases anyway, and probably did not even compile anymore. + Simix * simgrid::simix::kernel() is the closure callback. It ensures that the lambda or closure passed as a parameter will run in kernel mode. diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 50c7f22ac2..06557c19b3 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1468,8 +1468,7 @@ PREDEFINED = DOXYGEN \ XBT_IMPORT_NO_EXPORT(type)=type \ XBT_PUBLIC_DATA(type)="extern type" \ XBT_PUBLIC_CLASS=class \ - XBT_INLINE= \ - MSG_USE_DEPRECATED + XBT_INLINE= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/doc/doxygen/FAQ.doc b/doc/doxygen/FAQ.doc index f70f833be5..9b1dd1d5e0 100644 --- a/doc/doxygen/FAQ.doc +++ b/doc/doxygen/FAQ.doc @@ -442,18 +442,12 @@ upgrade. Actually, you may want to read it (alongside with the NEWS file that highlights the most important changes) even before you upgrade your copy of SimGrid, too. -Backward compatibility is very important to us, as we want to provide -a scientific tool allowing to evaluate the code you write in several -years, too. That being said, we sometimes change the interface to make -them more usable to the users. When we do so, we always keep the old -interface as DEPRECATED. If you still want to use them, you want to -define the SIMGRID_DEPRECATED preprocessor symbol before loading the -SimGrid files: - -@verbatim -#define SIMGRID_DEPRECATED -#include -@endverbatim +We do our best to maintain the backward compatibility, but we +sometimes have to fix the things that are too broken. If we happen to +kill a feature that you were using, we are sorry. We think that you +should update to the new way of doing things, but if you can't afford +it, that's ok. Just stick to the last version that were working for +you, and have a pleasant day. \subsection faq_trouble_lib_compil SimGrid compilation and installation problems @@ -462,8 +456,9 @@ SimGrid files: We know only one reason for the configure to fail: - You are using a broken build environment\n - If symptom is that the configury magic complains about gcc not being able to build - executables, you are probably missing the libc6-dev package. Damn Ubuntu. + Try updating your cmake version. If symptom is that the configury + magic complains about gcc not being able to build executables, you + are probably missing the libc6-dev package. Damn Ubuntu. If you experience other kind of issue, please get in touch with us. We are always interested in improving our portability to new systems. @@ -502,46 +497,6 @@ of SimGrid), you must absolutely specify -lpthread on the linker command line. As usual, this should come after -lsimgrid on this command line. -\subsubsection faq_trouble_lib_msg_deprecated "gcc: undefined reference to MSG_*" - -Since version 3.7 all the m_channel_t mecanism is deprecated. So functions -about this mecanism may get removed in future releases. - -List of functions: - -\li XBT_PUBLIC(int) MSG_get_host_number(void); - -\li XBT_PUBLIC(m_host_t *) MSG_get_host_table(void); - -\li XBT_PUBLIC(MSG_error_t) MSG_get_errno(void); - -\li XBT_PUBLIC(MSG_error_t) MSG_task_get(m_task_t * task, m_channel_t channel); - -\li XBT_PUBLIC(MSG_error_t) MSG_task_get_with_timeout(m_task_t * task, m_channel_t channel, double max_duration); - -\li XBT_PUBLIC(MSG_error_t) MSG_task_get_from_host(m_task_t * task, int channel, m_host_t host); - -\li XBT_PUBLIC(MSG_error_t) MSG_task_get_ext(m_task_t * task, int channel, double max_duration, m_host_t host); - -\li XBT_PUBLIC(MSG_error_t) MSG_task_put(m_task_t task, m_host_t dest, m_channel_t channel); - -\li XBT_PUBLIC(MSG_error_t) MSG_task_put_bounded(m_task_t task, m_host_t dest, m_channel_t channel, double max_rate); - -\li XBT_PUBLIC(MSG_error_t) MSG_task_put_with_timeout(m_task_t task, m_host_t dest, m_channel_t channel, double max_duration); - -\li XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel); - -\li XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel); - -\li XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, m_host_t host); - -\li XBT_PUBLIC(MSG_error_t) MSG_set_channel_number(int number); - -\li XBT_PUBLIC(int) MSG_get_channel_number(void); - -If you want them you have to compile Simgrid v3.7 with option "-Denable_msg_deprecated=ON". -Using them should print warning to inform what new function you have to use. - \subsection faq_trouble_errors Runtime error messages \subsubsection faq_flexml_limit "surf_parse_lex: Assertion `next limit' failed." diff --git a/doc/doxygen/install.doc b/doc/doxygen/install.doc index ca180b2746..cf3c3ebb55 100644 --- a/doc/doxygen/install.doc +++ b/doc/doxygen/install.doc @@ -182,12 +182,6 @@ accepts several options, as listed below. course, it is then impossible to get any debug message from SimGrid if something goes wrong. - @li enable_msg_deprecated (ON/OFF): enable this option if - your code used a feature of Simgrid that was dropped or modified - in recent releases of SimGrid. You should update your code if - possible, but with this option, SimGrid will try to emulate its - old behavior. - @li enable_model-checking (ON/OFF): Only enable this if you actually plan to use the model-checking aspect of SimGrid. This mode of execution is still under heavy work, but it should be diff --git a/doc/doxygen/module-msg.doc b/doc/doxygen/module-msg.doc index f05e35ff04..dbe02f3071 100644 --- a/doc/doxygen/module-msg.doc +++ b/doc/doxygen/module-msg.doc @@ -31,7 +31,6 @@ us before digging into these badly documented internal modules). - \ref msg_synchro - \ref msg_trace_driven - \ref MSG_examples - - \ref msg_deprecated_functions Also make sure to visit the page @ref MSG_examples. @@ -167,19 +166,6 @@ MSG comes with an extensive set of examples. It is sometimes difficult to find t */ -/** -@defgroup msg_deprecated_functions MSG Deprecated -@ingroup MSG_API -@brief This section describes the deprecated functions. PLEASE STOP USING THEM. - -We don't remove them because the ability to run old scientific -code is something important to us. But these functionalities are -not actively supported anymore. - -To access these functions, you should define the relevant option -at configuration time in ccmake. - */ - diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 52e382b14b..0e03906d65 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -54,10 +54,6 @@ typedef struct s_msg_host_priv { xbt_dict_t affinity_mask_db; xbt_dynar_t file_descriptor_table; - -#ifdef MSG_USE_DEPRECATED - msg_mailbox_t *mailboxes; /**< the channels */ -#endif } s_msg_host_priv_t; /* ******************************** Task ************************************ */ @@ -182,19 +178,6 @@ typedef struct msg_comm *msg_comm_t; */ typedef struct s_smx_process *msg_process_t; -#ifdef MSG_USE_DEPRECATED - -/* Compatibility typedefs */ -typedef int m_channel_t; -typedef msg_gpu_task_t m_gpu_task_t; -typedef msg_host_t m_host_t; -typedef msg_process_t m_process_t; -typedef msg_task_t m_task_t; -typedef s_msg_gpu_task_t s_m_gpu_task_t; -typedef s_msg_host_t s_m_host_t; -typedef s_msg_task_t s_m_task_t; -#endif - /** @brief Return code of most MSG functions @ingroup msg_simulation @{ */ @@ -413,11 +396,6 @@ XBT_PUBLIC(void) MSG_task_set_name(msg_task_t task, const char *name); XBT_PUBLIC(msg_error_t) MSG_task_cancel(msg_task_t task); XBT_PUBLIC(msg_error_t) MSG_task_destroy(msg_task_t task); -XBT_PUBLIC(msg_error_t) MSG_task_receive_from_host(msg_task_t * task, const char *alias, - msg_host_t host); -XBT_PUBLIC(msg_error_t) MSG_task_receive_from_host_bounded(msg_task_t * task, const char *alias, - msg_host_t host, double rate); - XBT_PUBLIC(msg_error_t) MSG_task_execute(msg_task_t task); XBT_PUBLIC(msg_error_t) MSG_parallel_task_execute(msg_task_t task); XBT_PUBLIC(void) MSG_task_set_priority(msg_task_t task, double priority); @@ -530,55 +508,6 @@ XBT_PUBLIC(msg_error_t) MSG_action_trace_run(char *path); XBT_PUBLIC(void) MSG_action_init(void); XBT_PUBLIC(void) MSG_action_exit(void); -#ifdef MSG_USE_DEPRECATED - -typedef msg_error_t MSG_error_t; - -#define MSG_global_init(argc, argv) MSG_init(argc,argv) -#define MSG_global_init_args(argc, argv) MSG_init(argc,argv) - -/* these are the functions which are deprecated. Do not use them, they may get removed in future releases */ -XBT_PUBLIC(msg_host_t *) MSG_get_host_table(void); - -#define MSG_host_is_avail(h) MSG_host_is_on(h) - -#define MSG_TIMEOUT_FAILURE MSG_TIMEOUT -#define MSG_TASK_CANCELLED MSG_TASK_CANCELED -#define MSG_mailbox_put_with_time_out(mailbox, task, timeout) \ - MSG_mailbox_put_with_timeout(mailbox, task, timeout) - -#define MSG_process_change_host(h) MSG_process_migrate(MSG_process_self(),h); -XBT_PUBLIC(msg_error_t) MSG_get_errno(void); - -XBT_PUBLIC(msg_error_t) MSG_clean(void); - -XBT_PUBLIC(msg_error_t) MSG_task_get(msg_task_t * task, m_channel_t channel); -XBT_PUBLIC(msg_error_t) MSG_task_get_with_timeout(msg_task_t * task, - m_channel_t channel, - double max_duration); -XBT_PUBLIC(msg_error_t) MSG_task_get_from_host(msg_task_t * task, - int channel, msg_host_t host); -XBT_PUBLIC(msg_error_t) MSG_task_get_ext(msg_task_t * task, int channel, - double max_duration, - msg_host_t host); -XBT_PUBLIC(msg_error_t) MSG_task_put(msg_task_t task, msg_host_t dest, - m_channel_t channel); -XBT_PUBLIC(msg_error_t) MSG_task_put_bounded(msg_task_t task, - msg_host_t dest, - m_channel_t channel, - double max_rate); -XBT_PUBLIC(msg_error_t) MSG_task_put_with_timeout(msg_task_t task, - msg_host_t dest, - m_channel_t channel, - double max_duration); -XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel); -XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel); -XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, msg_host_t host); - -XBT_PUBLIC(msg_error_t) MSG_set_channel_number(int number); -XBT_PUBLIC(int) MSG_get_channel_number(void); -#endif - /** @brief Opaque type representing a semaphore * @ingroup msg_synchro * @hideinitializer diff --git a/src/msg/msg_global.cpp b/src/msg/msg_global.cpp index 110694e215..bab2b103bc 100644 --- a/src/msg/msg_global.cpp +++ b/src/msg/msg_global.cpp @@ -58,9 +58,6 @@ void MSG_init_nocheck(int *argc, char **argv) { SIMIX_global_init(argc, argv); -#ifdef MSG_USE_DEPRECATED - msg_global->max_channel = 0; -#endif msg_global->sent_msg = 0; msg_global->task_copy_callback = NULL; msg_global->process_data_cleanup = NULL; @@ -85,42 +82,6 @@ void MSG_init_nocheck(int *argc, char **argv) { if(sg_cfg_get_boolean("clean_atexit")) atexit(MSG_exit); } -#ifdef MSG_USE_DEPRECATED - -/* This deprecated function has to be called to fix the number of channel in the - simulation before creating any host. Indeed, each channel is - represented by a different mailbox on each #m_host_t. This - function can then be called only once. This function takes only one - parameter. - * \param number the number of channel in the simulation. It has to be >0 - */ -msg_error_t MSG_set_channel_number(int number) -{ - XBT_WARN("DEPRECATED! Please use aliases instead"); - xbt_assert((msg_global) - && (msg_global->max_channel == 0), - "Channel number already set!"); - - msg_global->max_channel = number; - - return MSG_OK; -} - -/* This deprecated function has to be called once the number of channel is fixed. I can't - figure out a reason why anyone would like to call this function but nevermind. - * \return the number of channel in the simulation. - */ -int MSG_get_channel_number(void) -{ - XBT_WARN("DEPRECATED! Please use aliases instead"); - xbt_assert((msg_global) - && (msg_global->max_channel != 0), - "Channel number not set yet!"); - - return msg_global->max_channel; -} -#endif - /** \ingroup msg_simulation * \brief Launch the MSG simulation */ @@ -193,9 +154,3 @@ unsigned long int MSG_get_sent_msg() { return msg_global->sent_msg; } - -#ifdef MSG_USE_DEPRECATED -msg_error_t MSG_clean(void) { - return MSG_OK; -} -#endif diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index d6e0a6bddb..e89d7d1e79 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -169,64 +169,6 @@ msg_error_t MSG_process_sleep(double nb_sec) MSG_RETURN(status); } -/** \ingroup msg_task_usage - * \brief Deprecated function that used to receive a task from a mailbox from a specific host. - * - * Sorry, this function is not supported anymore. That wouldn't be - * impossible to reimplement it, but we are lacking the time to do so ourselves. - * If you need this functionality, you can either: - * - * - implement the buffering mechanism on the user-level by queuing all messages - * received in the mailbox that do not match your expectation - * - change your application logic to leverage the mailboxes features. For example, - * if you have A receiving messages from B and C, you could have A waiting on - * mailbox "A" most of the time, but on "A#B" when it's waiting for specific - * messages from B and "A#C" when waiting for messages from C. You could even get A - * sometime waiting on all these mailboxes using @ref MSG_comm_waitany. You can find - * an example of use of this function in the @ref MSG_examples section. - * - Provide a proper patch to implement this functionality back in MSG. That wouldn't be - * very difficult actually. Check the function @ref MSG_mailbox_get_task_ext. During its call to - * simcall_comm_recv(), the 5th argument, match_fun, is NULL. Create a function that filters - * messages according to the host (that you will pass as sixth argument to simcall_comm_recv() - * and that your filtering function will receive as first parameter, and then, the filter could - * simply compare the host names, for example. After sufficient testing, provide an example that - * we could add to the distribution, and your first contribution to SimGrid is ready. Thanks in advance. - * - * \param task a memory location for storing a #msg_task_t. - * \param alias name of the mailbox to receive the task from - * \param host a #msg_host_t host from where the task was sent - * - * \return Returns - * #MSG_OK if the task was successfully received, - * #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise. - */ -msg_error_t -MSG_task_receive_from_host(msg_task_t * task, const char *alias, - msg_host_t host) -{ - return MSG_task_receive_ext(task, alias, -1, host); -} - -/** msg_task_usage - *\brief Deprecated function that used to receive a task from a mailbox from a specific host - *\brief at a given rate - * - * \param task a memory location for storing a #msg_task_t. - * \param alias name of the mailbox to receive the task from - * \param host a #msg_host_t host from where the task was sent - * \param rate limit the reception to rate bandwidth - * - * \return Returns - * #MSG_OK if the task was successfully received, - * #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE otherwise. - */ -msg_error_t -MSG_task_receive_from_host_bounded(msg_task_t * task, const char *alias, - msg_host_t host, double rate) -{ - return MSG_task_receive_ext_bounded(task, alias, -1, host, rate); -} - /** \ingroup msg_task_usage * \brief Receives a task from a mailbox. * @@ -1069,262 +1011,3 @@ xbt_dict_t MSG_as_router_get_properties(const char* asr) void MSG_as_router_set_property_value(const char* asr, const char *name, char *value,void_f_pvoid_t free_ctn) { xbt_dict_set(MSG_as_router_get_properties(asr), name, value,free_ctn); } - -#ifdef MSG_USE_DEPRECATED -/** \ingroup msg_deprecated_functions - * - * \brief Return the last value returned by a MSG function (except - * MSG_get_errno...). - */ -msg_error_t MSG_get_errno(void) -{ - return PROCESS_GET_ERRNO(); -} - -/** \ingroup msg_deprecated_functions - * \brief Put a task on a channel of an host and waits for the end of the - * transmission. - * - * This function is used for describing the behavior of a process. It - * takes three parameter. - * \param task a #msg_task_t to send on another location. This task - will not be usable anymore when the function will return. There is - no automatic task duplication and you have to save your parameters - before calling this function. Tasks are unique and once it has been - sent to another location, you should not access it anymore. You do - not need to call MSG_task_destroy() but to avoid using, as an - effect of inattention, this task anymore, you definitely should - renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task - can be transfered iff it has been correctly created with - MSG_task_create(). - * \param dest the destination of the message - * \param channel the channel on which the process should put this - task. This value has to be >=0 and < than the maximal number of - channels fixed with MSG_set_channel_number(). - * \return #MSG_HOST_FAILURE if the host on which - * this function was called was shut down, - * #MSG_TRANSFER_FAILURE if the transfer could not be properly done - * (network failure, dest failure) or #MSG_OK if it succeeded. - */ -msg_error_t MSG_task_put(msg_task_t task, msg_host_t dest, m_channel_t channel) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_send"); - return MSG_task_put_with_timeout(task, dest, channel, -1.0); -} - -/** \ingroup msg_deprecated_functions - * \brief Does exactly the same as MSG_task_put but with a bounded transmition - * rate. - * - * \sa MSG_task_put - */ -msg_error_t -MSG_task_put_bounded(msg_task_t task, msg_host_t dest, m_channel_t channel, - double maxrate) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_send_bounded"); - task->simdata->rate = maxrate; - return MSG_task_put(task, dest, channel); -} - -/** \ingroup msg_deprecated_functions - * - * \brief Put a task on a channel of an - * host (with a timeout on the waiting of the destination host) and - * waits for the end of the transmission. - * - * This function is used for describing the behavior of a process. It - * takes four parameter. - * \param task a #msg_task_t to send on another location. This task - will not be usable anymore when the function will return. There is - no automatic task duplication and you have to save your parameters - before calling this function. Tasks are unique and once it has been - sent to another location, you should not access it anymore. You do - not need to call MSG_task_destroy() but to avoid using, as an - effect of inattention, this task anymore, you definitely should - renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task - can be transfered iff it has been correctly created with - MSG_task_create(). - * \param dest the destination of the message - * \param channel the channel on which the process should put this - task. This value has to be >=0 and < than the maximal number of - channels fixed with MSG_set_channel_number(). - * \param timeout the maximum time to wait for a task before giving - up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task - will not be modified - * \return #MSG_HOST_FAILURE if the host on which -this function was called was shut down, -#MSG_TRANSFER_FAILURE if the transfer could not be properly done -(network failure, dest failure, timeout...) or #MSG_OK if the communication succeeded. - */ -msg_error_t -MSG_task_put_with_timeout(msg_task_t task, msg_host_t dest, - m_channel_t channel, double timeout) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_send_with_timeout"); - xbt_assert((channel >= 0) - && (channel < msg_global->max_channel), "Invalid channel %d", - channel); - - XBT_DEBUG("MSG_task_put_with_timout: Trying to send a task to '%s'", MSG_host_get_name(dest)); - return - MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_channel - (dest, channel), task, timeout); -} - -/** \ingroup msg_deprecated_functions - * \brief Test whether there is a pending communication on a channel, and who sent it. - * - * It takes one parameter. - * \param channel the channel on which the process should be - listening. This value has to be >=0 and < than the maximal - number of channels fixed with MSG_set_channel_number(). - * \return -1 if there is no pending communication and the PID of the process who sent it otherwise - */ -int MSG_task_probe_from(m_channel_t channel) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_listen_from"); - msg_task_t task; - - xbt_assert((channel >= 0) - && (channel < msg_global->max_channel), "Invalid channel %d", - channel); - - if (NULL == - (task = - MSG_mailbox_get_head(MSG_mailbox_get_by_channel - (MSG_host_self(), channel)))) - return -1; - - return MSG_process_get_PID(task->simdata->sender); -} - -/** \ingroup msg_deprecated_functions - * \brief Test whether there is a pending communication on a channel. - * - * It takes one parameter. - * \param channel the channel on which the process should be - listening. This value has to be >=0 and < than the maximal - number of channels fixed with MSG_set_channel_number(). - * \return 1 if there is a pending communication and 0 otherwise - */ -int MSG_task_Iprobe(m_channel_t channel) -{ - XBT_WARN("DEPRECATED!"); - xbt_assert((channel >= 0) - && (channel < msg_global->max_channel), "Invalid channel %d", - channel); - - return - !MSG_mailbox_is_empty(MSG_mailbox_get_by_channel - (MSG_host_self(), channel)); -} - -/** \ingroup msg_deprecated_functions - - * \brief Return the number of tasks waiting to be received on a \a - channel and sent by \a host. - * - * It takes two parameters. - * \param channel the channel on which the process should be - listening. This value has to be >=0 and < than the maximal - number of channels fixed with MSG_set_channel_number(). - * \param host the host that is to be watched. - * \return the number of tasks waiting to be received on \a channel - and sent by \a host. - */ -int MSG_task_probe_from_host(int channel, msg_host_t host) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_listen_from_host"); - xbt_assert((channel >= 0) - && (channel < msg_global->max_channel), "Invalid channel %d", - channel); - - return - MSG_mailbox_get_count_host_waiting_tasks(MSG_mailbox_get_by_channel - (MSG_host_self(), channel), - host); - -} - -/** \ingroup msg_deprecated_functions - * \brief Listen on \a channel and waits for receiving a task from \a host. - * - * It takes three parameters. - * \param task a memory location for storing a #msg_task_t. It will - hold a task when this function will return. Thus \a task should not - be equal to \c NULL and \a *task should be equal to \c NULL. If one of - those two condition does not hold, there will be a warning message. - * \param channel the channel on which the process should be - listening. This value has to be >=0 and < than the maximal - number of channels fixed with MSG_set_channel_number(). - * \param host the host that is to be watched. - * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise. - */ -msg_error_t -MSG_task_get_from_host(msg_task_t * task, m_channel_t channel, msg_host_t host) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_receive_from_host"); - return MSG_task_get_ext(task, channel, -1, host); -} - -/** \ingroup msg_deprecated_functions - * \brief Listen on a channel and wait for receiving a task. - * - * It takes two parameters. - * \param task a memory location for storing a #msg_task_t. It will - hold a task when this function will return. Thus \a task should not - be equal to \c NULL and \a *task should be equal to \c NULL. If one of - those two condition does not hold, there will be a warning message. - * \param channel the channel on which the process should be - listening. This value has to be >=0 and < than the maximal - number of channels fixed with MSG_set_channel_number(). - * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise. - */ -msg_error_t MSG_task_get(msg_task_t * task, m_channel_t channel) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_receive"); - return MSG_task_get_with_timeout(task, channel, -1); -} - -/** \ingroup msg_deprecated_functions - * \brief Listen on a channel and wait for receiving a task with a timeout. - * - * It takes three parameters. - * \param task a memory location for storing a #msg_task_t. It will - hold a task when this function will return. Thus \a task should not - be equal to \c NULL and \a *task should be equal to \c NULL. If one of - those two condition does not hold, there will be a warning message. - * \param channel the channel on which the process should be - listening. This value has to be >=0 and < than the maximal - number of channels fixed with MSG_set_channel_number(). - * \param max_duration the maximum time to wait for a task before giving - up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task - will not be modified and will still be - equal to \c NULL when returning. - * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise. - */ -msg_error_t -MSG_task_get_with_timeout(msg_task_t * task, m_channel_t channel, - double max_duration) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_receive_with_timeout"); - return MSG_task_get_ext(task, channel, max_duration, NULL); -} - -msg_error_t -MSG_task_get_ext(msg_task_t * task, m_channel_t channel, double timeout, - msg_host_t host) -{ - XBT_WARN("DEPRECATED! Now use MSG_task_receive_ext"); - xbt_assert((channel >= 0) - && (channel < msg_global->max_channel), "Invalid channel %d", - channel); - - return - MSG_mailbox_get_task_ext(MSG_mailbox_get_by_channel - (MSG_host_self(), channel), task, host, - timeout); -} - -#endif diff --git a/src/msg/msg_host.cpp b/src/msg/msg_host.cpp index 22fc30751b..87582b1c94 100644 --- a/src/msg/msg_host.cpp +++ b/src/msg/msg_host.cpp @@ -31,23 +31,6 @@ msg_host_t __MSG_host_create(sg_host_t host) // FIXME: don't return our paramete { msg_host_priv_t priv = xbt_new0(s_msg_host_priv_t, 1); -#ifdef MSG_USE_DEPRECATED - int i; - char alias[MAX_ALIAS_NAME + 1] = { 0 }; /* buffer used to build the key of the mailbox */ - - priv->mailboxes = (msg_global->max_channel > 0) ? - xbt_new0(msg_mailbox_t, msg_global->max_channel) : NULL; - - for (i = 0; i < msg_global->max_channel; i++) { - sprintf(alias, "%s:%d", name, i); - - /* the key of the mailbox (in this case) is build from the name of the host and the channel number */ - priv->mailboxes[i] = MSG_mailbox_new(alias); - memset(alias, 0, MAX_ALIAS_NAME + 1); - } -#endif - - priv->dp_objs = xbt_dict_new(); priv->dp_enabled = 0; priv->dp_updated_by_deleted_tasks = 0; @@ -145,9 +128,6 @@ void __MSG_host_priv_free(msg_host_priv_t priv) xbt_dict_free(&priv->dp_objs); xbt_dict_free(&priv->affinity_mask_db); xbt_dynar_free(&priv->file_descriptor_table); -#ifdef MSG_USE_DEPRECATED - free(priv->mailboxes); -#endif free(priv); } @@ -160,25 +140,6 @@ int MSG_get_host_number(void) return xbt_dict_length(host_list); } -#ifdef MSG_USE_DEPRECATED -msg_host_t *MSG_get_host_table(void) -{ - if (xbt_dict_is_empty(host_list)) - return nullptr; - - void **array = xbt_new0(void *, xbt_dict_length(host_list)); - - xbt_lib_cursor_t cursor; - const char *id; - simgrid::s4u::Host* host; - xbt_dict_foreach(host_list, cursor, id, host) - if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST) - array[i++] = host->facet(MSG_HOST_LEVEL); - - return (msg_host_t *)array; -} -#endif - /** \ingroup m_host_management * \brief Return a dynar containing all the hosts declared at a given point of time * \remark The host order in the returned array is generally different from the host creation/declaration order in the XML platform (we use a hash table internally) diff --git a/src/msg/msg_mailbox.cpp b/src/msg/msg_mailbox.cpp index 13cfe2e41f..9f9455c8cf 100644 --- a/src/msg/msg_mailbox.cpp +++ b/src/msg/msg_mailbox.cpp @@ -242,16 +242,3 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task, MSG_RETURN(ret); } -#ifdef MSG_USE_DEPRECATED -msg_mailbox_t MSG_mailbox_get_by_channel(msg_host_t host, - m_channel_t channel) -{ - XBT_WARN("DEPRECATED! Now use MSG_mailbox_get_by_alias"); - xbt_assert((host != NULL), "Invalid host"); - xbt_assert((channel >= 0) - && (channel < msg_global->max_channel), "Invalid channel %d", - channel); - - return MSG_host_priv(host)->mailboxes[(size_t) channel]; -} -#endif diff --git a/src/msg/msg_mailbox.h b/src/msg/msg_mailbox.h index 7ac2c96bff..8a7953c7c8 100644 --- a/src/msg/msg_mailbox.h +++ b/src/msg/msg_mailbox.h @@ -108,23 +108,5 @@ XBT_PUBLIC(int) MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, msg_host_t host); -#ifdef MSG_USE_DEPRECATED -/* \brief MSG_mailbox_get_by_channel - get a mailbox of the specified host from its channel. - * - * The function MSG_mailbox_get_by_channel returns the mailbox of the - * specified host from the channel specified by the parameter - * channel. If the mailbox does not exists, the function fails. - * - * \param host The host containing he mailbox to get. - * \param channel The channel used to identify the mailbox. - * - * \return The mailbox of the specified host associated the channel - * specified as parameter. - * - */ -XBT_PUBLIC(msg_mailbox_t) - MSG_mailbox_get_by_channel(msg_host_t host, m_channel_t channel); -#endif - SG_END_DECL() #endif /* !MSG_MAILBOX_H */ diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index 85da70124c..fdca8f17c1 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -84,9 +84,6 @@ typedef struct simdata_gpu_task { typedef struct simdata_process { msg_host_t m_host; /* the host on which the process is running */ msg_host_t put_host; /* used for debugging purposes */ -#ifdef MSG_USE_DEPRECATED - m_channel_t put_channel; /* used for debugging purposes */ -#endif smx_synchro_t waiting_action; msg_task_t waiting_task; char **argv; /* arguments table if any */ @@ -130,9 +127,6 @@ XBT_PUBLIC_DATA(const char*) MSG_vm_get_name(msg_vm_t vm); /************************** Global variables ********************************/ typedef struct MSG_Global { xbt_fifo_t host; -#ifdef MSG_USE_DEPRECATED - int max_channel; -#endif int session; int debug_multiple_use; unsigned long int sent_msg; /* Total amount of messages sent during the simulation */ @@ -146,17 +140,8 @@ XBT_PUBLIC_DATA(MSG_Global_t) msg_global; /*************************************************************/ -#ifdef MSG_USE_DEPRECATED -# define PROCESS_SET_ERRNO(val) \ - (((simdata_process_t) SIMIX_process_self_get_data(SIMIX_process_self()))->last_errno=val) -# define PROCESS_GET_ERRNO() \ - (((simdata_process_t) SIMIX_process_self_get_data(SIMIX_process_self()))->last_errno) -#define MSG_RETURN(val) do {PROCESS_SET_ERRNO(val);return(val);} while(0) -/* #define CHECK_ERRNO() ASSERT((PROCESS_GET_ERRNO()!=MSG_HOST_FAILURE),"Host failed, you cannot call this function.") */ - -#else +// FIXME: KILLME # define MSG_RETURN(val) return(val) -#endif XBT_PRIVATE msg_host_t __MSG_host_create(sg_host_t host); XBT_PRIVATE msg_storage_t __MSG_storage_create(smx_storage_t storage); diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index 18d8177ba0..31c50d7cf4 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -126,10 +126,6 @@ if(NOT enable_debug) set(CMAKE_CXX_FLAGS "-DNDEBUG ${CMAKE_CXX_FLAGS}") endif() -if(enable_msg_deprecated) - set(CMAKE_C_FLAGS "-DMSG_USE_DEPRECATED ${CMAKE_C_FLAGS}") -endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${optCFLAGS} ${warnCFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${optCFLAGS}") diff --git a/tools/cmake/Option.cmake b/tools/cmake/Option.cmake index 393d2468f0..e05ca06bb6 100644 --- a/tools/cmake/Option.cmake +++ b/tools/cmake/Option.cmake @@ -49,7 +49,6 @@ option(enable_lib_in_jar "Whether the native libraries are bundled in a Java jar option(enable_lto "Whether we should try to activate the LTO (link time optimisation)" on) option(enable_jedule "Jedule output of SimDAG." off) option(enable_debug "Turn this off to remove all debug messages at compile time (faster, but no debug activatable)" on) -option(enable_msg_deprecated "This option enables the use of deprecated MSG functions" off) if(WIN32) option(enable_smpi "Whether SMPI in included in library." off) -- 2.20.1