.. doxygenTODOfunction:: simgrid::s4u::Host::route_to(const Host *dest, std::vector< Link * > &links, double *latency)
.. doxygenTODOfunction:: simgrid::s4u::Host::route_to(const Host *dest, std::vector< kernel::resource::LinkImpl * > &links, double *latency)
-# The fact that actors can return an int is a legacy behavior for MSG
.. doxygenTODOfunction:: simgrid::s4u::Engine::register_default(const kernel::actor::ActorCodeFactory &factory)
-.. doxygenTODOfunction:: simgrid::s4u::Engine::register_default(int(*code)(int, char **))
.. doxygenTODOfunction:: simgrid::s4u::Engine::register_function(const std::string &name, const kernel::actor::ActorCodeFactory &factory)
-.. doxygenTODOfunction:: simgrid::s4u::Engine::register_function(const std::string &name, int(*code)(int, char **))
# These should not be public
.. doxygenfunction:: simgrid::s4u::Link::get_impl()
XBT_ATTRIB_NORETURN= \
XBT_ATTRIB_UNUSED= \
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname,parent,desc)= \
- XBT_ATTRIB_DEPRECATED_v330(mesg)= \
XBT_ATTRIB_DEPRECATED_v331(mesg)= \
XBT_ATTRIB_DEPRECATED_v332(mesg)= \
XBT_ATTRIB_DEPRECATED_v333(mesg)=
.. doxygenfunction:: MSG_process_create_with_environment
.. doxygenfunction:: MSG_process_daemonize
.. doxygenfunction:: MSG_process_detach
-.. doxygenfunction:: MSG_processes_as_dynar
.. doxygenfunction:: MSG_process_from_PID
.. doxygenfunction:: MSG_process_get_data
.. doxygenfunction:: MSG_process_get_host
.. doxygenfunction:: MSG_process_get_name
-.. doxygenfunction:: MSG_process_get_number
.. doxygenfunction:: MSG_process_get_PID
.. doxygenfunction:: MSG_process_get_PPID
.. doxygenfunction:: MSG_process_get_properties
.. doxygenfunction:: MSG_host_is_on
.. doxygenfunction:: MSG_host_off
.. doxygenfunction:: MSG_host_on
-.. doxygenfunction:: MSG_hosts_as_dynar
.. doxygenfunction:: MSG_host_self
.. doxygenfunction:: MSG_host_set_data
.. doxygenfunction:: MSG_host_set_property_value
.. group-tab:: C
- .. doxygenfunction:: simgrid_get_actor_count()
+ .. doxygenfunction:: sg_actor_count()
Retrieving hosts
----------------
.. doxygenfunction:: sg_host_by_name(const char *name)
.. doxygenfunction:: sg_host_count()
.. doxygenfunction:: sg_host_list()
- .. doxygenfunction:: sg_hosts_as_dynar()
Modifying characteristics
-------------------------
XBT_PUBLIC const char* sg_actor_self_get_name();
XBT_PUBLIC void* sg_actor_self_get_data();
XBT_PUBLIC void sg_actor_self_set_data(void* data);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_self_get_data() instead") XBT_PUBLIC void* sg_actor_self_data();
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_self_set_data() instead") XBT_PUBLIC
- void sg_actor_self_data_set(void* data);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_execute() instead") XBT_PUBLIC void sg_actor_self_execute(double flops);
XBT_PUBLIC void sg_actor_execute(double flops);
XBT_PUBLIC void sg_actor_execute_with_priority(double flops, double priority);
void sg_actor_parallel_execute(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount);
XBT_PUBLIC void sg_actor_unref(const_sg_actor_t actor);
XBT_PUBLIC void* sg_actor_get_data(const_sg_actor_t actor);
XBT_PUBLIC void sg_actor_set_data(sg_actor_t actor, void* userdata);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_get_data() instead") XBT_PUBLIC
- void* sg_actor_data(const_sg_actor_t actor);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_set_data() instead") XBT_PUBLIC
- void sg_actor_data_set(sg_actor_t actor, void* userdata);
XBT_PUBLIC sg_exec_t sg_actor_exec_init(double computation_amount);
XBT_PUBLIC sg_exec_t sg_actor_parallel_exec_init(int host_nb, const sg_host_t* host_list, double* flops_amount,
* is assumed to be the maestro. */
XBT_PUBLIC void simgrid_set_maestro(void (*code)(void*), void* data);
-/** Retrieve the number of actors in the simulation */
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_count()") XBT_PUBLIC int simgrid_get_actor_count();
-
/** @brief Allow other libraries to react to the --help flag, too
*
* When finding --help on the command line, simgrid usually stops right after displaying its help message.
using smx_mailbox_t = simgrid::kernel::activity::MailboxImpl*;
using smx_mutex_t = simgrid::kernel::activity::MutexImpl*;
using smx_sem_t = simgrid::kernel::activity::SemaphoreImpl*;
-using e_smx_state_t XBT_ATTRIB_DEPRECATED_v330("Please use kernel::activity::State") = simgrid::kernel::activity::State;
#else
typedef struct s4u_Actor s4u_Actor;
typedef struct s4u_Disk s4u_Disk;
typedef struct s4u_NetZone s4u_NetZone;
typedef struct s4u_VM s4u_VM;
-XBT_ATTRIB_DEPRECATED_v330("Please stop using this type alias") typedef enum kernel_activity_state e_smx_state_t;
typedef struct s_smx_timer* smx_timer_t;
typedef struct s_smx_actor* smx_actor_t;
/** Returns the amount of hosts existing in the platform. */
XBT_PUBLIC size_t sg_host_count();
-/**
- * @brief Return a dynar containing all the hosts declared at a given point of time (including VMs)
- * @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)
- */
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_list()") XBT_PUBLIC xbt_dynar_t sg_hosts_as_dynar();
-
XBT_PUBLIC size_t sg_host_extension_create(void (*deleter)(void*));
XBT_PUBLIC void* sg_host_extension_get(const_sg_host_t host, size_t rank);
*/
XBT_PUBLIC void sg_host_set_data(sg_host_t host, void* userdata);
-#ifndef DOXYGEN
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_data()") XBT_PUBLIC void* sg_host_data(const_sg_host_t host);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_set_data()") XBT_PUBLIC
- void sg_host_data_set(sg_host_t host, void* userdata);
-#endif
-
// ========= storage related functions ============
XBT_PUBLIC void sg_host_get_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks);
// =========== user-level functions ===============
/** @brief Return the speed of the processor (in flop/s), regardless of the current load on the machine. */
XBT_PUBLIC double sg_host_get_speed(const_sg_host_t host);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_speed()") XBT_PUBLIC double sg_host_speed(const_sg_host_t host);
XBT_PUBLIC double sg_host_get_pstate_speed(const_sg_host_t host, unsigned long pstate_index);
XBT_PUBLIC double sg_host_get_available_speed(const_sg_host_t host);
* @param host a host
*/
XBT_PUBLIC double sg_host_get_load(const_sg_host_t host);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_load()") XBT_PUBLIC double sg_host_load(const_sg_host_t host);
/** @brief Return the location on which the current process is running. */
XBT_PUBLIC sg_host_t sg_host_self();
XBT_PUBLIC void sg_host_get_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links);
XBT_PUBLIC double sg_host_get_route_latency(const_sg_host_t from, const_sg_host_t to);
XBT_PUBLIC double sg_host_get_route_bandwidth(const_sg_host_t from, const_sg_host_t to);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_route()") XBT_PUBLIC
- void sg_host_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_route_latency()") XBT_PUBLIC
- double sg_host_route_latency(const_sg_host_t from, const_sg_host_t to);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_route_bandwidth()") XBT_PUBLIC
- double sg_host_route_bandwidth(const_sg_host_t from, const_sg_host_t to);
XBT_PUBLIC void sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount);
-#ifndef DOXYGEN
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_sendto") inline void sg_host_send_to(sg_host_t from, sg_host_t to,
- double byte_amount)
-{
- sg_host_sendto(from, to, byte_amount);
-}
-#endif
-
XBT_PUBLIC void sg_host_dump(const_sg_host_t ws);
XBT_PUBLIC void sg_host_get_actor_list(const_sg_host_t host, xbt_dynar_t whereto);
/** @brief Set the characteristics of links inside the Dragonfly zone */
void set_link_characteristics(double bw, double lat, s4u::Link::SharingPolicy sharing_policy) override;
Coords rankId_to_coords(unsigned long rank_id) const;
- XBT_ATTRIB_DEPRECATED_v330("Please use rankId_to_coords(int)") void rankId_to_coords(int rank_id,
- unsigned long coords[4]) const;
private:
void generate_routers(const s4u::ClusterCallbacks& set_callbacks);
protected:
Route* new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<resource::LinkImpl*>& link_list, bool preserve_order);
- XBT_ATTRIB_DEPRECATED_v330("Please drop 2nd, 3rd and 7th parameters") virtual Route* new_extended_route(
- RoutingMode hierarchy, NetPoint* /* src */, NetPoint* /* dst */, NetPoint* gw_src, NetPoint* gw_dst,
- std::vector<resource::LinkImpl*>& link_list, bool /* symmetrical */, bool preserve_order)
- {
- return new_extended_route(hierarchy, gw_src, gw_dst, link_list, preserve_order);
- }
void get_route_check_params(const NetPoint* src, const NetPoint* dst) const;
void add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<s4u::LinkInRoute>& link_list, bool symmetrical) const;
/* C interface */
SG_BEGIN_DECL
XBT_PUBLIC const char* sg_link_get_name(const_sg_link_t link);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_link_get_name()") XBT_PUBLIC const char* sg_link_name(const_sg_link_t link);
XBT_PUBLIC sg_link_t sg_link_by_name(const char* name);
XBT_PUBLIC int sg_link_is_shared(const_sg_link_t link);
XBT_PUBLIC double sg_link_get_bandwidth(const_sg_link_t link);
XBT_PUBLIC void sg_link_set_bandwidth(sg_link_t link, double value);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_link_get_bandwidth()") XBT_PUBLIC
- double sg_link_bandwidth(const_sg_link_t link);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_link_set_bandwidth()") XBT_PUBLIC
- void sg_link_bandwidth_set(sg_link_t link, double value);
XBT_PUBLIC double sg_link_get_latency(const_sg_link_t link);
XBT_PUBLIC void sg_link_set_latency(sg_link_t link, double value);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_link_get_latency()") XBT_PUBLIC double sg_link_latency(const_sg_link_t link);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_link_set_latency()") XBT_PUBLIC
- void sg_link_latency_set(sg_link_t link, double value);
XBT_PUBLIC void* sg_link_get_data(const_sg_link_t link);
XBT_PUBLIC void sg_link_set_data(sg_link_t link, void* data);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_link_get_data()") XBT_PUBLIC void* sg_link_data(const_sg_link_t link);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_link_set_data()") XBT_PUBLIC
- void sg_link_data_set(sg_link_t link, void* data);
XBT_PUBLIC size_t sg_link_count();
XBT_PUBLIC sg_link_t* sg_link_list();
SG_END_DECL
/** @brief Returns the amount of host found in the platform */
XBT_PUBLIC size_t MSG_get_host_number();
-/** @brief Returns a dynar with all existing hosts
- *
- * 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).
- */
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_list()") XBT_PUBLIC xbt_dynar_t MSG_hosts_as_dynar();
/** @brief Returns the name of this host */
XBT_PUBLIC const char* MSG_host_get_name(const_sg_host_t host);
XBT_PUBLIC void MSG_process_detach();
XBT_PUBLIC void MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_list()") XBT_PUBLIC xbt_dynar_t MSG_processes_as_dynar();
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_count()") XBT_PUBLIC int MSG_process_get_number();
XBT_PUBLIC void* MSG_process_get_data(const_sg_actor_t process);
XBT_PUBLIC msg_error_t MSG_process_set_data(msg_process_t process, void* data);
void load_platform(const std::string& platf) const;
-#ifndef DOXYGEN
- XBT_ATTRIB_DEPRECATED_v330("Please change the return code of your actors to void") void register_function(
- const std::string& name, int (*code)(int, char**));
- XBT_ATTRIB_DEPRECATED_v330("Please change the return code of your actors to void") void register_default(
- int (*code)(int, char**));
-#endif
-
void register_function(const std::string& name, const std::function<void(int, char**)>& code);
void register_function(const std::string& name, const std::function<void(std::vector<std::string>)>& code);
void register_function(const std::string& name, const kernel::actor::ActorCodeFactory& factory);
#ifndef DOXYGEN
XBT_ATTRIB_DEPRECATED_v331("Please use Comm::sendto()") void sendto(Host* dest, double byte_amount);
XBT_ATTRIB_DEPRECATED_v331("Please use Comm::sendto_async()") CommPtr sendto_async(Host* dest, double byte_amount);
- XBT_ATTRIB_DEPRECATED_v330("Please use Host::sendto()") void send_to(Host* dest, double byte_amount);
#endif
NetZone* get_englobing_zone() const;
/******************************* Host simcalls ********************************/
#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Exec::wait_for()") XBT_PUBLIC simgrid::kernel::activity::State
- simcall_execution_wait(simgrid::kernel::activity::ActivityImpl* execution, double timeout);
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Exec::wait_for()") XBT_PUBLIC simgrid::kernel::activity::State
- simcall_execution_wait(const simgrid::kernel::activity::ActivityImplPtr& execution, double timeout);
XBT_ATTRIB_DEPRECATED_v331("Please use s4u::Exec::wait_any_for()") XBT_PUBLIC
unsigned int simcall_execution_waitany_for(simgrid::kernel::activity::ExecImpl* execs[], size_t count,
double timeout);
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Exec::test()") XBT_PUBLIC
- bool simcall_execution_test(simgrid::kernel::activity::ActivityImpl* execution);
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Exec::test()") XBT_PUBLIC
- bool simcall_execution_test(const simgrid::kernel::activity::ActivityImplPtr& execution);
-
#endif
/************************** Communication simcalls ****************************/
bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data, double rate);
-XBT_ATTRIB_DEPRECATED_v330("Please use Mailbox::iprobe()") XBT_PUBLIC simgrid::kernel::activity::ActivityImplPtr
- simcall_comm_iprobe(smx_mailbox_t mbox, int type,
- bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*), void* data);
-
-XBT_ATTRIB_DEPRECATED_v330("Please use a CommImpl*[] for first parameter") XBT_PUBLIC
- unsigned int simcall_comm_waitany(simgrid::kernel::activity::ActivityImplPtr comms[], size_t count, double timeout);
XBT_PUBLIC ssize_t simcall_comm_waitany(simgrid::kernel::activity::CommImpl* comms[], size_t count, double timeout);
XBT_PUBLIC void simcall_comm_wait(simgrid::kernel::activity::ActivityImpl* comm, double timeout);
XBT_PUBLIC bool simcall_comm_test(simgrid::kernel::activity::ActivityImpl* comm);
-XBT_ATTRIB_DEPRECATED_v330("Please use a CommImpl*[] for first parameter") XBT_PUBLIC
- int simcall_comm_testany(simgrid::kernel::activity::ActivityImplPtr comms[], size_t count);
XBT_PUBLIC ssize_t simcall_comm_testany(simgrid::kernel::activity::CommImpl* comms[], size_t count);
-XBT_ATTRIB_DEPRECATED_v330("Please use an ActivityImpl* for first parameter") inline void simcall_comm_wait(
- const simgrid::kernel::activity::ActivityImplPtr& comm, double timeout)
-{
- simcall_comm_wait(comm.get(), timeout);
-}
-XBT_ATTRIB_DEPRECATED_v330("Please use an ActivityImpl* for first parameter") inline bool simcall_comm_test(
- const simgrid::kernel::activity::ActivityImplPtr& comm)
-{
- return simcall_comm_test(comm.get());
-}
#endif
/************************** Synchro simcalls **********************************/
SG_BEGIN_DECL
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_mutex_init()") XBT_PUBLIC smx_mutex_t simcall_mutex_init();
XBT_ATTRIB_DEPRECATED_v331("Please use sg_mutex_lock()") XBT_PUBLIC void simcall_mutex_lock(smx_mutex_t mutex);
XBT_ATTRIB_DEPRECATED_v331("Please use sg_mutex_try_lock()") XBT_PUBLIC int simcall_mutex_trylock(smx_mutex_t mutex);
XBT_ATTRIB_DEPRECATED_v331("Please use sg_mutex_unlock()") XBT_PUBLIC void simcall_mutex_unlock(smx_mutex_t mutex);
-XBT_ATTRIB_DEPRECATED_v330("Please use sg_cond_init()") XBT_PUBLIC smx_cond_t simcall_cond_init();
XBT_ATTRIB_DEPRECATED_v331("Please use sg_cond_wait()") XBT_PUBLIC
void simcall_cond_wait(smx_cond_t cond, smx_mutex_t mutex);
XBT_ATTRIB_DEPRECATED_v331("Please use sg_cond_wait_for()") XBT_PUBLIC
int simcall_sem_acquire_timeout(smx_sem_t sem, double max_duration);
SG_END_DECL
-/***************************** Io **************************************/
-#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Io::wait_for()") XBT_PUBLIC simgrid::kernel::activity::State
- simcall_io_wait(simgrid::kernel::activity::ActivityImpl* io, double timeout);
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Io::wait_for()") XBT_PUBLIC simgrid::kernel::activity::State
- simcall_io_wait(const simgrid::kernel::activity::ActivityImplPtr& io, double timeout);
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Io::test()") XBT_PUBLIC
- bool simcall_io_test(simgrid::kernel::activity::ActivityImpl* io);
-XBT_ATTRIB_DEPRECATED_v330("Please use s4u::Io::test()") XBT_PUBLIC
- bool simcall_io_test(const simgrid::kernel::activity::ActivityImplPtr& io);
-#endif
/************************** MC simcalls **********************************/
SG_BEGIN_DECL
XBT_ATTRIB_DEPRECATED_v331("Please use MC_random()") XBT_PUBLIC int simcall_mc_random(int min, int max);
#define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg)))
#endif
-#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) \
XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.30)")
#define XBT_ATTRIB_DEPRECATED_v332(mesg) \
static simgrid::config::Flag<bool> trace_actor_enabled{
"tracing/actor",
- {"tracing/msg/process"}, // XBT_ATTRIB_DEPRECATED_v330(option alias)
"Trace the behavior of all categorized actors, grouping them by host. "
"Can be used to track actor location if the simulator does actor migration.",
false};
* - You are added from ActorImpl::simcall_answer() only. When this function is called depends on the
* resource kind (network, cpu, disk, whatever), but the same arguments hold. Let's take communications
* as an example.
- * - For communications, this function is called from SIMIX_comm_finish().
+ * - For communications, this function is called from CommImpl::finish().
* This function itself don't mess with the order since simcalls are handled in FIFO order.
* The function is called:
* - before the comm starts (invalid parameters, or resource already dead or whatever).
/* try to pursue anyway */
}
#if SIMGRID_HAVE_MC
- /* Retrieve the saved pointer. See SIMIX_context_stack_new above. */
+ /* Retrieve the saved pointer. See the initialization above. */
stack_ = reinterpret_cast<unsigned char**>(stack_)[-1];
#endif
}
return coords;
}
-void DragonflyZone::rankId_to_coords(int rankId, unsigned long coords[4]) const // XBT_ATTRIB_DEPRECATED_v330
-{
- const auto s_coords = rankId_to_coords(rankId);
- coords[0] = s_coords.group;
- coords[1] = s_coords.chassis;
- coords[2] = s_coords.blade;
- coords[3] = s_coords.node;
-}
-
void DragonflyZone::set_link_characteristics(double bw, double lat, s4u::Link::SharingPolicy sharing_policy)
{
ClusterBase::set_link_characteristics(bw, lat, sharing_policy);
{
sg_actor_unref(process);
}
-/** @brief Return the current number MSG processes. */
-int MSG_process_get_number() // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_actor_count();
-}
+
/* ************************** NetZones *************************** */
sg_netzone_t MSG_zone_get_root()
{
}
/* ************************** hosts *************************** */
-xbt_dynar_t MSG_hosts_as_dynar() // XBT_ATTRIB_DEPRECATED_v330
-{
- size_t host_count = sg_host_count();
- sg_host_t* list = sg_host_list();
-
- xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr);
- for (size_t i = 0; i < host_count; i++)
- xbt_dynar_push_as(res, sg_host_t, list[i]);
- xbt_free(list);
-
- return res;
-}
size_t MSG_get_host_number()
{
return sg_host_count();
{
msg_global->process_data_cleanup = data_cleanup;
}
-
-/** @brief returns a list of all currently existing processes */
-xbt_dynar_t MSG_processes_as_dynar() // XBT_ATTRIB_DEPRECATED_v330
-{
- xbt_dynar_t res = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
- for (auto const& kv : simgrid::kernel::EngineImpl::get_instance()->get_actor_list()) {
- smx_actor_t actor = kv.second;
- xbt_dynar_push(res, &actor);
- }
- return res;
-}
simgrid::s4u::Actor::self()->set_data(userdata);
}
-void* sg_actor_self_data() // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_actor_self_get_data();
-}
-
-void sg_actor_self_data_set(void* userdata) // XBT_ATTRIB_DEPRECATED_v330
-{
- sg_actor_self_set_data(userdata);
-}
-
sg_actor_t sg_actor_self()
{
return simgrid::s4u::Actor::self();
}
-void sg_actor_self_execute(double flops) // XBT_ATTRIB_DEPRECATED_v330
-{
- simgrid::s4u::this_actor::execute(flops);
-}
-
void sg_actor_execute(double flops)
{
simgrid::s4u::this_actor::execute(flops);
actor->set_data(userdata);
}
-void* sg_actor_data(const_sg_actor_t actor) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_actor_get_data(actor);
-}
-
-void sg_actor_data_set(sg_actor_t actor, void* userdata) // XBT_ATTRIB_DEPRECATED_v330
-{
- sg_actor_set_data(actor, userdata);
-}
-
/** @brief Add a function to the list of "on_exit" functions for the current actor.
* The on_exit functions are the functions executed when your actor is killed.
* You should use them to free the data used by your actor.
pimpl->load_platform(platf);
}
-void Engine::register_function(const std::string& name, int (*code)(int, char**)) // XBT_ATTRIB_DEPRECATED_v330
-{
- kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
- return xbt::wrap_main(code, std::move(args));
- };
- register_function(name, code_factory);
-}
-void Engine::register_default(int (*code)(int, char**)) // XBT_ATTRIB_DEPRECATED_v330
-{
- register_default([code](std::vector<std::string> args) { return xbt::wrap_main(code, std::move(args)); });
-}
-
/** Registers the main function of an actor that will be launched from the deployment file */
void Engine::register_function(const std::string& name, const std::function<void(int, char**)>& code)
{
return simgrid::s4u::Engine::get_clock();
}
-int simgrid_get_actor_count() // XBT_ATTRIB_DEPRECATED_v330
-{
- return simgrid::s4u::Engine::get_instance()->get_actor_count();
-}
-
void simgrid_set_maestro(void (*code)(void*), void* data)
{
#ifdef _WIN32
{
return Comm::sendto_async(this, dest, byte_amount);
}
-
-void Host::send_to(Host* dest, double byte_amount) // XBT_ATTRIB_DEPRECATED_v330
-{
- Comm::sendto(this, dest, byte_amount);
-}
#endif
/** Get the properties assigned to a host */
return simgrid::s4u::Host::by_name_or_null(name);
}
-xbt_dynar_t sg_hosts_as_dynar() // XBT_ATTRIB_DEPRECATED_v330
-{
- std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::get_instance()->get_all_hosts();
-
- auto last = std::remove_if(begin(list), end(list), [](const simgrid::s4u::Host* host) {
- return not host || not host->get_netpoint() || not host->get_netpoint()->is_host();
- });
- std::sort(begin(list), last,
- [](const simgrid::s4u::Host* a, const simgrid::s4u::Host* b) { return a->get_name() < b->get_name(); });
-
- xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr);
- std::for_each(begin(list), last, [res](sg_host_t host) { xbt_dynar_push_as(res, sg_host_t, host); });
- return res;
-}
-
// ========= Layering madness ==============*
// ========== User data Layer ==========
{
host->set_data(userdata);
}
-void* sg_host_data(const_sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_host_get_data(host);
-}
-void sg_host_data_set(sg_host_t host, void* userdata) // XBT_ATTRIB_DEPRECATED_v330
-{
- sg_host_set_data(host, userdata);
-}
// ========= Disk related functions ============
void sg_host_get_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
return host->get_speed();
}
-double sg_host_speed(const_sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_host_get_speed(host);
-}
-
/** @brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_host_energy.
*
* @param host host to test
return min_bandwidth;
}
-void sg_host_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links) // XBT_ATTRIB_DEPRECATED_v330
-{
- sg_host_get_route(from, to, links);
-}
-
-double sg_host_route_latency(const_sg_host_t from, const_sg_host_t to) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_host_get_route_latency(from, to);
-}
-
-double sg_host_route_bandwidth(const_sg_host_t from, const_sg_host_t to) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_host_get_route_bandwidth(from, to);
-}
-
void sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount)
{
simgrid::s4u::Comm::sendto(from, to, byte_amount);
{
return host->get_load();
}
-
-double sg_host_load(const_sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_host_get_load(host);
-}
return link->get_cname();
}
-const char* sg_link_name(const_sg_link_t link) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_link_get_name(link);
-}
-
sg_link_t sg_link_by_name(const char* name)
{
return simgrid::s4u::Link::by_name(name);
link->set_bandwidth(value);
}
-double sg_link_bandwidth(const_sg_link_t link) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_link_get_bandwidth(link);
-}
-
-void sg_link_bandwidth_set(sg_link_t link, double value) // XBT_ATTRIB_DEPRECATED_v330
-{
- sg_link_set_bandwidth(link, value);
-}
-
double sg_link_get_latency(const_sg_link_t link)
{
return link->get_latency();
link->set_latency(value);
}
-double sg_link_latency(const_sg_link_t link) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_link_get_latency(link);
-}
-
-void sg_link_latency_set(sg_link_t link, double value) // XBT_ATTRIB_DEPRECATED_v330
-{
- sg_link_set_latency(link, value);
-}
-
void* sg_link_get_data(const_sg_link_t link)
{
return link->get_data();
link->set_data(data);
}
-void* sg_link_data(const_sg_link_t link) // XBT_ATTRIB_DEPRECATED_v330
-{
- return sg_link_get_data(link);
-}
-
-void sg_link_data_set(sg_link_t link, void* data) // XBT_ATTRIB_DEPRECATED_v330
-{
- sg_link_set_data(link, data);
-}
-
size_t sg_link_count()
{
return simgrid::s4u::Engine::get_instance()->get_link_count();
#include <typeinfo>
XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
-/**
- * @ingroup simix_host_management
- * @brief Waits for the completion of an execution synchro and destroy it.
- *
- * @param execution The execution synchro
- */
-simgrid::kernel::activity::State simcall_execution_wait(simgrid::kernel::activity::ActivityImpl* execution,
- double timeout) // XBT_ATTRIB_DEPRECATED_v330
-{
- simgrid::kernel::actor::ActorImpl* issuer = simgrid::kernel::actor::ActorImpl::self();
- simgrid::kernel::actor::simcall_blocking([execution, issuer, timeout] { execution->wait_for(issuer, timeout); });
- return simgrid::kernel::activity::State::DONE;
-}
-
-simgrid::kernel::activity::State simcall_execution_wait(const simgrid::kernel::activity::ActivityImplPtr& execution,
- double timeout) // XBT_ATTRIB_DEPRECATED_v330
-{
- simgrid::kernel::actor::ActorImpl* issuer = simgrid::kernel::actor::ActorImpl::self();
- simgrid::kernel::actor::simcall_blocking([execution, issuer, timeout] { execution->wait_for(issuer, timeout); });
- return simgrid::kernel::activity::State::DONE;
-}
-
-bool simcall_execution_test(simgrid::kernel::activity::ActivityImpl* execution) // XBT_ATTRIB_DEPRECATED_v330
-{
- return simgrid::kernel::actor::simcall([execution] { return execution->test(); });
-}
-
-bool simcall_execution_test(const simgrid::kernel::activity::ActivityImplPtr& execution) // XBT_ATTRIB_DEPRECATED_v330
-{
- return simgrid::kernel::actor::simcall([execution] { return execution->test(); });
-}
-
unsigned int simcall_execution_waitany_for(simgrid::kernel::activity::ExecImpl* execs[], size_t count,
double timeout) // XBT_ATTRIB_DEPRECATED_v331
{
/**
* @ingroup simix_comm_management
*/
-simgrid::kernel::activity::ActivityImplPtr
-simcall_comm_iprobe(smx_mailbox_t mbox, int type, bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
- void* data) // XBT_ATTRIB_DEPRECATED_v330
-{
- xbt_assert(mbox, "No rendez-vous point defined for iprobe");
-
- return simgrid::kernel::actor::simcall([mbox, type, match_fun, data] { return mbox->iprobe(type, match_fun, data); });
-}
-
-/**
- * @ingroup simix_comm_management
- */
-unsigned int simcall_comm_waitany(simgrid::kernel::activity::ActivityImplPtr comms[], size_t count,
- double timeout) // XBT_ATTRIB_DEPRECATED_v330
-{
- std::vector<simgrid::kernel::activity::CommImpl*> rcomms(count);
- std::transform(comms, comms + count, begin(rcomms), [](const simgrid::kernel::activity::ActivityImplPtr& comm) {
- return static_cast<simgrid::kernel::activity::CommImpl*>(comm.get());
- });
- return static_cast<unsigned int>(simcall_BODY_comm_waitany(rcomms.data(), rcomms.size(), timeout));
-}
-
ssize_t simcall_comm_waitany(simgrid::kernel::activity::CommImpl* comms[], size_t count, double timeout)
{
return simcall_BODY_comm_waitany(comms, count, timeout);
/**
* @ingroup simix_comm_management
*/
-int simcall_comm_testany(simgrid::kernel::activity::ActivityImplPtr comms[], size_t count) // XBT_ATTRIB_DEPRECATED_v330
-{
- if (count == 0)
- return -1;
- std::vector<simgrid::kernel::activity::CommImpl*> rcomms(count);
- std::transform(comms, comms + count, begin(rcomms), [](const simgrid::kernel::activity::ActivityImplPtr& comm) {
- return static_cast<simgrid::kernel::activity::CommImpl*>(comm.get());
- });
- return static_cast<int>(simcall_BODY_comm_testany(rcomms.data(), rcomms.size()));
-}
-
ssize_t simcall_comm_testany(simgrid::kernel::activity::CommImpl* comms[], size_t count)
{
if (count == 0)
return simcall_BODY_comm_test(static_cast<simgrid::kernel::activity::CommImpl*>(comm));
}
-/**
- * @ingroup simix_synchro_management
- *
- */
-smx_mutex_t simcall_mutex_init() // XBT_ATTRIB_DEPRECATED_v330
-{
- return simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
-}
-
/**
* @ingroup simix_synchro_management
*
mutex->mutex().unlock();
}
-/**
- * @ingroup simix_synchro_management
- *
- */
-smx_cond_t simcall_cond_init() // XBT_ATTRIB_DEPRECATED_v330
-{
- return simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
-}
-
/**
* @ingroup simix_synchro_management
*
return sem->sem().acquire_timeout(timeout);
}
-simgrid::kernel::activity::State simcall_io_wait(simgrid::kernel::activity::ActivityImpl* io,
- double timeout) // XBT_ATTRIB_DEPRECATED_v330
-{
- simgrid::kernel::actor::ActorImpl* issuer = simgrid::kernel::actor::ActorImpl::self();
- simgrid::kernel::actor::simcall_blocking([io, issuer, timeout] { io->wait_for(issuer, timeout); });
- return simgrid::kernel::activity::State::DONE;
-}
-
-simgrid::kernel::activity::State simcall_io_wait(const simgrid::kernel::activity::ActivityImplPtr& io,
- double timeout) // XBT_ATTRIB_DEPRECATED_v330
-{
- simgrid::kernel::actor::ActorImpl* issuer = simgrid::kernel::actor::ActorImpl::self();
- simgrid::kernel::actor::simcall_blocking([io, issuer, timeout] { io->wait_for(issuer, timeout); });
- return simgrid::kernel::activity::State::DONE;
-}
-
-bool simcall_io_test(simgrid::kernel::activity::ActivityImpl* io) // XBT_ATTRIB_DEPRECATED_v330
-{
- return simgrid::kernel::actor::simcall([io] { return io->test(); });
-}
-
-bool simcall_io_test(const simgrid::kernel::activity::ActivityImplPtr& io) // XBT_ATTRIB_DEPRECATD_v330
-{
- return simgrid::kernel::actor::simcall([io] { return io->test(); });
-}
-
void simcall_run_kernel(std::function<void()> const& code, simgrid::kernel::actor::SimcallObserver* observer)
{
simgrid::kernel::actor::ActorImpl::self()->simcall_.observer_ = observer;