X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7f4f03348bd07609e258eb3b545bdafc2c881847..03d87ef83eada5a3cf9aacce9e6a5dc0d169aaa3:/src/msg/msg_gos.cpp diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index 44b5798cba..e89d7d1e79 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -73,7 +73,7 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) simdata->isused = (void*)1; if (simdata->host_nb > 0) { - simdata->compute = simcall_process_parallel_execute(task->name, + simdata->compute = simcall_execution_parallel_start(task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount, @@ -84,7 +84,7 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) unsigned long affinity_mask = (unsigned long)(uintptr_t) xbt_dict_get_or_null_ext(simdata->affinity_mask_db, (char *) p_simdata->m_host, sizeof(msg_host_t)); XBT_DEBUG("execute %s@%s with affinity(0x%04lx)", MSG_task_get_name(task), MSG_host_get_name(p_simdata->m_host), affinity_mask); - simdata->compute = simcall_process_execute(task->name, + simdata->compute = simcall_execution_start(task->name, simdata->flops_amount, simdata->priority, simdata->bound, @@ -94,7 +94,7 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) } simcall_set_category(simdata->compute, task->category); p_simdata->waiting_action = simdata->compute; - comp_state = simcall_process_execution_wait(simdata->compute); + comp_state = simcall_execution_wait(simdata->compute); p_simdata->waiting_action = NULL; @@ -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