XBT_PRIVATE= \
XBT_ATTRIB_NORETURN= \
XBT_ATTRIB_UNUSED= \
- XBT_ATTRIB_DEPRECATED_v325(m)= \
XBT_ATTRIB_DEPRECATED_v327(m)= \
XBT_ATTRIB_DEPRECATED_v328(m)=
XBT_PRIVATE= \
XBT_ATTRIB_NORETURN= \
XBT_ATTRIB_UNUSED= \
- XBT_ATTRIB_DEPRECATED_v325(m)= \
XBT_ATTRIB_DEPRECATED_v327(m)= \
XBT_ATTRIB_DEPRECATED_v328(m)=
.. doxygenfunction:: MSG_host_get_property_value
.. doxygenfunction:: MSG_host_get_pstate
.. doxygenfunction:: MSG_host_get_speed
-.. doxygenfunction:: MSG_host_is_off
.. doxygenfunction:: MSG_host_is_on
.. doxygenfunction:: MSG_host_off
.. doxygenfunction:: MSG_host_on
.. doxygenfunction:: MSG_task_listen_from
.. doxygenfunction:: MSG_task_receive
.. doxygenfunction:: MSG_task_receive_bounded
-.. doxygenfunction:: MSG_task_receive_ext
.. doxygenfunction:: MSG_task_receive_ext_bounded
.. doxygenfunction:: MSG_task_receive_with_timeout
.. doxygenfunction:: MSG_task_receive_with_timeout_bounded
.. doxygenfunction:: MSG_task_set_bound
.. doxygenfunction:: MSG_task_set_bytes_amount
.. doxygenfunction:: MSG_task_set_category
-.. doxygenfunction:: MSG_task_set_copy_callback
.. doxygenfunction:: MSG_task_set_data
.. doxygenfunction:: MSG_task_set_flops_amount
.. doxygenfunction:: MSG_task_set_name
XBT_PUBLIC void sg_host_turn_on(sg_host_t host);
XBT_PUBLIC void sg_host_turn_off(sg_host_t host);
XBT_PUBLIC int sg_host_is_on(sg_host_t host);
-XBT_ATTRIB_DEPRECATED_v325("Please use !sg_host_is_on()") XBT_PUBLIC int sg_host_is_off(sg_host_t host);
/** @ingroup m_host_management
* @brief Returns a xbt_dict_t consisting of the list of properties assigned to this host
/** @brief Check if the current Resource is active */
virtual bool is_on() const { return is_on_; }
- /** @brief Check if the current Resource is shut down */
- XBT_ATTRIB_DEPRECATED_v325("Please use !is_on()") virtual bool is_off() const { return not is_on_; }
/** @brief Turn on the current Resource */
virtual void turn_on() { is_on_ = true; }
/** @brief Turn off the current Resource */
/** @brief setup the profile file with states events (ON or OFF). The profile must contain boolean values. */
virtual void set_state_profile(profile::Profile* profile);
-#ifndef DOXYGEN
- XBT_ATTRIB_DEPRECATED_v325("Please use Resource::set_state_profile()") virtual void set_state_trace(
- profile::Profile* profile) { set_state_profile(profile); }
-#endif
-
private:
std::string name_;
Model* model_;
*/
XBT_PUBLIC void MSG_host_off(sg_host_t h);
XBT_PUBLIC int MSG_host_is_on(sg_host_t h);
-XBT_ATTRIB_DEPRECATED_v325("Please use !MSG_host_is_on()") XBT_PUBLIC int MSG_host_is_off(sg_host_t h);
XBT_PUBLIC xbt_dict_t MSG_host_get_properties(sg_host_t host);
XBT_PUBLIC const char* MSG_host_get_property_value(sg_host_t host, const char* name);
XBT_PUBLIC void MSG_host_set_property_value(sg_host_t host, const char* name, const char* value);
XBT_PUBLIC double MSG_task_get_remaining_communication(msg_task_t task);
XBT_PUBLIC double MSG_task_get_bytes_amount(msg_task_t task);
-XBT_ATTRIB_DEPRECATED_v325("Getting a task from a specific host is no longer supported."
- " Use MSG_task_receive_with_timeout instead.") XBT_PUBLIC msg_error_t
- MSG_task_receive_ext(msg_task_t* task, const char* alias, double timeout, msg_host_t host);
-
XBT_PUBLIC msg_error_t MSG_task_receive_with_timeout(msg_task_t* task, const char* alias, double timeout);
XBT_PUBLIC msg_error_t MSG_task_receive(msg_task_t* task, const char* alias);
XBT_PUBLIC int MSG_barrier_wait(msg_bar_t bar);
/* ****************************************************************************************** */
-/* DO NOT USE this nasty pimple (unless if you're writing a binding) */
-XBT_ATTRIB_DEPRECATED_v325("MSG_process_set_copy_callback is deprecated. Please contact us if you need it.") XBT_PUBLIC
- void MSG_task_set_copy_callback(void (*callback)(msg_task_t task, msg_process_t src, msg_process_t dst));
-
#ifdef __cplusplus
}
#endif
get_properties() const; // FIXME: do not export the map, but only the keys or something
const char* get_property(const std::string& key) const;
void set_property(const std::string& key, const std::string& value);
-
-#ifndef DOXYGEN
- XBT_ATTRIB_DEPRECATED_v325("Please use Actor::on_exit(fun) instead") void on_exit(
- const std::function<void(int, void*)>& fun, void* data);
-
- XBT_ATTRIB_DEPRECATED_v325("Please use Actor::by_pid(pid).kill() instead") static void kill(aid_t pid);
-#endif
};
/** @ingroup s4u_api
XBT_PUBLIC void parallel_execute(const std::vector<s4u::Host*>& hosts, const std::vector<double>& flops_amounts,
const std::vector<double>& bytes_amounts, double timeout);
-#ifndef DOXYGEN
-XBT_ATTRIB_DEPRECATED_v325("Please use std::vectors as parameters") XBT_PUBLIC
- void parallel_execute(int host_nb, s4u::Host* const* host_list, const double* flops_amount,
- const double* bytes_amount);
-XBT_ATTRIB_DEPRECATED_v325("Please use std::vectors as parameters") XBT_PUBLIC
- void parallel_execute(int host_nb, s4u::Host* const* host_list, const double* flops_amount,
- const double* bytes_amount, double timeout);
-#endif
-
XBT_PUBLIC ExecPtr exec_init(double flops_amounts);
XBT_PUBLIC ExecPtr exec_init(const std::vector<s4u::Host*>& hosts, const std::vector<double>& flops_amounts,
const std::vector<double>& bytes_amounts);
XBT_PUBLIC void migrate(Host* new_host);
/** @} */
-
-#ifndef DOXYGEN
-XBT_ATTRIB_DEPRECATED_v325("Please use std::function<void(bool)> for first parameter.") XBT_PUBLIC
- void on_exit(const std::function<void(int, void*)>& fun, void* data);
-#endif
}
void turn_off();
/** Returns if that host is currently up and running */
bool is_on() const;
- /** Returns if that host is currently down and offline */
- XBT_ATTRIB_DEPRECATED_v325("Please use !is_on()") bool is_off() const { return not is_on(); }
const char* get_property(const std::string& key) const;
void set_property(const std::string& key, const std::string& value);
bool is_on() const;
void turn_off();
-#ifndef DOXYGEN
- XBT_ATTRIB_DEPRECATED_v325("Please use Link::set_state_profile()") void set_state_trace(
- kernel::profile::Profile* profile)
- {
- set_state_profile(profile);
- }
- XBT_ATTRIB_DEPRECATED_v325("Please use Link::set_bandwidth_profile()") void set_bandwidth_trace(
- kernel::profile::Profile* profile)
- {
- set_bandwidth_profile(profile);
- }
- XBT_ATTRIB_DEPRECATED_v325("Please use Link::set_latency_profile()") void set_latency_trace(
- kernel::profile::Profile* profile)
- {
- set_latency_profile(profile);
- }
-#endif
-
/** Setup the profile with states events (ON or OFF). The profile must contain boolean values. */
void set_state_profile(kernel::profile::Profile* profile);
/** Setup the profile with bandwidth events (peak speed changes due to external load).
XBT_PUBLIC void SIMIX_launch_application(const std::string& file);
#endif
-/*********************************** Host *************************************/
-/* Functions for running a process in main()
- *
- * 1. create the maestro process
- * 2. attach (create a context and wait for maestro to give control back to you)
- * 3. do you process job
- * 4. detach (this waits for the simulation to terminate)
- */
-
-#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v325("Please use ActorImpl::attach() or sg_actor_attach()") XBT_PUBLIC smx_actor_t
- SIMIX_process_attach(const char* name, void* data, const char* hostname,
- std::unordered_map<std::string, std::string>* properties, smx_actor_t parent_process);
-#endif
-SG_BEGIN_DECL()
-XBT_ATTRIB_DEPRECATED_v325("Please use ActorImpl::detach() or sg_actor_detach()") XBT_PUBLIC
- void SIMIX_process_detach();
-SG_END_DECL()
-
/********************************* Process ************************************/
SG_BEGIN_DECL()
XBT_PUBLIC int SIMIX_process_count();
XBT_PUBLIC const char* SIMIX_process_self_get_name();
XBT_PUBLIC void SIMIX_process_self_set_data(void* data);
XBT_PUBLIC void* SIMIX_process_self_get_data();
-XBT_ATTRIB_DEPRECATED_v325("Please manifest if you actually need this function") XBT_PUBLIC
- int SIMIX_process_has_pending_comms(smx_actor_t process);
-XBT_ATTRIB_DEPRECATED_v325("Please use SIMIX_process_on_exit(smx_actor_t, const std::function<void(bool)>&)") XBT_PUBLIC
- void SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data);
SG_END_DECL()
#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v325("Please use SIMIX_process_on_exit(smx_actor_t, const std::function<void(bool)>&)") XBT_PUBLIC
- void SIMIX_process_on_exit(smx_actor_t process, const std::function<void(int, void*)>& fun, void* data);
XBT_PUBLIC void SIMIX_process_on_exit(smx_actor_t process, const std::function<void(bool /*failed*/)>& fun);
#endif
size_t buff_size);
#endif
-XBT_ATTRIB_DEPRECATED_v325("Please use CommImpl::finish()") XBT_PUBLIC void SIMIX_comm_finish(smx_activity_t synchro);
-
/******************************************************************************/
/* SIMIX simcalls */
/******************************************************************************/
XBT_PUBLIC int simcall_mc_random(int min, int max);
SG_END_DECL()
-/***************************** DEPRECATED CALLS ****************************/
-SG_BEGIN_DECL()
-XBT_ATTRIB_DEPRECATED_v325("Please use sg_actor_set_kill_time()") XBT_PUBLIC
- void simcall_process_set_kill_time(smx_actor_t process, double kill_time);
-
-XBT_ATTRIB_DEPRECATED_v325("Please use Comm::cancel()") XBT_PUBLIC void simcall_comm_cancel(smx_activity_t comm);
-
-XBT_ATTRIB_DEPRECATED_v325("Please use Exec::cancel()") XBT_PUBLIC
- void simcall_execution_cancel(smx_activity_t execution);
-XBT_ATTRIB_DEPRECATED_v325("Please use Exec::set_bound()") XBT_PUBLIC
- void simcall_execution_set_bound(smx_activity_t execution, double bound);
-SG_END_DECL()
-
-#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v325("Please use Exec::start()") XBT_PUBLIC smx_activity_t
- simcall_execution_start(const std::string& name, const std::string& category, double flops_amount,
- double sharing_penalty, double bound, sg_host_t host);
-
-// Should be deprecated in v325 too but is still used in other deprecated calls
-XBT_PUBLIC smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb,
- const sg_host_t* host_list, const double* flops_amount,
- const double* bytes_amount, double rate, double timeout);
-#endif
-
#endif
namespace simgrid {
namespace simix {
-XBT_ATTRIB_DEPRECATED_v325("Please manifest if you actually need this function")
- XBT_PUBLIC const std::vector<smx_actor_t>& process_get_runnable();
-
// What's executed as SIMIX actor code:
typedef std::function<void()> ActorCode;
return set(date, simgrid::xbt::Task<void()>(std::move(callback)));
}
- template <class R, class T>
- XBT_ATTRIB_DEPRECATED_v325("Please use a lambda or std::bind") static inline Timer* set(double date,
- R (*callback)(T*), T* arg)
- {
- return set(date, std::bind(callback, arg));
- }
-
- XBT_ATTRIB_DEPRECATED_v325("Please use a lambda or std::bind") static Timer* set(double date, void (*callback)(void*),
- void* arg)
- {
- return set(date, std::bind(callback, arg));
- }
static Timer* set(double date, simgrid::xbt::Task<void()>&& callback);
static double next() { return simix_timers.empty() ? -1.0 : simix_timers.top().first; }
};
void* data, sg_host_t host,
std::unordered_map<std::string, std::string>* properties);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::xbt::Timer::set") XBT_PUBLIC smx_timer_t
- SIMIX_timer_set(double date, simgrid::xbt::Task<void()>&& callback);
-
#endif
#define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg)))
#endif
-#define XBT_ATTRIB_DEPRECATED_v325(mesg) \
- XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.25)") /* Will be dropped in v3.25 */
#define XBT_ATTRIB_DEPRECATED_v327(mesg) \
XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.27)") /* Will be dropped in v3.27 */
#define XBT_ATTRIB_DEPRECATED_v328(mesg) \
SG_BEGIN_DECL()
/* Set the value of the cell @a name in @a cfg with the provided value.*/
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<int> or sg_cfg_set_int") XBT_PUBLIC
- void xbt_cfg_set_int(const char* name, int val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<double> or sg_cfg_set_double") XBT_PUBLIC
- void xbt_cfg_set_double(const char* name, double val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<bool> or sg_cfg_set_boolean") XBT_PUBLIC
- void xbt_cfg_set_boolean(const char* name, const char* val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<std::string>or sg_cfg_set_string") XBT_PUBLIC
- void xbt_cfg_set_string(const char* name, const char* val);
-
XBT_PUBLIC void sg_cfg_set_int(const char* name, int val);
XBT_PUBLIC void sg_cfg_set_double(const char* name, double val);
XBT_PUBLIC void sg_cfg_set_boolean(const char* name, const char* val);
* @{
*/
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<int> or sg_cfg_get_int") XBT_PUBLIC
- int xbt_cfg_get_int(const char* name);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<double> or sg_cfg_get_double") XBT_PUBLIC
- double xbt_cfg_get_double(const char* name);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<bool> or sg_cfg_get_boolean") XBT_PUBLIC
- int xbt_cfg_get_boolean(const char* name);
-
XBT_PUBLIC int sg_cfg_get_int(const char* name);
XBT_PUBLIC double sg_cfg_get_double(const char* name);
XBT_PUBLIC int sg_cfg_get_boolean(const char* name);
return (self_context != nullptr) ? self_context->get_actor() : nullptr;
}
-/**
- * @brief Returns whether a process has pending asynchronous communications.
- * @return true if there are asynchronous communications in this process
- * @deprecated
- */
-int SIMIX_process_has_pending_comms(smx_actor_t process)
-{
-
- return process->comms.size() > 0;
-}
-
namespace simgrid {
namespace kernel {
namespace actor {
} // namespace kernel
} // namespace simgrid
-void SIMIX_process_detach() // deprecated v3.25
-{
- simgrid::kernel::actor::ActorImpl::detach();
-}
-
-smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostname,
- std::unordered_map<std::string, std::string>* properties,
- smx_actor_t /*parent_process*/) // deprecated 3.25
-{
- return simgrid::kernel::actor::ActorImpl::attach(name, data, sg_host_by_name(hostname), properties).get();
-}
-
int SIMIX_process_count()
{
return simix_global->process_list.size();
* @param self the current process
*/
-/** @brief Returns the list of processes to run.
- * @deprecated
- */
-const std::vector<smx_actor_t>& simgrid::simix::process_get_runnable()
-{
- return simix_global->actors_to_run;
-}
-
/** @brief Returns the process from PID. */
smx_actor_t SIMIX_process_from_PID(aid_t PID)
{
return item->second;
}
-void SIMIX_process_on_exit(smx_actor_t actor, int_f_pvoid_pvoid_t fun, void* data)
-{
- SIMIX_process_on_exit(actor, [fun, data](bool failed) {
- intptr_t status = failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
- fun(reinterpret_cast<void*>(status), data);
- });
-}
-
-void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(int, void*)>& fun, void* data)
-{
- SIMIX_process_on_exit(actor, [fun, data](bool failed) { fun(failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS, data); });
-}
-
void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(bool /*failed*/)>& fun)
{
xbt_assert(actor, "current process not found: are you in maestro context ?");
return comm->task_received ? *comm->task_received : comm->task_sent;
}
-
-/**
- * @brief This function is called by SIMIX in kernel mode to copy the data of a comm.
- * @param comm the comm
- * @param buff the data copied
- * @param buff_size size of the buffer
- */
-// deprecated but used by MSG_set_copy_callback. Should be removed in v325
-void MSG_comm_copy_data_from_SIMIX(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size)
-{
- SIMIX_comm_copy_pointer_callback(comm, buff, buff_size);
-
- // notify the user callback if any
- if (msg_global->task_copy_callback) {
- msg_task_t task = static_cast<msg_task_t>(buff);
- msg_global->task_copy_callback(task, comm->src_actor_->ciface(), comm->dst_actor_->ciface());
- }
-}
{
return sg_host_is_on(h);
}
-int MSG_host_is_off(sg_host_t h) // deprecated
-{
- return not sg_host_is_on(h);
-}
xbt_dict_t MSG_host_get_properties(sg_host_t host)
{
return sg_host_get_properties(host);
XBT_PUBLIC_DATA MSG_Global_t* msg_global;
/*************************************************************/
-XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size);
#endif
task->set_user_data(data);
}
-/** @brief Sets a function to be called when a task has just been copied.
- * @param callback a callback function
- */
-// deprecated
-void MSG_task_set_copy_callback(void (*callback) (msg_task_t task, msg_process_t sender, msg_process_t receiver)) {
-
- msg_global->task_copy_callback = callback;
-
- if (callback) {
- SIMIX_comm_set_copy_data_callback(MSG_comm_copy_data_from_SIMIX);
- } else {
- SIMIX_comm_set_copy_data_callback(SIMIX_comm_copy_pointer_callback);
- }
-}
-
/** @brief Returns the sender of the given task */
msg_process_t MSG_task_get_sender(msg_task_t task)
{
return MSG_task_receive_ext_bounded(task, alias, timeout, nullptr, rate);
}
-/**
- * @brief Receives a task from a mailbox from a specific host with a given timeout.
- *
- * This is a blocking function with a timeout, the execution flow will be blocked until the task is received or the
- * timeout is achieved. See #MSG_task_irecv for receiving tasks asynchronously. You can provide a -1 timeout
- * to obtain an infinite timeout.
- *
- * @param task a memory location for storing a #msg_task_t.
- * @param alias name of the mailbox to receive the task from
- * @param timeout is the maximum wait time for completion (provide -1 for no timeout)
- * @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, or #MSG_TIMEOUT otherwise.
- */
-msg_error_t MSG_task_receive_ext(msg_task_t* task, const char* alias, double timeout, msg_host_t host)
-{
- XBT_DEBUG("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'", alias);
- return MSG_task_receive_ext_bounded(task, alias, timeout, host, -1.0);
-}
-
/**
* @brief Receives a task from a mailbox from a specific host with a given timeout and at a given rate.
*
});
}
-void Actor::on_exit(const std::function<void(int, void*)>& fun, void* data) /* deprecated */
-{
- on_exit([fun, data](bool failed) { fun(failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS, data); });
-}
-
void Actor::on_exit(const std::function<void(bool /*failed*/)>& fun) const
{
kernel::actor::simcall([this, &fun] { SIMIX_process_on_exit(pimpl_, fun); });
return pimpl_->get_kill_time();
}
-void Actor::kill(aid_t pid) // deprecated
-{
- kernel::actor::ActorImpl* killer = SIMIX_process_self();
- kernel::actor::ActorImpl* victim = SIMIX_process_from_PID(pid);
- if (victim != nullptr) {
- kernel::actor::simcall([killer, victim] { killer->kill(victim); });
- } else {
- std::ostringstream oss;
- oss << "kill: (" << pid << ") - No such actor" << std::endl;
- throw std::runtime_error(oss.str());
- }
-}
-
void Actor::kill()
{
kernel::actor::ActorImpl* process = SIMIX_process_self();
exec_init(hosts, flops_amounts, bytes_amounts)->set_timeout(timeout)->wait();
}
-// deprecated
-void parallel_execute(int host_nb, s4u::Host* const* host_list, const double* flops_amount, const double* bytes_amount,
- double timeout)
-{
- smx_activity_t s =
- simcall_execution_parallel_start("", host_nb, host_list, flops_amount, bytes_amount, /* rate */ -1, timeout);
- simcall_execution_wait(s);
- delete[] flops_amount;
- delete[] bytes_amount;
-}
-
-// deprecated
-void parallel_execute(int host_nb, s4u::Host* const* host_list, const double* flops_amount, const double* bytes_amount)
-{
- smx_activity_t s = simcall_execution_parallel_start("", host_nb, host_list, flops_amount, bytes_amount,
- /* rate */ -1, /*timeout*/ -1);
- simcall_execution_wait(s);
- delete[] flops_amount;
- delete[] bytes_amount;
-}
-
ExecPtr exec_init(double flops_amount)
{
return ExecPtr(new ExecSeq(get_host(), flops_amount));
SIMIX_process_self()->iface()->on_exit(fun);
}
-void on_exit(const std::function<void(int, void*)>& fun, void* data) /* deprecated */
-{
- SIMIX_process_self()->iface()->on_exit([fun, data](bool exit) { fun(exit, data); });
-}
-
/** @brief Moves the current actor to another host
*
* @see simgrid::s4u::Actor::migrate() for more information
return host->is_on();
}
-/** @deprecated */
-int sg_host_is_off(sg_host_t host)
-{
- return not host->is_on();
-}
-
/** @brief Get the properties of a host */
xbt_dict_t sg_host_get_properties(sg_host_t host)
{
}
} // namespace simix
} // namespace simgrid
-
-/* ****************************DEPRECATED CALLS******************************* */
-void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
-{
- simgrid::kernel::actor::simcall([process, kill_time] { process->set_kill_time(kill_time); });
-}
-void simcall_comm_cancel(smx_activity_t comm)
-{
- simgrid::kernel::actor::simcall(
- [comm] { boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(comm)->cancel(); });
-}
-void simcall_execution_cancel(smx_activity_t exec)
-{
- simgrid::kernel::actor::simcall(
- [exec] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->cancel(); });
-}
-
-void simcall_execution_set_bound(smx_activity_t exec, double bound)
-{
- simgrid::kernel::actor::simcall(
- [exec, bound] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->set_bound(bound); });
-}
-
-// deprecated
-smx_activity_t simcall_execution_start(const std::string& name, const std::string& category, double flops_amount,
- double sharing_penalty, double bound, sg_host_t host)
-{
- return simgrid::kernel::actor::simcall([name, category, flops_amount, sharing_penalty, bound, host] {
- simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
- (*exec)
- .set_name(name)
- .set_tracing_category(category)
- .set_host(host)
- .set_sharing_penalty(sharing_penalty)
- .set_bound(bound)
- .set_flops_amount(flops_amount)
- .start();
- return simgrid::kernel::activity::ExecImplPtr(exec);
- });
-}
-
-// deprecated
-smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb, const sg_host_t* host_list,
- const double* flops_amount, const double* bytes_amount, double rate,
- double timeout)
-{
- /* Check that we are not mixing VMs and PMs in the parallel task */
- bool is_a_vm = (nullptr != dynamic_cast<simgrid::s4u::VirtualMachine*>(host_list[0]));
- for (int i = 1; i < host_nb; i++) {
- bool tmp_is_a_vm = (nullptr != dynamic_cast<simgrid::s4u::VirtualMachine*>(host_list[i]));
- xbt_assert(is_a_vm == tmp_is_a_vm, "parallel_execute: mixing VMs and PMs is not supported (yet).");
- }
-
- /* checking for infinite values */
- for (int i = 0; i < host_nb; ++i) {
- if (flops_amount != nullptr)
- xbt_assert(std::isfinite(flops_amount[i]), "flops_amount[%d] is not finite!", i);
- if (bytes_amount != nullptr) {
- for (int j = 0; j < host_nb; ++j) {
- xbt_assert(std::isfinite(bytes_amount[i + host_nb * j]), "bytes_amount[%d+%d*%d] is not finite!", i, host_nb,
- j);
- }
- }
- }
- xbt_assert(std::isfinite(rate), "rate is not finite!");
-
- std::vector<simgrid::s4u::Host*> hosts(host_list, host_list + host_nb);
- std::vector<double> flops_parallel_amount;
- std::vector<double> bytes_parallel_amount;
- if (flops_amount != nullptr)
- flops_parallel_amount = std::vector<double>(flops_amount, flops_amount + host_nb);
- if (bytes_amount != nullptr)
- bytes_parallel_amount = std::vector<double>(bytes_amount, bytes_amount + host_nb * host_nb);
- return simgrid::kernel::actor::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] {
- simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
- (*exec)
- .set_name(name)
- .set_hosts(hosts)
- .set_timeout(timeout)
- .set_flops_amounts(flops_parallel_amount)
- .set_bytes_amounts(bytes_parallel_amount)
- .start();
- return simgrid::kernel::activity::ExecImplPtr(exec);
- });
-}
-
-// deprecated
-void SIMIX_comm_finish(smx_activity_t synchro)
-{
- boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro)->finish();
-}
return simgrid::simix::Timer::set(date, std::bind(callback, arg));
}
-smx_timer_t SIMIX_timer_set(double date, simgrid::xbt::Task<void()>&& callback) // deprecated
-{
- return simgrid::simix::Timer::set(date, std::move(callback));
-}
-
/** @brief cancels a timer that was added earlier */
void SIMIX_timer_remove(smx_timer_t timer) {
timer->remove();
* @param key the name of the variable
* @param value the value of the variable
*/
-void xbt_cfg_set_int(const char *key, int value)
-{
- sg_cfg_set_int(key, value);
-}
-
void sg_cfg_set_int(const char* key, int value)
{
(*simgrid_config)[key].set_value<int>(value);
* @param key the name of the variable
* @param value the double to set
*/
-void xbt_cfg_set_double(const char *key, double value)
-{
- sg_cfg_set_double(key, value);
-}
-
void sg_cfg_set_double(const char* key, double value)
{
(*simgrid_config)[key].set_value<double>(value);
* @param value the value to be added
*
*/
-void xbt_cfg_set_string(const char* key, const char* value)
-{
- sg_cfg_set_string(key, value);
-}
-
void sg_cfg_set_string(const char* key, const char* value)
{
(*simgrid_config)[key].set_value<std::string>(value);
* @param key the name of the variable
* @param value the value of the variable
*/
-void xbt_cfg_set_boolean(const char *key, const char *value)
-{
- sg_cfg_set_boolean(key, value);
-}
-
void sg_cfg_set_boolean(const char* key, const char* value)
{
(*simgrid_config)[key].set_value<bool>(simgrid::config::parse_bool(value));
*
* Returns the first value from the config set under the given name.
*/
-int xbt_cfg_get_int(const char *key)
-{
- return sg_cfg_get_int(key);
-}
-
int sg_cfg_get_int(const char* key)
{
return (*simgrid_config)[key].get_value<int>();
*
* Returns the first value from the config set under the given name.
*/
-double xbt_cfg_get_double(const char *key)
-{
- return sg_cfg_get_double(key);
-}
-
double sg_cfg_get_double(const char* key)
{
return (*simgrid_config)[key].get_value<double>();
* Returns the first value from the config set under the given name.
* If there is more than one value, it will issue a warning.
*/
-int xbt_cfg_get_boolean(const char *key)
-{
- return sg_cfg_get_boolean(key);
-}
-
int sg_cfg_get_boolean(const char* key)
{
return (*simgrid_config)[key].get_value<bool>() ? 1 : 0;