X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f95f8ea9351ac3abf643f5edf0b6a06ba509ae96..db47dd48806619184080b0b9d9e655d7d9d1ed63:/src/simix/libsmx.cpp diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 8bcf6626db..007f8af313 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -93,35 +93,6 @@ void simcall_process_suspend(smx_actor_t process) simcall_BODY_process_suspend(process); } -/** - * @ingroup simix_process_management - * @brief Set the user data of a #smx_actor_t. - * - * This functions sets the user data associated to @a process. - * @param process SIMIX process - * @param data User data - */ -void simcall_process_set_data(smx_actor_t process, void *data) -{ - simgrid::simix::simcall([process, data] { process->set_user_data(data); }); -} - -/** - * @ingroup simix_process_management - * @brief Set the kill time of a process. - */ -void simcall_process_set_kill_time(smx_actor_t process, double kill_time) -{ - - if (kill_time <= SIMIX_get_clock()) - return; - XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->get_cname(), process->host_->get_cname()); - process->kill_timer = SIMIX_timer_set(kill_time, [process] { - SIMIX_process_kill(process, nullptr); - process->kill_timer=nullptr; - }); -} - /** * @ingroup simix_process_management * @brief Creates a new sleep SIMIX synchro. @@ -235,18 +206,6 @@ smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, return simcall_BODY_comm_iprobe(mbox, type, match_fun, data); } -/** - * @ingroup simix_comm_management - */ -void simcall_comm_cancel(smx_activity_t synchro) -{ - simgrid::simix::simcall([synchro] { - simgrid::kernel::activity::CommImplPtr comm = - boost::static_pointer_cast(synchro); - comm->cancel(); - }); -} - /** * @ingroup simix_comm_management */ @@ -405,6 +364,41 @@ void unblock(smx_actor_t process) xbt_assert(SIMIX_is_maestro()); SIMIX_simcall_answer(&process->simcall); } +} // namespace simix +} // namespace simgrid +/* ****************************DEPRECATED CALLS******************************* */ +void simcall_process_set_kill_time(smx_actor_t process, double kill_time) +{ + simgrid::simix::simcall([process, kill_time] { process->set_kill_time(kill_time); }); +} +void simcall_comm_cancel(smx_activity_t comm) +{ + simgrid::simix::simcall([comm] { boost::static_pointer_cast(comm)->cancel(); }); +} +void simcall_execution_cancel(smx_activity_t exec) +{ + simgrid::simix::simcall([exec] { boost::static_pointer_cast(exec)->cancel(); }); } +void simcall_execution_set_priority(smx_activity_t exec, double priority) +{ + simgrid::simix::simcall([exec, priority] { + boost::static_pointer_cast(exec)->set_priority(priority); + }); +} + +void simcall_execution_set_bound(smx_activity_t exec, double bound) +{ + simgrid::simix::simcall( + [exec, bound] { boost::static_pointer_cast(exec)->set_bound(bound); }); +} + +smx_activity_t simcall_execution_start(std::string name, std::string category, double flops_amount, double priority, + double bound, sg_host_t host) +{ + return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] { + return simgrid::kernel::activity::ExecImplPtr( + new simgrid::kernel::activity::ExecImpl(name, category, nullptr, host)) + ->start(flops_amount, priority, bound); + }); }