include src/simix/simcalls.in
include src/simix/simcalls.py
include src/simix/smx_context.cpp
-include src/simix/smx_deployment.cpp
include src/simix/smx_global.cpp
include src/simix/smx_private.hpp
include src/smpi/bindings/smpi_f77.cpp
XBT_ATTRIB_NORETURN= \
XBT_ATTRIB_UNUSED= \
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname,parent,desc)= \
- XBT_ATTRIB_DEPRECATED_v329(mesg)= \
XBT_ATTRIB_DEPRECATED_v330(mesg)= \
XBT_ATTRIB_DEPRECATED_v331(mesg)= \
XBT_ATTRIB_DEPRECATED_v332(mesg)=
.. doxygenfunction:: simgrid::s4u::this_actor::execute(double flop)
.. doxygenfunction:: simgrid::s4u::this_actor::execute(double flop, double priority)
.. doxygenfunction:: simgrid::s4u::this_actor::parallel_execute(const std::vector< s4u::Host * > &hosts, const std::vector< double > &flops_amounts, const std::vector< double > &bytes_amounts)
- .. doxygenfunction:: simgrid::s4u::this_actor::parallel_execute(const std::vector< s4u::Host * > &hosts, const std::vector< double > &flops_amounts, const std::vector< double > &bytes_amounts, double timeout)
.. group-tab:: Python
XBT_PUBLIC void sg_actor_daemonize(sg_actor_t actor);
XBT_PUBLIC int sg_actor_is_daemon(const_sg_actor_t actor);
-#ifndef DOXYGEN
-XBT_ATTRIB_DEPRECATED_v329("Please use sg_actor_set_host() instead") XBT_PUBLIC
- void sg_actor_migrate(sg_actor_t process, sg_host_t host);
-#endif
-
XBT_PUBLIC void sg_actor_set_host(sg_actor_t actor, sg_host_t host);
XBT_PUBLIC void sg_actor_join(const_sg_actor_t actor, double timeout);
XBT_PUBLIC void sg_actor_kill(sg_actor_t actor);
/** @brief Set the maxmin system of the current Model */
void set_maxmin_system(lmm::System* system);
- /** @brief Get the update algorithm of the current Model */
- XBT_ATTRIB_DEPRECATED_v329("Please use is_update_lazy()") UpdateAlgo get_update_algorithm() const
- {
- return update_algorithm_;
- }
-
/** @brief Get Action heap */
ActionHeap& get_action_heap() { return action_heap_; }
virtual double next_occurring_event_lazy(double now);
virtual double next_occurring_event_full(double now);
- XBT_ATTRIB_DEPRECATED_v329("Please use next_occurring_event()") virtual double next_occuring_event(double now) final
- {
- return next_occurring_event(now);
- }
- XBT_ATTRIB_DEPRECATED_v329("Please use next_occurring_event_lazy()") virtual double next_occuring_event_lazy(
- double now) final
- {
- return next_occurring_event_lazy(now);
- }
- XBT_ATTRIB_DEPRECATED_v329("Please use next_occurring_event_full()") virtual double next_occuring_event_full(
- double now) final
- {
- return next_occurring_event_full(now);
- }
-
private:
Action* extract_action(Action::StateSet* list);
*/
virtual bool next_occurring_event_is_idempotent() { return true; }
- XBT_ATTRIB_DEPRECATED_v329(
- "Please use next_occurring_event_is_idempotent()") virtual bool next_occuring_event_is_idempotent() final
- {
- return next_occurring_event_is_idempotent();
- }
-
/** @brief Gets the model name */
std::string get_name() const { return name_; }
/** @brief Creates the application described in the provided file */
XBT_PUBLIC void MSG_launch_application(const char* file);
-#ifndef DOXYGEN
-/** @brief register functions bypassing the parser */
-XBT_ATTRIB_DEPRECATED_v329("This function will be removed. Speak up if you need it.") XBT_PUBLIC
- void MSG_set_function(const char* host_id, const char* function_name, xbt_dynar_t arguments);
-#endif
-
/** @brief A clock (in second). */
XBT_PUBLIC double MSG_get_clock();
/** @brief Returns the amount of messages sent since the simulation start */
/** Simulates a write action. Returns the size of data actually written. */
sg_size_t write(sg_size_t size, bool write_inside = false);
- /** Allows to store user data on that host */
- XBT_ATTRIB_DEPRECATED_v329("Please use set_data()") void set_userdata(void* data) { set_data(data); }
- /** Retrieves the previously stored data */
- XBT_ATTRIB_DEPRECATED_v329("Please use get_data()") void* get_userdata() { return get_data(); }
-
sg_size_t size() const;
void seek(sg_offset_t pos); /** Sets the file head to the given position. */
void seek(sg_offset_t pos, int origin); /** Sets the file head to the given position from a given origin. */
static xbt::signal<void(Actor const&)> on_wake_up;
/** Signal to others that an actor is has been migrated to another host **/
static xbt::signal<void(const Actor&, const Host& previous_location)> on_host_change;
-#ifndef DOXYGEN
- static xbt::signal<void(Actor const&)> on_migration_start; // XBT_ATTRIB_DEPRECATED_v329
- static xbt::signal<void(Actor const&)> on_migration_end; // XBT_ATTRIB_DEPRECATED_v329
-#endif
/** Signal indicating that an actor terminated its code.
* @beginrst
* to take care of this yourself (only you knows which ones should be migrated).
*/
void set_host(Host* new_host);
-#ifndef DOXYGEN
- XBT_ATTRIB_DEPRECATED_v329("Please use set_host() instead") void migrate(Host* new_host) { set_host(new_host); }
-#endif
/** Ask the actor to die.
*
XBT_PUBLIC void parallel_execute(const std::vector<s4u::Host*>& hosts, const std::vector<double>& flops_amounts,
const std::vector<double>& bytes_amounts);
-XBT_ATTRIB_DEPRECATED_v329("Please use exec_init(...)->wait_for(timeout)") 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);
-
/** Initialize a sequential execution that must then be started manually */
XBT_PUBLIC ExecPtr exec_init(double flops_amounts);
/** Initialize a parallel execution that must then be started manually */
/** @brief Migrate the current actor to a new host. */
XBT_PUBLIC void set_host(Host* new_host);
-#ifndef DOXYGEN
-XBT_ATTRIB_DEPRECATED_v329("Please use set_host() instead") XBT_PUBLIC void migrate(Host* new_host);
-#endif
}
ExecPtr set_bound(double bound);
ExecPtr set_priority(double priority);
-#ifndef DOXYGEN
- XBT_ATTRIB_DEPRECATED_v329("Please use exec_init(...)->wait_for(timeout)") ExecPtr set_timeout(double timeout);
-#endif
Host* get_host() const;
unsigned int get_host_number() const;
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();
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid::kernel::timer::Timer::set()") XBT_PUBLIC smx_timer_t
- SIMIX_timer_set(double date, void (*function)(void*), void* arg);
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid::kernel::timer::Timer::remove()") XBT_PUBLIC
- void SIMIX_timer_remove(smx_timer_t timer);
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid::kernel::timer::Timer::next()") XBT_PUBLIC double SIMIX_timer_next();
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid::kernel::timer::Timer::get_date()") XBT_PUBLIC
- double SIMIX_timer_get_date(smx_timer_t timer);
-
-XBT_ATTRIB_DEPRECATED_v329("Please use simix_global->display_all_actor_status()") XBT_PUBLIC
- void SIMIX_display_process_status();
SG_END_DECL
-/******************************** Deployment **********************************/
-SG_BEGIN_DECL
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid_register_default() or Engine::register_default()") XBT_PUBLIC
- void SIMIX_function_register_default(xbt_main_func_t code);
-XBT_ATTRIB_DEPRECATED_v329("This function will be removed") XBT_PUBLIC void SIMIX_init_application();
-
-XBT_PUBLIC void SIMIX_process_set_function(const char* process_host, const char* process_function,
- xbt_dynar_t arguments, double process_start_time, double process_kill_time);
-SG_END_DECL
-
-#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid_register_function() or Engine::register_function()") XBT_PUBLIC
- void SIMIX_function_register(const std::string& name, void (*code)(std::vector<std::string>));
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid_register_function() or Engine::register_function()") XBT_PUBLIC
- void SIMIX_function_register(const std::string& name, xbt_main_func_t code);
-XBT_ATTRIB_DEPRECATED_v329("Please use simgrid_load_deployment() or Engine::load_deployment()") XBT_PUBLIC
- void SIMIX_launch_application(const std::string& file);
-#endif
-
/********************************* Process ************************************/
SG_BEGIN_DECL
-XBT_ATTRIB_DEPRECATED_v329("Please use sg_actor_count()") XBT_PUBLIC int SIMIX_process_count();
XBT_PUBLIC smx_actor_t SIMIX_process_self();
XBT_PUBLIC const char* SIMIX_process_self_get_name();
-XBT_ATTRIB_DEPRECATED_v329("This function will be removed") XBT_PUBLIC void SIMIX_process_self_set_data(void* data);
-XBT_ATTRIB_DEPRECATED_v329("This function will be removed") XBT_PUBLIC void* SIMIX_process_self_get_data();
SG_END_DECL
-#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v329("This function will be removed") XBT_PUBLIC
- void SIMIX_process_on_exit(smx_actor_t process, const std::function<void(bool /*failed*/)>& fun);
-#endif
-
/****************************** Communication *********************************/
#ifdef __cplusplus
XBT_PUBLIC void SIMIX_comm_set_copy_data_callback(void (*callback)(simgrid::kernel::activity::CommImpl*, void*,
#endif
-/**************************** Process simcalls ********************************/
-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_v329("Please use sg_actor_sleep_for()") XBT_PUBLIC
-#ifdef __cplusplus
- simgrid::kernel::activity::State
-#else
- enum kernel_activity_state
-#endif
- simcall_process_sleep(double duration);
-SG_END_DECL
-
/************************** Communication simcalls ****************************/
#ifdef __cplusplus
#define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg)))
#endif
-#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) \
XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.29)")
#define XBT_ATTRIB_DEPRECATED_v331(mesg) \
} // namespace kernel
} // namespace simgrid
-int SIMIX_process_count() // XBT_ATTRIB_DEPRECATED_v329
-{
- return simgrid::kernel::EngineImpl::get_instance()->get_actor_list().size();
-}
-
-void* SIMIX_process_self_get_data() // XBT_ATTRIB_DEPRECATED_v329
-{
- const simgrid::s4u::Actor* self = simgrid::s4u::Actor::self();
- return self ? self->get_data() : nullptr;
-}
-
-void SIMIX_process_self_set_data(void* data) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::s4u::Actor::self()->set_data(data);
-}
-
/* needs to be public and without simcall because it is called
by exceptions and logging events */
const char* SIMIX_process_self_get_name()
{
return simgrid::kernel::actor::ActorImpl::by_pid(pid);
}
-
-void SIMIX_process_on_exit(smx_actor_t actor,
- const std::function<void(bool /*failed*/)>& fun) // XBT_ATTRIB_DEPRECATED_v329
-{
- xbt_assert(actor, "current process not found: are you in maestro context ?");
- actor->on_exit->emplace_back(fun);
-}
-
-void simcall_process_set_data(smx_actor_t process, void* data) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::kernel::actor::simcall([process, data] { process->get_ciface()->set_data(data); });
-}
{
return msg_global->sent_msg;
}
-
-/** @brief register functions bypassing the parser */
-void MSG_set_function(const char* host_id, const char* function_name, xbt_dynar_t arguments)
-{
- SIMIX_process_set_function(host_id, function_name, arguments, -1, -1);
-}
xbt::signal<void(Actor const&)> s4u::Actor::on_resume;
xbt::signal<void(Actor const&)> s4u::Actor::on_sleep;
xbt::signal<void(Actor const&)> s4u::Actor::on_wake_up;
-#ifndef DOXYGEN
-xbt::signal<void(Actor const&)> s4u::Actor::on_migration_start; // XBT_ATTRIB_DEPRECATED_v329
-xbt::signal<void(Actor const&)> s4u::Actor::on_migration_end; // XBT_ATTRIB_DEPRECATED_v329
-#endif
xbt::signal<void(Actor const&, Host const& previous_location)> s4u::Actor::on_host_change;
xbt::signal<void(Actor const&)> s4u::Actor::on_termination;
xbt::signal<void(Actor const&)> s4u::Actor::on_destruction;
void Actor::set_host(Host* new_host)
{
- if (s4u::Actor::on_migration_start.get_slot_count() > 0) { // XBT_ATTRIB_DEPRECATED_v329
- static bool already_warned = false;
- if (not already_warned) {
- XBT_INFO("Please use s4u::Actor::on_host_change instead of s4u::Actor::on_migration_start. This will be removed "
- "in v3.29");
- already_warned = true;
- }
- s4u::Actor::on_migration_start(*this);
- }
-
const s4u::Host* previous_location = get_host();
kernel::actor::simcall([this, new_host]() {
this->pimpl_->set_host(new_host);
});
- if (s4u::Actor::on_migration_end.get_slot_count() > 0) { // XBT_ATTRIB_DEPRECATED_v329
- static bool already_warned = false;
- if (not already_warned) {
- XBT_INFO("Please use s4u::Actor::on_host_change instead of s4u::Actor::on_migration_end. This will be removed in "
- "v3.29");
- already_warned = true;
- }
- s4u::Actor::on_migration_end(*this);
- }
-
s4u::Actor::on_host_change(*this, *previous_location);
}
exec_init(hosts, flops_amounts, bytes_amounts)->wait();
}
-void parallel_execute(const std::vector<s4u::Host*>& hosts, const std::vector<double>& flops_amounts,
- const std::vector<double>& bytes_amounts, double timeout) // XBT_ATTRIB_DEPRECATED_v329
-{
- exec_init(hosts, flops_amounts, bytes_amounts)->wait_for(timeout);
-}
-
ExecPtr exec_init(double flops_amount)
{
return Exec::init()->set_flops_amount(flops_amount)->set_host(get_host());
{
simgrid::kernel::actor::ActorImpl::self()->get_iface()->set_host(new_host);
}
-void migrate(Host* new_host) // XBT_ATTRIB_DEPRECATED_v329
-{
- set_host(new_host);
-}
} // namespace this_actor
} // namespace s4u
{
actor->set_host(host);
}
-void sg_actor_migrate(sg_actor_t actor, sg_host_t host) // XBT_ATTRIB_DEPRECATED_v329
-{
- actor->set_host(host);
-}
/**
* @brief Wait for the completion of a #sg_actor_t.
return this;
}
-ExecPtr Exec::set_timeout(double timeout) // XBT_ATTRIB_DEPRECATED_v329
-{
- xbt_assert(state_ == State::INITED || state_ == State::STARTING,
- "Cannot change the bound of an exec after its start");
- kernel::actor::simcall(
- [this, timeout] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_timeout(timeout); });
- return this;
-}
-
ExecPtr Exec::set_flops_amount(double flops_amount)
{
xbt_assert(state_ == State::INITED || state_ == State::STARTING,
&observer);
}
-simgrid::kernel::activity::State simcall_process_sleep(double duration) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::kernel::actor::ActorImpl::self()->sleep(duration);
- return simgrid::kernel::activity::State::DONE;
-}
-
/**
* @ingroup simix_comm_management
*/
+++ /dev/null
-/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
-
-/* 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. */
-
-#include "simgrid/s4u/Host.hpp"
-#include "smx_private.hpp"
-#include "src/kernel/EngineImpl.hpp"
-#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
-#include <simgrid/engine.h>
-#include <simgrid/s4u/Engine.hpp>
-
-#include <string>
-#include <vector>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_deployment, simix, "Logging specific to SIMIX (deployment)");
-
-void SIMIX_init_application() // XBT_ATTRIB_DEPRECATED_v329
-{
- sg_platf_exit();
- sg_platf_init();
-}
-
-void SIMIX_launch_application(const std::string& file) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid_load_deployment(file.c_str());
-}
-void SIMIX_function_register(const std::string& name, xbt_main_func_t code) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::s4u::Engine::get_instance()->register_function(name, code);
-}
-void SIMIX_function_register(const std::string& name,
- void (*code)(std::vector<std::string>)) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::s4u::Engine::get_instance()->register_function(name, code);
-}
-void SIMIX_function_register_default(xbt_main_func_t code) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::s4u::Engine::get_instance()->register_default(code);
-}
-
-/** @brief Bypass the parser, get arguments, and set function to each process */
-void SIMIX_process_set_function(const char* process_host, const char* process_function, xbt_dynar_t arguments,
- double process_start_time, double process_kill_time) // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::kernel::routing::ActorCreationArgs actor;
-
- const simgrid::s4u::Host* host = sg_host_by_name(process_host);
- if (not host)
- throw std::invalid_argument(simgrid::xbt::string_printf("Host '%s' unknown", process_host));
- actor.host = process_host;
- actor.args.emplace_back(process_function);
- /* add arguments */
- unsigned int i;
- char *arg;
- xbt_dynar_foreach(arguments, i, arg) {
- actor.args.emplace_back(arg);
- }
-
- // Check we know how to handle this function name:
- const simgrid::kernel::actor::ActorCodeFactory& parse_code =
- simgrid::kernel::EngineImpl::get_instance()->get_function(process_function);
- xbt_assert(parse_code, "Function '%s' unknown", process_function);
-
- actor.function = process_function;
- actor.kill_time = process_kill_time;
- actor.start_time = process_start_time;
- actor.restart_on_failure = false;
- sg_platf_new_actor(&actor);
-}
simgrid::kernel::EngineImpl::get_instance()->run();
}
-double SIMIX_timer_next() // XBT_ATTRIB_DEPRECATED_v329
-{
- return simgrid::kernel::timer::Timer::next();
-}
-
-smx_timer_t SIMIX_timer_set(double date, void (*callback)(void*), void* arg) // XBT_ATTRIB_DEPRECATED_v329
-{
- return simgrid::kernel::timer::Timer::set(date, std::bind(callback, arg));
-}
-
-/** @brief cancels a timer that was added earlier */
-void SIMIX_timer_remove(smx_timer_t timer) // XBT_ATTRIB_DEPRECATED_v329
-{
- timer->remove();
-}
-
-/** @brief Returns the date at which the timer will trigger (or 0 if nullptr timer) */
-double SIMIX_timer_get_date(smx_timer_t timer) // XBT_ATTRIB_DEPRECATED_v329
-{
- return timer ? timer->get_date() : 0.0;
-}
-
-void SIMIX_display_process_status() // XBT_ATTRIB_DEPRECATED_v329
-{
- simgrid::kernel::EngineImpl::get_instance()->display_all_actor_status();
-}
-
int SIMIX_is_maestro()
{
if (simix_global == nullptr) // SimDag
src/kernel/context/ContextSwapped.hpp
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextThread.hpp
- src/simix/smx_deployment.cpp
src/simix/smx_global.cpp
src/simix/popping.cpp
src/kernel/activity/ActivityImpl.cpp