# This looks like C++ but it is a basic IDL-like language
# (one definition per line) parsed by a python script:
-void process_kill(smx_process_t process);
+void process_kill(smx_actor_t process);
void process_killall(int reset_pid);
-void process_cleanup(smx_process_t process) [[nohandler]];
-void process_suspend(smx_process_t process) [[block]];
-void process_resume(smx_process_t process);
-void process_set_host(smx_process_t process, sg_host_t dest);
-int process_is_suspended(smx_process_t process) [[nohandler]];
-int process_join(smx_process_t process, double timeout) [[block]];
+void process_cleanup(smx_actor_t process) [[nohandler]];
+void process_suspend(smx_actor_t process) [[block]];
+void process_resume(smx_actor_t process);
+void process_set_host(smx_actor_t process, sg_host_t dest);
+int process_is_suspended(smx_actor_t process) [[nohandler]];
+int process_join(smx_actor_t process, double timeout) [[block]];
int process_sleep(double duration) [[block]];
smx_mutex_t mutex_init();
// Simcall number:
e_smx_simcall_t call;
// Issuing actor:
- smx_process_t issuer;
+ smx_actor_t issuer;
// Arguments of the simcall:
union u_smx_scalar args[11];
// Result of the simcall:
if (SIMIX_is_maestro())
xbt_die("Can't execute blocking call in kernel mode");
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
simgrid::xbt::Result<T> result;
simcall_run_blocking([&result, self, &code]{
{
if (!valid())
throw std::future_error(std::future_errc::no_state);
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
simgrid::xbt::Result<T> result;
simcall_run_blocking([this, &result, self]{
try {
structure, but always use the provided API to interact with
processes.
*/
-typedef smx_process_t msg_process_t;
+typedef smx_actor_t msg_process_t;
/** @brief Return code of most MSG functions
@ingroup msg_simulation
XBT_PUBLIC_CLASS Actor {
friend Mailbox;
friend simgrid::simix::ActorImpl;
- smx_process_t pimpl_ = nullptr;
+ smx_actor_t pimpl_ = nullptr;
/** Wrap a (possibly non-copyable) single-use task into a `std::function` */
template<class F, class... Args>
};
}
- explicit Actor(smx_process_t pimpl) : pimpl_(pimpl) {}
+ explicit Actor(smx_actor_t pimpl) : pimpl_(pimpl) {}
public:
protected:
/** Returns the internal implementation of this actor */
- smx_process_t getImpl();
+ smx_actor_t getImpl();
};
/** @ingroup s4u_api
void (*cleanFunction_)(void *) = nullptr;
void (*copyDataFunction_)(smx_activity_t, void*, size_t) = nullptr;
- smx_process_t sender_ = nullptr;
- smx_process_t receiver_ = nullptr;
+ smx_actor_t sender_ = nullptr;
+ smx_actor_t receiver_ = nullptr;
MailboxPtr mailbox_ = nullptr;
};
}
typedef simgrid::kernel::context::Context *smx_context_t;
-typedef simgrid::simix::ActorImpl *smx_process_t;
+typedef simgrid::simix::ActorImpl *smx_actor_t;
typedef simgrid::simix::Mutex *smx_mutex_t;
typedef simgrid::simix::Mailbox *smx_mailbox_t;
#else
typedef struct s_smx_context *smx_context_t;
-typedef struct s_smx_process *smx_process_t;
+typedef struct s_smx_actor *smx_actor_t;
typedef struct s_smx_mutex *smx_mutex_t;
typedef struct s_smx_mailbox *smx_mailbox_t;
/******************************* Networking ***********************************/
/* Process creation/destruction callbacks */
-typedef void (*void_pfn_smxprocess_t) (smx_process_t);
+typedef void (*void_pfn_smxprocess_t) (smx_actor_t);
/* for auto-restart function */
typedef void (*void_pfn_sghost_t) (sg_host_t);
SG_BEGIN_DECL()
XBT_PUBLIC(xbt_dynar_t) SIMIX_process_get_runnable();
-XBT_PUBLIC(smx_process_t) SIMIX_process_from_PID(int PID);
+XBT_PUBLIC(smx_actor_t) SIMIX_process_from_PID(int PID);
XBT_PUBLIC(xbt_dynar_t) SIMIX_processes_as_dynar();
/* parallelism */
*/
XBT_PUBLIC(void) SIMIX_maestro_create(void (*code)(void*), void* data);
-XBT_PUBLIC(smx_process_t) SIMIX_process_attach(
+XBT_PUBLIC(smx_actor_t) SIMIX_process_attach(
const char* name,
void *data,
const char* hostname,
xbt_dict_t properties,
- smx_process_t parent_process);
+ smx_actor_t parent_process);
XBT_PUBLIC(void) SIMIX_process_detach();
/*********************************** Host *************************************/
XBT_PUBLIC(sg_host_t) SIMIX_host_self();
XBT_PUBLIC(const char*) SIMIX_host_self_get_name();
XBT_PUBLIC(void) SIMIX_host_on(sg_host_t host);
-XBT_PUBLIC(void) SIMIX_host_off(sg_host_t host, smx_process_t issuer);
+XBT_PUBLIC(void) SIMIX_host_off(sg_host_t host, smx_actor_t issuer);
XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data);
XBT_PUBLIC(void*) SIMIX_host_self_get_data();
/********************************* Process ************************************/
-XBT_PUBLIC(smx_process_t) SIMIX_process_ref(smx_process_t process);
-XBT_PUBLIC(void) SIMIX_process_unref(smx_process_t process);
+XBT_PUBLIC(smx_actor_t) SIMIX_process_ref(smx_actor_t process);
+XBT_PUBLIC(void) SIMIX_process_unref(smx_actor_t process);
XBT_PUBLIC(int) SIMIX_process_count();
-XBT_PUBLIC(smx_process_t) SIMIX_process_self();
+XBT_PUBLIC(smx_actor_t) SIMIX_process_self();
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_PUBLIC(smx_context_t) SIMIX_process_get_context(smx_process_t process);
-XBT_PUBLIC(void) SIMIX_process_set_context(smx_process_t p,smx_context_t c);
-XBT_PUBLIC(int) SIMIX_process_has_pending_comms(smx_process_t process);
-XBT_PUBLIC(void) SIMIX_process_on_exit_runall(smx_process_t process);
-XBT_PUBLIC(void) SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data);
+XBT_PUBLIC(smx_context_t) SIMIX_process_get_context(smx_actor_t process);
+XBT_PUBLIC(void) SIMIX_process_set_context(smx_actor_t p,smx_context_t c);
+XBT_PUBLIC(int) SIMIX_process_has_pending_comms(smx_actor_t process);
+XBT_PUBLIC(void) SIMIX_process_on_exit_runall(smx_actor_t process);
+XBT_PUBLIC(void) SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data);
/****************************** Communication *********************************/
XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*, size_t));
/* They can also be called from maestro's context, and they are thread safe. */
/******************************************************************************/
-XBT_PUBLIC(void) simcall_call(smx_process_t process);
+XBT_PUBLIC(void) simcall_call(smx_actor_t process);
/******************************* Host simcalls ********************************/
XBT_PUBLIC(void) simcall_host_set_data(sg_host_t host, void *data);
/**************************** Process simcalls ********************************/
/* Constructor and Destructor */
-XBT_PUBLIC(smx_process_t) simcall_process_create(const char *name,
+XBT_PUBLIC(smx_actor_t) simcall_process_create(const char *name,
xbt_main_func_t code,
void *data,
const char *hostname,
xbt_dict_t properties,
int auto_restart);
-XBT_PUBLIC(void) simcall_process_kill(smx_process_t process);
+XBT_PUBLIC(void) simcall_process_kill(smx_actor_t process);
XBT_PUBLIC(void) simcall_process_killall(int reset_pid);
-XBT_PUBLIC(void) SIMIX_process_throw(smx_process_t process, xbt_errcat_t cat, int value, const char *msg);
+XBT_PUBLIC(void) SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const char *msg);
/* Process handling */
-XBT_PUBLIC(void) simcall_process_cleanup(smx_process_t process);
-XBT_PUBLIC(void) simcall_process_suspend(smx_process_t process);
-XBT_PUBLIC(void) simcall_process_resume(smx_process_t process);
+XBT_PUBLIC(void) simcall_process_cleanup(smx_actor_t process);
+XBT_PUBLIC(void) simcall_process_suspend(smx_actor_t process);
+XBT_PUBLIC(void) simcall_process_resume(smx_actor_t process);
/* Getters and Setters */
XBT_PUBLIC(int) simcall_process_count();
-XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process);
-XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data);
-XBT_PUBLIC(void) simcall_process_set_host(smx_process_t process, sg_host_t dest);
-XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process);
-XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_process_t host);
-XBT_PUBLIC(void) simcall_process_set_kill_time(smx_process_t process, double kill_time);
-XBT_PUBLIC(double) simcall_process_get_kill_time(smx_process_t process);
-XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data);
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart);
-XBT_PUBLIC(smx_process_t) simcall_process_restart(smx_process_t process);
-XBT_PUBLIC(void) simcall_process_join(smx_process_t process, double timeout);
+XBT_PUBLIC(void *) simcall_process_get_data(smx_actor_t process);
+XBT_PUBLIC(void) simcall_process_set_data(smx_actor_t process, void *data);
+XBT_PUBLIC(void) simcall_process_set_host(smx_actor_t process, sg_host_t dest);
+XBT_PUBLIC(int) simcall_process_is_suspended(smx_actor_t process);
+XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_actor_t host);
+XBT_PUBLIC(void) simcall_process_set_kill_time(smx_actor_t process, double kill_time);
+XBT_PUBLIC(double) simcall_process_get_kill_time(smx_actor_t process);
+XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data);
+XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart);
+XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process);
+XBT_PUBLIC(void) simcall_process_join(smx_actor_t process, double timeout);
/* Sleep control */
XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration);
/***** Rendez-vous points *****/
XBT_PUBLIC(smx_mailbox_t) simcall_mbox_create(const char *name);
-XBT_PUBLIC(void) simcall_mbox_set_receiver(smx_mailbox_t mbox , smx_process_t process);
+XBT_PUBLIC(void) simcall_mbox_set_receiver(smx_mailbox_t mbox , smx_actor_t process);
/***** Communication simcalls *****/
-XBT_PUBLIC(void) simcall_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size,
+XBT_PUBLIC(void) simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size,
double rate, void *src_buff,
size_t src_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout);
-XBT_PUBLIC(smx_activity_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox,
+XBT_PUBLIC(smx_activity_t) simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox,
double task_size,
double rate, void *src_buff,
size_t src_buff_size,
void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, int detached);
-XBT_PUBLIC(void) simcall_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff,
+XBT_PUBLIC(void) simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff,
size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout, double rate);
-XBT_PUBLIC(smx_activity_t) simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff,
+XBT_PUBLIC(smx_activity_t) simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff,
size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
* int argc, char **argv: parameters passed to code
* xbt_dict_t pros: properties
*/
-typedef smx_process_t (*smx_creation_func_t) (
+typedef smx_actor_t (*smx_creation_func_t) (
/* name */ const char*,
std::function<void()> code,
/* userdata */ void*,
/* kill_time */ double,
/* props */ xbt_dict_t,
/* auto_restart */ int,
- /* parent_process */ smx_process_t);
+ /* parent_process */ smx_actor_t);
extern "C"
XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t function);
-XBT_PUBLIC(smx_process_t) simcall_process_create(const char *name,
+XBT_PUBLIC(smx_actor_t) simcall_process_create(const char *name,
std::function<void()> code,
void *data,
const char *hostname,
namespace simgrid {
namespace simix {
-XBT_PUBLIC(void) unblock(smx_process_t process);
+XBT_PUBLIC(void) unblock(smx_actor_t process);
/** Execute some code in kernel mode and wakes up the actor when
* the result is available.
if (SIMIX_is_maestro())
xbt_die("Can't execute blocking call in kernel mode");
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
simgrid::xbt::Result<T> result;
simcall_run_blocking([&result, self, &code]{
{
if (!valid())
throw std::future_error(std::future_errc::no_state);
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
simgrid::xbt::Result<T> result;
simcall_run_blocking([this, &result, self]{
try {
return;
// The future is not ready. We have to delegate to the SimGrid kernel:
std::exception_ptr exception;
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
simcall_run_blocking([this, &exception, self]{
try {
// When the kernel future is ready...
JavaContext* JavaContextFactory::create_context(
std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process)
+ void_pfn_smxprocess_t cleanup, smx_actor_t process)
{
return this->new_context<JavaContext>(std::move(code), cleanup, process);
}
void JavaContextFactory::run_all()
{
xbt_dynar_t processes = SIMIX_process_get_runnable();
- smx_process_t process;
+ smx_actor_t process;
unsigned int cursor;
xbt_dynar_foreach(processes, cursor, process) {
static_cast<JavaContext*>(SIMIX_process_get_context(process))->resume();
JavaContext::JavaContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process)
+ smx_actor_t process)
: Context(std::move(code), cleanup_func, process)
{
static int thread_amount=0;
friend class JavaContextFactory;
JavaContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process);
+ smx_actor_t process);
~JavaContext() override;
void stop() override;
void suspend() override;
~JavaContextFactory() override;
JavaContext* self() override;
JavaContext* create_context(std::function<void()> code,
- void_pfn_smxprocess_t, smx_process_t process) override;
+ void_pfn_smxprocess_t, smx_actor_t process) override;
void run_all() override;
};
JNIEnv *env = get_current_thread_env();
simgrid::kernel::context::JavaContext* context = static_cast<simgrid::kernel::context::JavaContext*>(SIMIX_context_self());
context->jprocess = jprocess;
- smx_process_t process = SIMIX_process_self();
+ smx_actor_t process = SIMIX_process_self();
jprocess_bind(context->jprocess, process, env);
// Adrien, ugly path, just to bypass creation of context at low levels (i.e such as for the VM migration for instance)
jdouble jkill = env->GetDoubleField(jprocess, jprocess_field_Process_killTime);
/* Actually build the MSG process */
process = MSG_process_create_with_environment(name, [](int argc, char** argv) -> int {
- smx_process_t process = SIMIX_process_self();
+ smx_actor_t process = SIMIX_process_self();
// This is the jprocess passed as environment.
// It would be simplet if we could use a closure.
jobject jprocess = (jobject) MSG_process_get_data(process);
XBT_PRIVATE void _mc_cfg_cb_termination(const char *name);
XBT_PUBLIC(void) MC_run();
-XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double);
-XBT_PUBLIC(double) MC_process_clock_get(smx_process_t);
+XBT_PUBLIC(void) MC_process_clock_add(smx_actor_t, double);
+XBT_PUBLIC(double) MC_process_clock_get(smx_actor_t);
XBT_PRIVATE void MC_automaton_load(const char *file);
/****************************** MC ignore **********************************/
XBT_PUBLIC(void) MC_ignore_local_variable(const char *var_name, const char *frame);
XBT_PUBLIC(void) MC_ignore_global_variable(const char *var_name);
#if HAVE_UCONTEXT_H
-XBT_PUBLIC(void) MC_register_stack_area(void *stack, smx_process_t process, ucontext_t* context, size_t size);
+XBT_PUBLIC(void) MC_register_stack_area(void *stack, smx_actor_t process, ucontext_t* context, size_t size);
#endif
/********************************* Memory *************************************/
surf_action_t surf_comm = nullptr; /* The Surf communication action encapsulated */
surf_action_t src_timeout = nullptr; /* Surf's actions to instrument the timeouts */
surf_action_t dst_timeout = nullptr; /* Surf's actions to instrument the timeouts */
- smx_process_t src_proc = nullptr;
- smx_process_t dst_proc = nullptr;
+ smx_actor_t src_proc = nullptr;
+ smx_actor_t dst_proc = nullptr;
double rate = 0.0;
double task_size = 0.0;
smx_context_t SIMIX_context_new(
std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t simix_process)
+ smx_actor_t simix_process)
{
xbt_assert(simix_global, "simix is not initialized, please call MSG_init first");
return simix_global->context_factory->create_context(
#endif
}
-Context* ContextFactory::attach(void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+Context* ContextFactory::attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
{
xbt_die("Cannot attach with this ContextFactory.\n"
"Try using --cfg=contexts/factory:thread instead.\n");
}
-Context* ContextFactory::create_maestro(std::function<void()> code, smx_process_t process)
+Context* ContextFactory::create_maestro(std::function<void()> code, smx_actor_t process)
{
xbt_die("Cannot create_maestro with this ContextFactory.\n"
"Try using --cfg=contexts/factory:thread instead.\n");
}
Context::Context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
: code_(std::move(code)), process_(process), iwannadie(false)
{
/* If the user provided a function for the process then use it.
explicit ContextFactory(std::string name) : name_(std::move(name)) {}
virtual ~ContextFactory();
virtual Context* create_context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process) = 0;
+ void_pfn_smxprocess_t cleanup, smx_actor_t process) = 0;
// Optional methods for attaching main() as a context:
*
* This will not work on all implementation of `ContextFactory`.
*/
- virtual Context* attach(void_pfn_smxprocess_t cleanup_func, smx_process_t process);
- virtual Context* create_maestro(std::function<void()> code, smx_process_t process);
+ virtual Context* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
+ virtual Context* create_maestro(std::function<void()> code, smx_actor_t process);
virtual void run_all() = 0;
virtual Context* self();
private:
std::function<void()> code_;
void_pfn_smxprocess_t cleanup_func_ = nullptr;
- smx_process_t process_ = nullptr;
+ smx_actor_t process_ = nullptr;
public:
bool iwannadie;
public:
Context(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process);
+ smx_actor_t process);
void operator()()
{
code_();
}
bool has_code() const
{
- return (bool) code_;
+ return static_cast<bool>(code_);
}
- smx_process_t process()
+ smx_actor_t process()
{
return this->process_;
}
AttachContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process)
+ smx_actor_t process)
: Context(std::move(code), cleanup_func, process)
{}
XBT_PRIVATE smx_context_t SIMIX_context_new(
std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t simix_process);
+ smx_actor_t simix_process);
#ifndef WIN32
XBT_PUBLIC_DATA(char sigsegv_stack[SIGSTKSZ]);
public:
BoostSerialContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process)
+ smx_actor_t process)
: BoostContext(std::move(code), cleanup_func, process) {}
void stop() override;
void suspend() override;
public:
BoostParallelContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process)
+ smx_actor_t process)
: BoostContext(std::move(code), cleanup_func, process) {}
void stop() override;
void suspend() override;
}
smx_context_t BoostContextFactory::create_context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
{
BoostContext* context = nullptr;
if (BoostContext::parallel_)
BoostContext::threads_working_ = 0;
xbt_parmap_apply(BoostContext::parmap_,
[](void* arg) {
- smx_process_t process = static_cast<smx_process_t>(arg);
+ smx_actor_t process = static_cast<smx_actor_t>(arg);
BoostContext* context = static_cast<BoostContext*>(process->context);
return context->resume();
},
{
if (xbt_dynar_is_empty(simix_global->process_to_run))
return;
- smx_process_t first_process =
- xbt_dynar_get_as(simix_global->process_to_run, 0, smx_process_t);
+ smx_actor_t first_process =
+ xbt_dynar_get_as(simix_global->process_to_run, 0, smx_actor_t);
BoostContext::process_index_ = 1;
/* execute the first process */
static_cast<BoostContext*>(first_process->context)->resume();
}
BoostContext::BoostContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
: Context(std::move(code), cleanup_func, process)
{
/* execute the next process */
XBT_DEBUG("Run next process");
next_context = static_cast<BoostSerialContext*>(xbt_dynar_get_as(
- simix_global->process_to_run, i, smx_process_t)->context);
+ simix_global->process_to_run, i, smx_actor_t)->context);
}
else {
/* all processes were run, return to maestro */
void BoostParallelContext::suspend()
{
- smx_process_t next_work = (smx_process_t) xbt_parmap_next(parmap_);
+ smx_actor_t next_work = (smx_actor_t) xbt_parmap_next(parmap_);
BoostParallelContext* next_context = nullptr;
if (next_work != nullptr) {
friend BoostContextFactory;
BoostContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process);
+ smx_actor_t process);
~BoostContext() override;
virtual void resume();
private:
BoostContextFactory();
~BoostContextFactory() override;
Context* create_context(std::function<void()> code,
- void_pfn_smxprocess_t, smx_process_t process) override;
+ void_pfn_smxprocess_t, smx_actor_t process) override;
void run_all() override;
};
friend class RawContextFactory;
RawContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process);
+ smx_actor_t process);
~RawContext() override;
public:
static void wrapper(void* arg);
RawContextFactory();
~RawContextFactory() override;
RawContext* create_context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process) override;
+ void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
void run_all() override;
private:
void run_all_adaptative();
}
RawContext* RawContextFactory::create_context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process)
+ void_pfn_smxprocess_t cleanup, smx_actor_t process)
{
return this->new_context<RawContext>(std::move(code),
cleanup, process);
}
RawContext::RawContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process)
+ void_pfn_smxprocess_t cleanup, smx_actor_t process)
: Context(std::move(code), cleanup, process)
{
if (has_code()) {
if (xbt_dynar_is_empty(simix_global->process_to_run))
return;
- smx_process_t first_process =
- xbt_dynar_get_as(simix_global->process_to_run, 0, smx_process_t);
+ smx_actor_t first_process =
+ xbt_dynar_get_as(simix_global->process_to_run, 0, smx_actor_t);
raw_process_index = 1;
static_cast<RawContext*>(first_process->context)->resume_serial();
}
SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode());
xbt_parmap_apply(raw_parmap,
[](void* arg) {
- smx_process_t process = static_cast<smx_process_t>(arg);
+ smx_actor_t process = static_cast<smx_actor_t>(arg);
RawContext* context = static_cast<RawContext*>(process->context);
context->resume_parallel();
},
/* execute the next process */
XBT_DEBUG("Run next process");
next_context = (RawContext*) xbt_dynar_get_as(
- simix_global->process_to_run, i, smx_process_t)->context;
+ simix_global->process_to_run, i, smx_actor_t)->context;
}
else {
/* all processes were run, return to maestro */
{
#if HAVE_THREAD_CONTEXTS
/* determine the next context */
- smx_process_t next_work = (smx_process_t) xbt_parmap_next(raw_parmap);
+ smx_actor_t next_work = (smx_actor_t) xbt_parmap_next(raw_parmap);
RawContext* next_context = nullptr;
if (next_work != nullptr) {
ThreadContext* ThreadContextFactory::create_context(
std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process)
+ void_pfn_smxprocess_t cleanup, smx_actor_t process)
{
return this->new_context<ThreadContext>(std::move(code), cleanup, process, !code);
}
{
if (smx_ctx_thread_sem == nullptr) {
// Serial execution
- smx_process_t process;
+ smx_actor_t process;
unsigned int cursor;
xbt_dynar_foreach(simix_global->process_to_run, cursor, process) {
XBT_DEBUG("Handling %p",process);
} else {
// Parallel execution
unsigned int index;
- smx_process_t process;
+ smx_actor_t process;
xbt_dynar_foreach(simix_global->process_to_run, index, process)
xbt_os_sem_release(static_cast<ThreadContext*>(process->context)->begin_);
xbt_dynar_foreach(simix_global->process_to_run, index, process)
return static_cast<ThreadContext*>(xbt_os_thread_get_extra_data());
}
-ThreadContext* ThreadContextFactory::attach(void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+ThreadContext* ThreadContextFactory::attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
{
return this->new_context<ThreadContext>(
std::function<void()>(), cleanup_func, process, false);
}
-ThreadContext* ThreadContextFactory::create_maestro(std::function<void()> code, smx_process_t process)
+ThreadContext* ThreadContextFactory::create_maestro(std::function<void()> code, smx_actor_t process)
{
return this->new_context<ThreadContext>(std::move(code), nullptr, process, true);
}
ThreadContext::ThreadContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process, bool maestro)
+ void_pfn_smxprocess_t cleanup, smx_actor_t process, bool maestro)
: AttachContext(std::move(code), cleanup, process)
{
// We do not need the semaphores when maestro is in main,
friend ThreadContextFactory;
ThreadContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func,
- smx_process_t process, bool maestro =false);
+ smx_actor_t process, bool maestro =false);
~ThreadContext() override;
void stop() override;
void suspend() override;
ThreadContextFactory();
~ThreadContextFactory() override;
ThreadContext* create_context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process) override;
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process) override;
void run_all() override;
ThreadContext* self() override;
// Optional methods:
- ThreadContext* attach(void_pfn_smxprocess_t cleanup_func, smx_process_t process) override;
- ThreadContext* create_maestro(std::function<void()> code, smx_process_t process) override;
+ ThreadContext* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process) override;
+ ThreadContext* create_maestro(std::function<void()> code, smx_actor_t process) override;
};
}}} // namespace
public:
friend UContextFactory;
UContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process);
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
~UContext() override;
};
class SerialUContext : public UContext {
public:
SerialUContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
: UContext(std::move(code), cleanup_func, process)
{}
void stop() override;
class ParallelUContext : public UContext {
public:
ParallelUContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
: UContext(std::move(code), cleanup_func, process)
{}
void stop() override;
UContextFactory();
~UContextFactory() override;
Context* create_context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process) override;
+ void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
void run_all() override;
};
xbt_parmap_apply(sysv_parmap,
[](void* arg) {
- smx_process_t process = (smx_process_t) arg;
+ smx_actor_t process = (smx_actor_t) arg;
ParallelUContext* context = static_cast<ParallelUContext*>(process->context);
context->resume();
},
if (xbt_dynar_is_empty(simix_global->process_to_run))
return;
- smx_process_t first_process =
- xbt_dynar_get_as(simix_global->process_to_run, 0, smx_process_t);
+ smx_actor_t first_process =
+ xbt_dynar_get_as(simix_global->process_to_run, 0, smx_actor_t);
sysv_process_index = 1;
SerialUContext* context =
static_cast<SerialUContext*>(first_process->context);
}
Context* UContextFactory::create_context(std::function<void()> code,
- void_pfn_smxprocess_t cleanup, smx_process_t process)
+ void_pfn_smxprocess_t cleanup, smx_actor_t process)
{
if (sysv_parallel)
return new_context<ParallelUContext>(std::move(code), cleanup, process);
}
UContext::UContext(std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func, smx_process_t process)
+ void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
: Context(std::move(code), cleanup_func, process)
{
/* if the user provided a function for the process then use it, otherwise it is the context for maestro */
/* execute the next process */
XBT_DEBUG("Run next process");
next_context = (SerialUContext*) xbt_dynar_get_as(
- simix_global->process_to_run,i, smx_process_t)->context;
+ simix_global->process_to_run,i, smx_actor_t)->context;
}
else {
/* all processes were run, return to maestro */
#if HAVE_THREAD_CONTEXTS
/* determine the next context */
// Get the next soul to embody now:
- smx_process_t next_work = (smx_process_t) xbt_parmap_next(sysv_parmap);
+ smx_actor_t next_work = (smx_actor_t) xbt_parmap_next(sysv_parmap);
ParallelUContext* next_context = nullptr;
// Will contain the next soul to run, either simulated or initial minion's one
ucontext_t* next_stack;
{
// Check deadlock:
bool deadlock = false;
- smx_process_t process;
+ smx_actor_t process;
if (xbt_swag_size(simix_global->process_list)) {
deadlock = true;
xbt_swag_foreach(process, simix_global->process_list)
if (s != sizeof(message))
xbt_die("Unexpected size for SIMCALL_HANDLE");
memcpy(&message, message_buffer, sizeof(message));
- smx_process_t process = SIMIX_process_from_PID(message.pid);
+ smx_actor_t process = SIMIX_process_from_PID(message.pid);
if (!process)
xbt_die("Invalid pid %lu", (unsigned long) message.pid);
SIMIX_simcall_handle(&process->simcall, message.value);
xbt_die("Could send REGISTER_SYMBOL message to model-checker");
}
-void Client::declareStack(void *stack, size_t size, smx_process_t process, ucontext_t* context)
+void Client::declareStack(void *stack, size_t size, smx_actor_t process, ucontext_t* context)
{
xbt_mheap_t heap = mmalloc_get_current_heap();
void unignoreHeap(void* addr, std::size_t size);
void declareSymbol(const char *name, int* value);
#if HAVE_UCONTEXT_H
- void declareStack(void *stack, size_t size, smx_process_t process, ucontext_t* context);
+ void declareStack(void *stack, size_t size, smx_actor_t process, ucontext_t* context);
#endif
// Singleton :/
simgrid::kernel::activity::Comm* comm =
static_cast<simgrid::kernel::activity::Comm*>(temp_comm.getBuffer());
- smx_process_t src_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t src_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(comm->src_proc));
- smx_process_t dst_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t dst_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(comm->dst_proc));
comm_pattern->src_proc = src_proc->pid;
comm_pattern->dst_proc = dst_proc->pid;
void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking)
{
- const smx_process_t issuer = MC_smx_simcall_get_issuer(request);
+ const smx_actor_t issuer = MC_smx_simcall_get_issuer(request);
simgrid::mc::PatternCommunicationList* initial_pattern = xbt_dynar_get_as(
initial_communications_pattern, issuer->pid, simgrid::mc::PatternCommunicationList*);
xbt_dynar_t incomplete_pattern = xbt_dynar_get_as(
/* because we got a copy of the executed request, we have to fetch the
real one, pointed by the request field of the issuer process */
- const smx_process_t issuer = MC_smx_simcall_get_issuer(saved_req);
+ const smx_actor_t issuer = MC_smx_simcall_get_issuer(saved_req);
smx_simcall_t req = &issuer->simcall;
/* TODO : handle test and testany simcalls */
if (saved_req != nullptr) {
/* because we got a copy of the executed request, we have to fetch the
real one, pointed by the request field of the issuer process */
- const smx_process_t issuer = MC_smx_simcall_get_issuer(saved_req);
+ const smx_actor_t issuer = MC_smx_simcall_get_issuer(saved_req);
req = &issuer->simcall;
/* Debug information */
if (req->call == SIMCALL_MUTEX_LOCK || req->call == SIMCALL_MUTEX_TRYLOCK)
xbt_die("Mutex is currently not supported with DPOR, "
"use --cfg=model-check/reduction:none");
- const smx_process_t issuer = MC_smx_simcall_get_issuer(req);
+ const smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
for (auto i = stack_.rbegin(); i != stack_.rend(); ++i) {
simgrid::mc::State* prev_state = i->get();
if (reductionMode_ != simgrid::mc::ReductionMode::none
} else {
- const smx_process_t previous_issuer = MC_smx_simcall_get_issuer(&prev_state->internal_req);
+ const smx_actor_t previous_issuer = MC_smx_simcall_get_issuer(&prev_state->internal_req);
XBT_DEBUG("Simcall %d, process %lu (state %d) and simcall %d, process %lu (state %d) are independant",
req->call, issuer->pid, state->num,
prev_state->internal_req.call,
xbt_assert(mc_model_checker == nullptr);
#endif
- smx_process_t process;
+ smx_actor_t process;
smx_simcall_t req;
unsigned int iter;
* @param context
* @param size Size of the stack
*/
-void MC_register_stack_area(void *stack, smx_process_t process, ucontext_t* context, size_t size)
+void MC_register_stack_area(void *stack, smx_actor_t process, ucontext_t* context, size_t size)
{
xbt_assert(mc_model_checker == nullptr);
if (!MC_is_active())
simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
MC_ignore_heap(simgrid::mc::processes_time.data(),
simgrid::mc::processes_time.size() * sizeof(simgrid::mc::processes_time[0]));
- smx_process_t process;
+ smx_actor_t process;
xbt_swag_foreach(process, simix_global->process_list)
MC_ignore_heap(&(process->process_hookup), sizeof(process->process_hookup));
simgrid::mc::Client::get()->mainLoop();
}
#endif
-double MC_process_clock_get(smx_process_t process)
+double MC_process_clock_get(smx_actor_t process)
{
if (simgrid::mc::processes_time.empty())
return 0;
return -1;
}
-void MC_process_clock_add(smx_process_t process, double amount)
+void MC_process_clock_add(smx_actor_t process, double amount)
{
simgrid::mc::processes_time[process->pid] += amount;
}
XBT_DEBUG("Executing %i$%i", transition.pid, transition.argument);
// Choose a request:
- smx_process_t process = SIMIX_process_from_PID(transition.pid);
+ smx_actor_t process = SIMIX_process_from_PID(transition.pid);
if (!process)
xbt_die("Unexpected process.");
smx_simcall_t simcall = &(process->simcall);
const char* type = nullptr;
char *args = nullptr;
- smx_process_t issuer = MC_smx_simcall_get_issuer(req);
+ smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
switch (req->call) {
} else
act = remote_act;
- smx_process_t src_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t src_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(act->src_proc));
- smx_process_t dst_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t dst_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(act->dst_proc));
args = bprintf("comm=%s [(%lu)%s (%s)-> (%lu)%s (%s)]", p,
src_proc ? src_proc->pid : 0,
type = "Test TRUE";
p = pointer_to_string(remote_act);
- smx_process_t src_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t src_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(act->src_proc));
- smx_process_t dst_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t dst_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(act->dst_proc));
args = bprintf("comm=%s [(%lu)%s (%s) -> (%lu)%s (%s)]", p,
src_proc->pid,
return comm->src_proc && comm->dst_proc;
}
-bool process_is_enabled(smx_process_t process)
+bool process_is_enabled(smx_actor_t process)
{
return simgrid::mc::request_is_enabled(&process->simcall);
}
{
std::string label;
- const smx_process_t issuer = MC_smx_simcall_get_issuer(req);
+ const smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
switch (req->call) {
case SIMCALL_COMM_ISEND:
static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
- smx_process_t src_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t src_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(comm->src_proc));
- smx_process_t dst_proc = mc_model_checker->process().resolveProcess(
+ smx_actor_t dst_proc = mc_model_checker->process().resolveProcess(
simgrid::mc::remote(comm->dst_proc));
if (issuer->host)
label = simgrid::xbt::string_printf("[(%lu)%s] Wait [(%lu)->(%lu)]",
*
* This is true if the request associated with the process is ready.
*/
-XBT_PRIVATE bool process_is_enabled(smx_process_t process);
+XBT_PRIVATE bool process_is_enabled(smx_actor_t process);
XBT_PRIVATE std::string request_get_dot_output(smx_simcall_t req, int value);
using simgrid::mc::remote;
-/** HACK, Statically "upcast" a s_smx_process_t into a SimixProcessInformation
+/** HACK, Statically "upcast" a s_smx_actor_t into a SimixProcessInformation
*
* This gets 'processInfo' from '&processInfo->copy'. It upcasts in the
* sense that we could achieve the same thing by having SimixProcessInformation
- * inherit from s_smx_process_t but we don't really want to do that.
+ * inherit from s_smx_actor_t but we don't really want to do that.
*/
static inline
-simgrid::mc::SimixProcessInformation* process_info_cast(smx_process_t p)
+simgrid::mc::SimixProcessInformation* process_info_cast(smx_actor_t p)
{
simgrid::mc::SimixProcessInformation temp;
std::size_t offset = (char*) temp.copy.getBuffer() - (char*)&temp;
/** Load the remote swag of processes into a vector
*
* @param process MCed process
- * @param target Local vector (to be filled with copies of `s_smx_process_t`)
+ * @param target Local vector (to be filled with copies of `s_smx_actor_t`)
* @param remote_swag Address of the process SWAG in the remote list
*/
static void MC_process_refresh_simix_process_list(
// Load each element of the vector from the MCed process:
int i = 0;
- for (smx_process_t p = (smx_process_t) swag.head; p; ++i) {
+ for (smx_actor_t p = (smx_actor_t) swag.head; p; ++i) {
simgrid::mc::SimixProcessInformation info;
info.address = p;
target.push_back(std::move(info));
// Lookup next process address:
- p = (smx_process_t) xbt_swag_getNext(&info.copy, swag.offset);
+ p = (smx_actor_t) xbt_swag_getNext(&info.copy, swag.offset);
}
assert(i == swag.count);
}
* @param process the MCed process
* @param req the simcall (copied in the local process)
*/
-smx_process_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req)
+smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req)
{
xbt_assert(mc_model_checker != nullptr);
- // This is the address of the smx_process in the MCed process:
+ // This is the address of the smx_actor in the MCed process:
auto address = simgrid::mc::remote(req->issuer);
// Lookup by address:
xbt_die("Issuer not found");
}
-const char* MC_smx_process_get_host_name(smx_process_t p)
+const char* MC_smx_process_get_host_name(smx_actor_t p)
{
if (mc_model_checker == nullptr)
return sg_host_get_name(p->host);
return info->hostname;
}
-const char* MC_smx_process_get_name(smx_process_t p)
+const char* MC_smx_process_get_name(smx_actor_t p)
{
simgrid::mc::Process* process = &mc_model_checker->process();
if (mc_model_checker == nullptr)
* @param process the MCed process
* @param req the simcall (copied in the local process)
*/
-XBT_PRIVATE smx_process_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req);
+XBT_PRIVATE smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req);
-XBT_PRIVATE const char* MC_smx_process_get_name(smx_process_t p);
-XBT_PRIVATE const char* MC_smx_process_get_host_name(smx_process_t p);
+XBT_PRIVATE const char* MC_smx_process_get_name(smx_actor_t p);
+XBT_PRIVATE const char* MC_smx_process_get_host_name(smx_actor_t p);
XBT_PRIVATE int MC_smpi_process_count(void);
}
static inline smx_simcall_t MC_state_get_request_for_process(
- simgrid::mc::State* state, smx_process_t process)
+ simgrid::mc::State* state, smx_actor_t process)
{
simgrid::mc::ProcessState* procstate = &state->processStates[process->pid];
state->transition.pid = -1;
State();
std::size_t interleaveSize() const;
- void interleave(smx_process_t process)
+ void interleave(smx_actor_t process)
{
this->processStates[process->pid].interleave();
}
XBT_PRIVATE void __MSG_storage_destroy(msg_storage_priv_t host);
XBT_PRIVATE void __MSG_file_destroy(msg_file_priv_t host);
-XBT_PRIVATE void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc);
-XBT_PRIVATE smx_process_t MSG_process_create_from_SIMIX(const char *name,
+XBT_PRIVATE void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_proc);
+XBT_PRIVATE smx_actor_t MSG_process_create_from_SIMIX(const char *name,
std::function<void()> code, void *data,
const char *hostname, double kill_time,
xbt_dict_t properties, int auto_restart,
- smx_process_t parent_process);
+ smx_actor_t parent_process);
XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(smx_activity_t comm, void* buff, size_t buff_size);
XBT_PRIVATE void MSG_post_create_environment();
* \brief Cleans the MSG data of a process.
* \param smx_proc a SIMIX process
*/
-void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc)
+void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_proc)
{
simdata_process_t msg_proc;
}
/* This function creates a MSG process. It has the prototype enforced by SIMIX_function_register_process_create */
-smx_process_t MSG_process_create_from_SIMIX(
+smx_actor_t MSG_process_create_from_SIMIX(
const char *name, std::function<void()> code, void *data, const char *hostname,
double kill_time, xbt_dict_t properties,
- int auto_restart, smx_process_t parent_process)
+ int auto_restart, smx_actor_t parent_process)
{
msg_host_t host = MSG_host_by_name(hostname);
msg_process_t p = MSG_process_create_with_environment(
{
// TODO, when autorestart is used, the std::function is copied so the new
// instance will get a fresh (reinitialized) state. Is this what we want?
- smx_process_t process = simcall_process_create(
+ smx_actor_t process = simcall_process_create(
name, std::move(code), nullptr, host->name().c_str(),
killTime, nullptr, 0);
return ActorPtr(&process->getIface());
{
simgrid::simix::ActorCodeFactory& factory = SIMIX_get_actor_code_factory(function);
simgrid::simix::ActorCode code = factory(std::move(args));
- smx_process_t process = simcall_process_create(
+ smx_actor_t process = simcall_process_create(
name, std::move(code), nullptr, host->name().c_str(),
killTime, nullptr, 0);
return ActorPtr(&process->getIface());
}
}
-smx_process_t Actor::getImpl() {
+smx_actor_t Actor::getImpl() {
return pimpl_;
}
ActorPtr Actor::forPid(int pid)
{
- smx_process_t process = SIMIX_process_from_PID(pid);
+ smx_actor_t process = SIMIX_process_from_PID(pid);
if (process != nullptr)
return ActorPtr(&process->getIface());
else
}
Host *Host::current(){
- smx_process_t smx_proc = SIMIX_process_self();
+ smx_actor_t smx_proc = SIMIX_process_self();
if (smx_proc == nullptr)
xbt_die("Cannot call Host::current() from the maestro context");
return smx_proc->host;
unsigned long simix_process_maxpid = 0;
/** Increase the refcount for this process */
-smx_process_t SIMIX_process_ref(smx_process_t process)
+smx_actor_t SIMIX_process_ref(smx_actor_t process)
{
if (process != nullptr)
intrusive_ptr_add_ref(process);
}
/** Decrease the refcount for this process */
-void SIMIX_process_unref(smx_process_t process)
+void SIMIX_process_unref(smx_actor_t process)
{
if (process != nullptr)
intrusive_ptr_release(process);
*
* \return The SIMIX process
*/
-smx_process_t SIMIX_process_self()
+smx_actor_t SIMIX_process_self()
{
smx_context_t self_context = SIMIX_context_self();
* \brief Returns whether a process has pending asynchronous communications.
* \return true if there are asynchronous communications in this process
*/
-int SIMIX_process_has_pending_comms(smx_process_t process) {
+int SIMIX_process_has_pending_comms(smx_actor_t process) {
return xbt_fifo_size(process->comms) > 0;
}
/**
* \brief Moves a process to the list of processes to destroy.
*/
-void SIMIX_process_cleanup(smx_process_t process)
+void SIMIX_process_cleanup(smx_actor_t process)
{
XBT_DEBUG("Cleanup process %s (%p), waiting synchro %p",
process->name.c_str(), process, process->waiting_synchro);
*/
void SIMIX_process_empty_trash()
{
- smx_process_t process = nullptr;
+ smx_actor_t process = nullptr;
- while ((process = (smx_process_t) xbt_swag_extract(simix_global->process_to_destroy))) {
+ while ((process = (smx_actor_t) xbt_swag_extract(simix_global->process_to_destroy))) {
XBT_DEBUG("Getting rid of %p",process);
intrusive_ptr_release(process);
}
void create_maestro(std::function<void()> code)
{
- smx_process_t maestro = nullptr;
+ smx_actor_t maestro = nullptr;
/* Create maestro process and intilialize it */
maestro = new simgrid::simix::ActorImpl();
maestro->pid = simix_process_maxpid++;
* register it to the list of the process to restart if needed
* and stops its context.
*/
-void SIMIX_process_stop(smx_process_t arg) {
+void SIMIX_process_stop(smx_actor_t arg) {
arg->finished = true;
/* execute the on_exit functions */
SIMIX_process_on_exit_runall(arg);
*
* \return the process created
*/
-smx_process_t SIMIX_process_create(
+smx_actor_t SIMIX_process_create(
const char *name,
std::function<void()> code,
void *data,
double kill_time,
xbt_dict_t properties,
int auto_restart,
- smx_process_t parent_process)
+ smx_actor_t parent_process)
{
- smx_process_t process = nullptr;
+ smx_actor_t process = nullptr;
sg_host_t host = sg_host_by_name(hostname);
XBT_DEBUG("Start process %s on host '%s'", name, hostname);
xbt_swag_insert(process, simix_global->process_list);
XBT_DEBUG("Inserting %s(%s) in the to_run list",
process->name.c_str(), sg_host_get_name(host));
- xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
+ xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
if (kill_time > SIMIX_get_clock() && simix_global->kill_process_function) {
XBT_DEBUG("Process %s(%s) will be kill at time %f",
return process;
}
-smx_process_t SIMIX_process_attach(
+smx_actor_t SIMIX_process_attach(
const char* name,
void *data,
const char* hostname,
xbt_dict_t properties,
- smx_process_t parent_process)
+ smx_actor_t parent_process)
{
// This is mostly a copy/paste from SIMIX_process_new(),
// it'd be nice to share some code between those two functions.
return nullptr;
}
- smx_process_t process = new simgrid::simix::ActorImpl();
+ smx_actor_t process = new simgrid::simix::ActorImpl();
/* Process data */
process->pid = simix_process_maxpid++;
process->name = std::string(name);
xbt_swag_insert(process, simix_global->process_list);
XBT_DEBUG("Inserting %s(%s) in the to_run list",
process->name.c_str(), sg_host_get_name(host));
- xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
+ xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
/* Tracing the process creation */
TRACE_msg_process_create(process->name.c_str(), process->pid, process->host);
xbt_dynar_reset(simix_global->process_to_run);
}
-void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process) {
+void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_actor_t process) {
SIMIX_process_kill(process, simcall->issuer);
}
/**
* \param process poor victim
* \param issuer the process which has sent the PROCESS_KILL. Important to not schedule twice the same process.
*/
-void SIMIX_process_kill(smx_process_t process, smx_process_t issuer) {
+void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
XBT_DEBUG("Killing process %s on %s",
process->name.c_str(), sg_host_get_name(process->host));
}
if(!xbt_dynar_member(simix_global->process_to_run, &(process)) && process != issuer) {
XBT_DEBUG("Inserting %s in the to_run list", process->name.c_str());
- xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
+ xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
}
}
* @param value value associated to the exception
* @param msg string information associated to the exception
*/
-void SIMIX_process_throw(smx_process_t process, xbt_errcat_t cat, int value, const char *msg) {
+void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const char *msg) {
SMX_EXCEPTION(process, cat, value, msg);
if (process->suspended)
SIMIX_process_sleep_destroy(process->waiting_synchro);
if (!xbt_dynar_member(simix_global->process_to_run, &(process)) && process != SIMIX_process_self()) {
XBT_DEBUG("Inserting %s in the to_run list", process->name.c_str());
- xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
+ xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process);
}
}
* \brief Kills all running processes.
* \param issuer this one will not be killed
*/
-void SIMIX_process_killall(smx_process_t issuer, int reset_pid)
+void SIMIX_process_killall(smx_actor_t issuer, int reset_pid)
{
- smx_process_t p = nullptr;
+ smx_actor_t p = nullptr;
- while ((p = (smx_process_t) xbt_swag_extract(simix_global->process_list))) {
+ while ((p = (smx_actor_t) xbt_swag_extract(simix_global->process_list))) {
if (p != issuer) {
SIMIX_process_kill(p,issuer);
}
SIMIX_process_empty_trash();
}
-void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest)
+void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_actor_t process, sg_host_t dest)
{
process->new_host = dest;
}
-void SIMIX_process_change_host(smx_process_t process, sg_host_t dest)
+void SIMIX_process_change_host(smx_actor_t process, sg_host_t dest)
{
xbt_assert((process != nullptr), "Invalid parameters");
xbt_swag_remove(process, sg_host_simix(process->host)->process_list);
}
-void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process)
+void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t process)
{
smx_activity_t sync_suspend = SIMIX_process_suspend(process, simcall->issuer);
/* If we are suspending ourselves, then just do not finish the simcall now */
}
-smx_activity_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+smx_activity_t SIMIX_process_suspend(smx_actor_t process, smx_actor_t issuer)
{
if (process->suspended) {
XBT_DEBUG("Process '%s' is already suspended", process->name.c_str());
}
}
-void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_process_t process){
+void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_actor_t process){
SIMIX_process_resume(process, simcall->issuer);
}
-void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
+void SIMIX_process_resume(smx_actor_t process, smx_actor_t issuer)
{
XBT_IN("process = %p, issuer = %p", process, issuer);
return xbt_swag_size(simix_global->process_list);
}
-int SIMIX_process_get_PID(smx_process_t self)
+int SIMIX_process_get_PID(smx_actor_t self)
{
if (self == nullptr)
return 0;
void* SIMIX_process_self_get_data()
{
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
if (!self) {
return nullptr;
void SIMIX_process_self_set_data(void *data)
{
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
SIMIX_process_set_data(self, data);
}
-void* SIMIX_process_get_data(smx_process_t process)
+void* SIMIX_process_get_data(smx_actor_t process)
{
return process->data;
}
-void SIMIX_process_set_data(smx_process_t process, void *data)
+void SIMIX_process_set_data(smx_actor_t process, void *data)
{
process->data = data;
}
by exceptions and logging events */
const char* SIMIX_process_self_get_name() {
- smx_process_t process = SIMIX_process_self();
+ smx_actor_t process = SIMIX_process_self();
if (process == nullptr || process == simix_global->maestro_process)
return "maestro";
return process->name.c_str();
}
-smx_process_t SIMIX_process_get_by_name(const char* name)
+smx_actor_t SIMIX_process_get_by_name(const char* name)
{
- smx_process_t proc;
+ smx_actor_t proc;
xbt_swag_foreach(proc, simix_global->process_list) {
if (proc->name == name)
return proc;
return nullptr;
}
-int SIMIX_process_is_suspended(smx_process_t process)
+int SIMIX_process_is_suspended(smx_actor_t process)
{
return process->suspended;
}
-xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
+xbt_dict_t SIMIX_process_get_properties(smx_actor_t process)
{
return process->properties;
}
-void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout)
+void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout)
{
if (process->finished) {
// The joined process is already finished, just wake up the issuer process right away
return 0;
}
-smx_activity_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
+smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout)
{
smx_activity_t res = SIMIX_process_sleep(issuer, timeout);
static_cast<simgrid::kernel::activity::ActivityImpl*>(res)->ref();
simcall->issuer->waiting_synchro = sync;
}
-smx_activity_t SIMIX_process_sleep(smx_process_t process, double duration)
+smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration)
{
sg_host_t host = process->host;
*
* \param self the current process
*/
-void SIMIX_process_yield(smx_process_t self)
+void SIMIX_process_yield(smx_actor_t self)
{
XBT_DEBUG("Yield process '%s'", self->name.c_str());
xbt_abort();
}
-smx_context_t SIMIX_process_get_context(smx_process_t p) {
+smx_context_t SIMIX_process_get_context(smx_actor_t p) {
return p->context;
}
-void SIMIX_process_set_context(smx_process_t p,smx_context_t c) {
+void SIMIX_process_set_context(smx_actor_t p,smx_context_t c) {
p->context = c;
}
/**
* \brief Returns the process from PID.
*/
-smx_process_t SIMIX_process_from_PID(int PID)
+smx_actor_t SIMIX_process_from_PID(int PID)
{
- smx_process_t proc;
+ smx_actor_t proc;
xbt_swag_foreach(proc, simix_global->process_list) {
if (proc->pid == static_cast<unsigned long> (PID))
return proc;
/** @brief returns a dynar containing all currently existing processes */
xbt_dynar_t SIMIX_processes_as_dynar() {
- smx_process_t proc;
- xbt_dynar_t res = xbt_dynar_new(sizeof(smx_process_t),nullptr);
+ smx_actor_t proc;
+ xbt_dynar_t res = xbt_dynar_new(sizeof(smx_actor_t),nullptr);
xbt_swag_foreach(proc, simix_global->process_list) {
xbt_dynar_push(res,&proc);
}
return res;
}
-void SIMIX_process_on_exit_runall(smx_process_t process) {
+void SIMIX_process_on_exit_runall(smx_actor_t process) {
s_smx_process_exit_fun_t exit_fun;
smx_process_exit_status_t exit_status = (process->context->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
while (!xbt_dynar_is_empty(process->on_exit)) {
}
}
-void SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data) {
+void SIMIX_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data) {
xbt_assert(process, "current process not found: are you in maestro context ?");
if (!process->on_exit) {
* If set to 1, the process will be automatically restarted when its host
* comes back.
*/
-void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart) {
+void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart) {
process->auto_restart = auto_restart;
}
-smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process) {
+smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process) {
return SIMIX_process_restart(process, simcall->issuer);
}
/** @brief Restart a process, starting it again from the beginning. */
-smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer) {
+smx_actor_t SIMIX_process_restart(smx_actor_t process, smx_actor_t issuer) {
XBT_DEBUG("Restarting process %s on %s", process->name.c_str(), sg_host_get_name(process->host));
//retrieve the arguments of the old process
arg.properties, arg.auto_restart);
}
-void SIMIX_segment_index_set(smx_process_t proc, int index){
+void SIMIX_segment_index_set(smx_actor_t proc, int index){
proc->segment_index = index;
}
* \param properties the properties of the process
* \param auto_restart either it is autorestarting or not.
*/
-smx_process_t simcall_process_create(const char *name,
+smx_actor_t simcall_process_create(const char *name,
xbt_main_func_t code,
void *data,
const char *hostname,
for (int i = 0; i != argc; ++i)
xbt_free(argv[i]);
xbt_free(argv);
- smx_process_t res = simcall_process_create(name,
+ smx_actor_t res = simcall_process_create(name,
std::move(wrapped_code),
data, hostname, kill_time, properties, auto_restart);
return res;
}
-smx_process_t simcall_process_create(
+smx_actor_t simcall_process_create(
const char *name, std::function<void()> code, void *data,
const char *hostname, double kill_time,
xbt_dict_t properties, int auto_restart)
{
if (name == nullptr)
name = "";
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
return simgrid::simix::kernelImmediate([&] {
return SIMIX_process_create(name, std::move(code), data, hostname, kill_time, properties, auto_restart, self);
});
typedef simgrid::simix::ProcessArg *smx_process_arg_t;
-typedef simgrid::simix::ActorImpl* smx_process_t;
+typedef simgrid::simix::ActorImpl* smx_actor_t;
SG_BEGIN_DECL()
-XBT_PRIVATE smx_process_t SIMIX_process_create(
+XBT_PRIVATE smx_actor_t SIMIX_process_create(
const char *name,
std::function<void()> code,
void *data,
double kill_time,
xbt_dict_t properties,
int auto_restart,
- smx_process_t parent_process);
+ smx_actor_t parent_process);
XBT_PRIVATE void SIMIX_process_runall();
-XBT_PRIVATE void SIMIX_process_kill(smx_process_t process, smx_process_t issuer);
-XBT_PRIVATE void SIMIX_process_killall(smx_process_t issuer, int reset_pid);
-XBT_PRIVATE void SIMIX_process_stop(smx_process_t arg);
-XBT_PRIVATE void SIMIX_process_cleanup(smx_process_t arg);
+XBT_PRIVATE void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer);
+XBT_PRIVATE void SIMIX_process_killall(smx_actor_t issuer, int reset_pid);
+XBT_PRIVATE void SIMIX_process_stop(smx_actor_t arg);
+XBT_PRIVATE void SIMIX_process_cleanup(smx_actor_t arg);
XBT_PRIVATE void SIMIX_process_empty_trash();
-XBT_PRIVATE void SIMIX_process_yield(smx_process_t self);
+XBT_PRIVATE void SIMIX_process_yield(smx_actor_t self);
XBT_PRIVATE void SIMIX_process_exception_terminate(xbt_ex_t * e);
-XBT_PRIVATE void SIMIX_process_change_host(smx_process_t process, sg_host_t dest);
-XBT_PRIVATE smx_activity_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
-XBT_PRIVATE void SIMIX_process_resume(smx_process_t process, smx_process_t issuer);
-XBT_PRIVATE int SIMIX_process_get_PID(smx_process_t self);
-XBT_PRIVATE void* SIMIX_process_get_data(smx_process_t process);
-XBT_PRIVATE void SIMIX_process_set_data(smx_process_t process, void *data);
-XBT_PRIVATE smx_process_t SIMIX_process_get_by_name(const char* name);
-XBT_PRIVATE int SIMIX_process_is_suspended(smx_process_t process);
-XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties(smx_process_t process);
-XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout);
-XBT_PRIVATE smx_activity_t SIMIX_process_sleep(smx_process_t process, double duration);
+XBT_PRIVATE void SIMIX_process_change_host(smx_actor_t process, sg_host_t dest);
+XBT_PRIVATE smx_activity_t SIMIX_process_suspend(smx_actor_t process, smx_actor_t issuer);
+XBT_PRIVATE void SIMIX_process_resume(smx_actor_t process, smx_actor_t issuer);
+XBT_PRIVATE int SIMIX_process_get_PID(smx_actor_t self);
+XBT_PRIVATE void* SIMIX_process_get_data(smx_actor_t process);
+XBT_PRIVATE void SIMIX_process_set_data(smx_actor_t process, void *data);
+XBT_PRIVATE smx_actor_t SIMIX_process_get_by_name(const char* name);
+XBT_PRIVATE int SIMIX_process_is_suspended(smx_actor_t process);
+XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties(smx_actor_t process);
+XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout);
+XBT_PRIVATE smx_activity_t SIMIX_process_sleep(smx_actor_t process, double duration);
XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
-XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart);
-XBT_PRIVATE smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer);
+XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
+XBT_PRIVATE smx_actor_t SIMIX_process_restart(smx_actor_t process, smx_actor_t issuer);
-void SIMIX_segment_index_set(smx_process_t process, int segment_index);
+void SIMIX_segment_index_set(smx_actor_t process, int segment_index);
extern void (*SMPI_switch_data_segment)(int dest);
SG_END_DECL()
#include "popping_bodies.cpp"
-void simcall_call(smx_process_t process)
+void simcall_call(smx_actor_t process)
{
if (process != simix_global->maestro_process) {
XBT_DEBUG("Yield process '%s' on simcall %s (%d)", process->name.c_str(),
*
* \param process poor victim
*/
-void simcall_process_kill(smx_process_t process)
+void simcall_process_kill(smx_actor_t process)
{
simcall_BODY_process_kill(process);
}
* \brief Cleans up a SIMIX process.
* \param process poor victim (must have already been killed)
*/
-void simcall_process_cleanup(smx_process_t process)
+void simcall_process_cleanup(smx_actor_t process)
{
simcall_BODY_process_cleanup(process);
}
* \param process the process to migrate
* \param dest name of the new host
*/
-void simcall_process_set_host(smx_process_t process, sg_host_t dest)
+void simcall_process_set_host(smx_actor_t process, sg_host_t dest)
{
simcall_BODY_process_set_host(process, dest);
}
-void simcall_process_join(smx_process_t process, double timeout)
+void simcall_process_join(smx_actor_t process, double timeout)
{
simcall_BODY_process_join(process, timeout);
}
*
* \param process a SIMIX process
*/
-void simcall_process_suspend(smx_process_t process)
+void simcall_process_suspend(smx_actor_t process)
{
xbt_assert(process, "Invalid parameters");
*
* \param process a SIMIX process
*/
-void simcall_process_resume(smx_process_t process)
+void simcall_process_resume(smx_actor_t process)
{
simcall_BODY_process_resume(process);
}
/**
* \ingroup simix_process_management
- * \brief Return the user data of a #smx_process_t.
+ * \brief Return the user data of a #smx_actor_t.
* \param process a SIMIX process
* \return the user data of this process
*/
-void* simcall_process_get_data(smx_process_t process)
+void* simcall_process_get_data(smx_actor_t process)
{
return SIMIX_process_get_data(process);
}
/**
* \ingroup simix_process_management
- * \brief Set the user data of a #smx_process_t.
+ * \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_process_t process, void *data)
+void simcall_process_set_data(smx_actor_t process, void *data)
{
simgrid::simix::kernelImmediate(std::bind(SIMIX_process_set_data, process, data));
}
* \ingroup simix_process_management
* \brief Set the kill time of a process.
*/
-void simcall_process_set_kill_time(smx_process_t process, double kill_time)
+void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
{
if (kill_time <= SIMIX_get_clock() || simix_global->kill_process_function == nullptr)
* \ingroup simix_process_management
* \brief Get the kill time of a process (or 0 if unset).
*/
-double simcall_process_get_kill_time(smx_process_t process) {
+double simcall_process_get_kill_time(smx_actor_t process) {
return SIMIX_timer_get_date(process->kill_timer);
}
* \param process SIMIX process
* \return 1, if the process is suspended, else 0.
*/
-int simcall_process_is_suspended(smx_process_t process)
+int simcall_process_is_suspended(smx_actor_t process)
{
return simcall_BODY_process_is_suspended(process);
}
*
* This functions returns the properties associated with this process
*/
-xbt_dict_t simcall_process_get_properties(smx_process_t process)
+xbt_dict_t simcall_process_get_properties(smx_actor_t process)
{
return SIMIX_process_get_properties(process);
}
* \brief Add an on_exit function
* Add an on_exit function which will be executed when the process exits/is killed.
*/
-XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data)
+XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data)
{
simcall_BODY_process_on_exit(process, fun, data);
}
* Will restart the process when the host comes back up if auto_restart is set to 1.
*/
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart)
+XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart)
{
simcall_BODY_process_auto_restart_set(process, auto_restart);
}
* \ingroup simix_process_management
* \brief Restarts the process, killing it and starting it again from scratch.
*/
-XBT_PUBLIC(smx_process_t) simcall_process_restart(smx_process_t process)
+XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process)
{
- return (smx_process_t) simcall_BODY_process_restart(process);
+ return (smx_actor_t) simcall_BODY_process_restart(process);
}
/**
* \ingroup simix_process_management
return simcall_BODY_mbox_create(name);
}
-void simcall_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t process)
+void simcall_mbox_set_receiver(smx_mailbox_t mbox, smx_actor_t process)
{
simcall_BODY_mbox_set_receiver(mbox, process);
}
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate,
+void simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t), void *data,
/**
* \ingroup simix_comm_management
*/
-smx_activity_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate,
+smx_activity_t simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*clean_fun)(void *),
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t * dst_buff_size,
+void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout, double rate)
/**
* \ingroup simix_comm_management
*/
-smx_activity_t simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size,
+smx_activity_t simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double rate)
namespace simgrid {
namespace simix {
-void unblock(smx_process_t process)
+void unblock(smx_actor_t process)
{
xbt_assert(SIMIX_is_maestro());
SIMIX_simcall_answer(&process->simcall);
* weird in process scheduling.
*/
/* if(!xbt_dynar_member(simix_global->process_to_run, &(simcall->issuer))) */
- xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, simcall->issuer);
+ xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, simcall->issuer);
/* else DIE_IMPOSSIBLE; */
}
}
simgrid::simix::marshal<sg_host_t>(simcall->args[0], arg);
}
-static inline smx_process_t simcall_process_kill__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_kill__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int simcall_process_killall__get__reset_pid(smx_simcall_t simcall) {
simgrid::simix::marshal<int>(simcall->args[0], arg);
}
-static inline smx_process_t simcall_process_cleanup__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_cleanup__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
-static inline smx_process_t simcall_process_suspend__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_suspend__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_suspend__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_suspend__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
-static inline smx_process_t simcall_process_resume__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_resume__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_resume__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_resume__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
-static inline smx_process_t simcall_process_set_host__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_set_host__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_set_host__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_set_host__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline sg_host_t simcall_process_set_host__get__dest(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
simgrid::simix::marshal<sg_host_t>(simcall->args[1], arg);
}
-static inline smx_process_t simcall_process_is_suspended__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_is_suspended__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_is_suspended__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_is_suspended__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int simcall_process_is_suspended__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_process_t simcall_process_join__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_join__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_join__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_join__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline double simcall_process_join__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_process_t simcall_process_on_exit__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_on_exit__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int_f_pvoid_pvoid_t simcall_process_on_exit__get__fun(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]);
simgrid::simix::marshal<void*>(simcall->args[2], arg);
}
-static inline smx_process_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<int>(simcall->args[1]);
simgrid::simix::marshal<int>(simcall->args[1], arg);
}
-static inline smx_process_t simcall_process_restart__get__process(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
-static inline smx_process_t simcall_process_restart__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_process_t>(simcall->result);
+static inline smx_actor_t simcall_process_restart__get__result(smx_simcall_t simcall){
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->result);
}
-static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_process_t result){
- simgrid::simix::marshal<smx_process_t>(simcall->result, result);
+static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_actor_t result){
+ simgrid::simix::marshal<smx_actor_t>(simcall->result, result);
}
static inline const char* simcall_mbox_create__get__name(smx_simcall_t simcall) {
static inline void simcall_mbox_set_receiver__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) {
simgrid::simix::marshal<smx_mailbox_t>(simcall->args[0], arg);
}
-static inline smx_process_t simcall_mbox_set_receiver__get__receiver(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[1]);
+static inline smx_actor_t simcall_mbox_set_receiver__get__receiver(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[1]);
}
-static inline void simcall_mbox_set_receiver__set__receiver(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[1], arg);
+static inline void simcall_mbox_set_receiver__set__receiver(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[1], arg);
}
static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall) {
simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
}
-static inline smx_process_t simcall_comm_send__get__sender(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_comm_send__get__sender(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_send__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
simgrid::simix::marshal<double>(simcall->args[9], arg);
}
-static inline smx_process_t simcall_comm_isend__get__sender(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_comm_isend__get__sender(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_isend__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
}
-static inline smx_process_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_recv__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
simgrid::simix::marshal<double>(simcall->args[8], arg);
}
-static inline smx_process_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]);
+static inline smx_actor_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
}
-static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_process_t arg) {
- simgrid::simix::marshal<smx_process_t>(simcall->args[0], arg);
+static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) {
+ simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
}
static inline smx_mailbox_t simcall_comm_irecv__get__mbox(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
XBT_PRIVATE void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t ind_vm);
XBT_PRIVATE void simcall_HANDLER_vm_save(smx_simcall_t simcall, sg_host_t ind_vm);
XBT_PRIVATE void simcall_HANDLER_vm_restore(smx_simcall_t simcall, sg_host_t ind_vm);
-XBT_PRIVATE void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process);
+XBT_PRIVATE void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_actor_t process);
XBT_PRIVATE void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid);
-XBT_PRIVATE void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process);
-XBT_PRIVATE void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_process_t process);
-XBT_PRIVATE void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest);
-XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout);
+XBT_PRIVATE void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t process);
+XBT_PRIVATE void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_actor_t process);
+XBT_PRIVATE void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_actor_t process, sg_host_t dest);
+XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout);
XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
XBT_PRIVATE smx_activity_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound);
XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t execution);
-XBT_PRIVATE smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process);
+XBT_PRIVATE smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process);
XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
-XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
-XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate);
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
+XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout);
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
+XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate);
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms, double timeout);
XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t comm, double timeout);
XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t comm);
template<class R, class... T>
inline static R simcall(e_smx_simcall_t call, T const&... t)
{
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
simgrid::simix::marshal(&self->simcall, call, t...);
if (self != simix_global->maestro_process) {
XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(),
return simcall<void, sg_host_t>(SIMCALL_VM_RESTORE, ind_vm);
}
-inline static void simcall_BODY_process_kill(smx_process_t process) {
+inline static void simcall_BODY_process_kill(smx_actor_t process) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_process_kill(&SIMIX_process_self()->simcall, process);
- return simcall<void, smx_process_t>(SIMCALL_PROCESS_KILL, process);
+ return simcall<void, smx_actor_t>(SIMCALL_PROCESS_KILL, process);
}
inline static void simcall_BODY_process_killall(int reset_pid) {
return simcall<void, int>(SIMCALL_PROCESS_KILLALL, reset_pid);
}
-inline static void simcall_BODY_process_cleanup(smx_process_t process) {
+inline static void simcall_BODY_process_cleanup(smx_actor_t process) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_process_cleanup(process);
- return simcall<void, smx_process_t>(SIMCALL_PROCESS_CLEANUP, process);
+ return simcall<void, smx_actor_t>(SIMCALL_PROCESS_CLEANUP, process);
}
-inline static void simcall_BODY_process_suspend(smx_process_t process) {
+inline static void simcall_BODY_process_suspend(smx_actor_t process) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_process_suspend(&SIMIX_process_self()->simcall, process);
- return simcall<void, smx_process_t>(SIMCALL_PROCESS_SUSPEND, process);
+ return simcall<void, smx_actor_t>(SIMCALL_PROCESS_SUSPEND, process);
}
-inline static void simcall_BODY_process_resume(smx_process_t process) {
+inline static void simcall_BODY_process_resume(smx_actor_t process) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_process_resume(&SIMIX_process_self()->simcall, process);
- return simcall<void, smx_process_t>(SIMCALL_PROCESS_RESUME, process);
+ return simcall<void, smx_actor_t>(SIMCALL_PROCESS_RESUME, process);
}
-inline static void simcall_BODY_process_set_host(smx_process_t process, sg_host_t dest) {
+inline static void simcall_BODY_process_set_host(smx_actor_t process, sg_host_t dest) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_process_set_host(&SIMIX_process_self()->simcall, process, dest);
- return simcall<void, smx_process_t, sg_host_t>(SIMCALL_PROCESS_SET_HOST, process, dest);
+ return simcall<void, smx_actor_t, sg_host_t>(SIMCALL_PROCESS_SET_HOST, process, dest);
}
-inline static int simcall_BODY_process_is_suspended(smx_process_t process) {
+inline static int simcall_BODY_process_is_suspended(smx_actor_t process) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_process_is_suspended(process);
- return simcall<int, smx_process_t>(SIMCALL_PROCESS_IS_SUSPENDED, process);
+ return simcall<int, smx_actor_t>(SIMCALL_PROCESS_IS_SUSPENDED, process);
}
-inline static int simcall_BODY_process_join(smx_process_t process, double timeout) {
+inline static int simcall_BODY_process_join(smx_actor_t process, double timeout) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_process_join(&SIMIX_process_self()->simcall, process, timeout);
- return simcall<int, smx_process_t, double>(SIMCALL_PROCESS_JOIN, process, timeout);
+ return simcall<int, smx_actor_t, double>(SIMCALL_PROCESS_JOIN, process, timeout);
}
inline static int simcall_BODY_process_sleep(double duration) {
return simcall<int, smx_activity_t>(SIMCALL_EXECUTION_WAIT, execution);
}
-inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) {
+inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_process_on_exit(process, fun, data);
- return simcall<void, smx_process_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
+ return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
}
-inline static void simcall_BODY_process_auto_restart_set(smx_process_t process, int auto_restart) {
+inline static void simcall_BODY_process_auto_restart_set(smx_actor_t process, int auto_restart) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_process_auto_restart_set(process, auto_restart);
- return simcall<void, smx_process_t, int>(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart);
+ return simcall<void, smx_actor_t, int>(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart);
}
-inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) {
+inline static smx_actor_t simcall_BODY_process_restart(smx_actor_t process) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_process_restart(&SIMIX_process_self()->simcall, process);
- return simcall<smx_process_t, smx_process_t>(SIMCALL_PROCESS_RESTART, process);
+ return simcall<smx_actor_t, smx_actor_t>(SIMCALL_PROCESS_RESTART, process);
}
inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) {
return simcall<smx_mailbox_t, const char*>(SIMCALL_MBOX_CREATE, name);
}
-inline static void simcall_BODY_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t receiver) {
+inline static void simcall_BODY_mbox_set_receiver(smx_mailbox_t mbox, smx_actor_t receiver) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_mbox_set_receiver(mbox, receiver);
- return simcall<void, smx_mailbox_t, smx_process_t>(SIMCALL_MBOX_SET_RECEIVER, mbox, receiver);
+ return simcall<void, smx_mailbox_t, smx_actor_t>(SIMCALL_MBOX_SET_RECEIVER, mbox, receiver);
}
inline static smx_activity_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
return simcall<smx_activity_t, smx_mailbox_t, int, int, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
}
-inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) {
+inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_send(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
- return simcall<void, smx_process_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
+ return simcall<void, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
}
-inline static smx_activity_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) {
+inline static smx_activity_t simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_isend(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
- return simcall<smx_activity_t, smx_process_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
+ return simcall<smx_activity_t, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
}
-inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) {
+inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_recv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
- return simcall<void, smx_process_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
+ return simcall<void, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
}
-inline static smx_activity_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) {
+inline static smx_activity_t simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
- return simcall<smx_activity_t, smx_process_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
+ return simcall<smx_activity_t, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
}
inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
break;
case SIMCALL_PROCESS_KILL:
- simcall_HANDLER_process_kill(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]));
+ simcall_HANDLER_process_kill(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_PROCESS_CLEANUP:
- SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]));
+ SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_SUSPEND:
- simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]));
+ simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
break;
case SIMCALL_PROCESS_RESUME:
- simcall_HANDLER_process_resume(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]));
+ simcall_HANDLER_process_resume(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_SET_HOST:
- simcall_HANDLER_process_set_host(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]));
+ simcall_HANDLER_process_set_host(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_IS_SUSPENDED:
- simgrid::simix::marshal<int>(simcall->result, SIMIX_process_is_suspended(simgrid::simix::unmarshal<smx_process_t>(simcall->args[0])));
+ simgrid::simix::marshal<int>(simcall->result, SIMIX_process_is_suspended(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0])));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_JOIN:
- simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+ simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
break;
case SIMCALL_PROCESS_SLEEP:
break;
case SIMCALL_PROCESS_ON_EXIT:
- SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
+ SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_AUTO_RESTART_SET:
- SIMIX_process_auto_restart_set(simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]));
+ SIMIX_process_auto_restart_set(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_RESTART:
- simgrid::simix::marshal<smx_process_t>(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0])));
+ simgrid::simix::marshal<smx_actor_t>(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0])));
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_MBOX_SET_RECEIVER:
- SIMIX_mbox_set_receiver(simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_process_t>(simcall->args[1]));
+ SIMIX_mbox_set_receiver(simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_actor_t>(simcall->args[1]));
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_COMM_SEND:
- simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
+ simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
break;
case SIMCALL_COMM_ISEND:
- simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]), simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]), simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_COMM_RECV:
- simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
+ simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
break;
case SIMCALL_COMM_IRECV:
- simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
SIMIX_simcall_answer(simcall);
break;
*/
struct s_smx_simcall {
e_smx_simcall_t call;
- smx_process_t issuer;
+ smx_actor_t issuer;
smx_timer_t timer;
int mc_value;
union u_smx_scalar args[11];
void vm_save(sg_host_t ind_vm);
void vm_restore(sg_host_t ind_vm);
-void process_kill(smx_process_t process);
+void process_kill(smx_actor_t process);
void process_killall(int reset_pid);
-void process_cleanup(smx_process_t process) [[nohandler]];
-void process_suspend(smx_process_t process) [[block]];
-void process_resume(smx_process_t process);
-void process_set_host(smx_process_t process, sg_host_t dest);
-int process_is_suspended(smx_process_t process) [[nohandler]];
-int process_join(smx_process_t process, double timeout) [[block]];
+void process_cleanup(smx_actor_t process) [[nohandler]];
+void process_suspend(smx_actor_t process) [[block]];
+void process_resume(smx_actor_t process);
+void process_set_host(smx_actor_t process, sg_host_t dest);
+int process_is_suspended(smx_actor_t process) [[nohandler]];
+int process_join(smx_actor_t process, double timeout) [[block]];
int process_sleep(double duration) [[block]];
smx_activity_t execution_start(const char* name, double flops_amount, double priority, double bound);
void execution_set_bound(smx_activity_t execution, double bound) [[nohandler]];
int execution_wait(smx_activity_t execution) [[block]];
-void process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
-void process_auto_restart_set(smx_process_t process, int auto_restart) [[nohandler]];
-smx_process_t process_restart(smx_process_t process);
+void process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
+void process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]];
+smx_actor_t process_restart(smx_actor_t process);
smx_mailbox_t mbox_create(const char* name) [[nohandler]];
-void mbox_set_receiver(smx_mailbox_t mbox, smx_process_t receiver) [[nohandler]];
+void mbox_set_receiver(smx_mailbox_t mbox, smx_actor_t receiver) [[nohandler]];
smx_activity_t comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
-void comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
-smx_activity_t comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
-void comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]];
-smx_activity_t comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
+void comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
+smx_activity_t comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
+void comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]];
+smx_activity_t comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
int comm_waitany(xbt_dynar_t comms, double timeout) [[block]];
void comm_wait(smx_activity_t comm, double timeout) [[block]];
int comm_test(smx_activity_t comm) [[block]];
template<class R, class... T>
inline static R simcall(e_smx_simcall_t call, T const&... t)
{
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
simgrid::simix::marshal(&self->simcall, call, t...);
if (self != simix_global->maestro_process) {
XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name.c_str(),
}
/**
- * \brief Gets a #smx_process_t code from the global table.
+ * \brief Gets a #smx_actor_t code from the global table.
*
* Gets a code function from the global table. Returns nullptr if there are no function registered with the name.
* This table is then used by #SIMIX_launch_application.
* \param name the reference name of the function.
- * \return The #smx_process_t or nullptr.
+ * \return The #smx_actor_t or nullptr.
*/
simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name)
{
return xbt_heap_size(simix_timers) > 0 ? xbt_heap_maxkey(simix_timers) : -1.0;
}
-static void kill_process(smx_process_t process)
+static void kill_process(smx_actor_t process)
{
SIMIX_process_kill(process, nullptr);
}
simix_global = std::unique_ptr<simgrid::simix::Global>(new simgrid::simix::Global());
simgrid::simix::ActorImpl proc;
- simix_global->process_to_run = xbt_dynar_new(sizeof(smx_process_t), nullptr);
- simix_global->process_that_ran = xbt_dynar_new(sizeof(smx_process_t), nullptr);
+ simix_global->process_to_run = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
+ simix_global->process_that_ran = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
simix_global->process_list = xbt_swag_new(xbt_swag_offset(proc, process_hookup));
simix_global->process_to_destroy = xbt_swag_new(xbt_swag_offset(proc, destroy_hookup));
simix_global->maestro_process = nullptr;
static int process_syscall_color(void *p)
{
- switch ((*(smx_process_t *)p)->simcall.call) {
+ switch ((*(smx_actor_t *)p)->simcall.call) {
case SIMCALL_NONE:
case SIMCALL_PROCESS_KILL:
return 2;
}
double time = 0;
- smx_process_t process;
+ smx_actor_t process;
do {
XBT_DEBUG("New Schedule Round; size(queue)=%lu", xbt_dynar_length(simix_global->process_to_run));
return;
}
- smx_process_t process = nullptr;
+ smx_actor_t process = nullptr;
int nbprocess = xbt_swag_size(simix_global->process_list);
XBT_INFO("%d processes are still running, waiting for something.", nbprocess);
}
/** @brief Stop the host if it is on */
-void SIMIX_host_off(sg_host_t h, smx_process_t issuer)
+void SIMIX_host_off(sg_host_t h, smx_actor_t issuer)
{
smx_host_priv_t host = sg_host_simix(h);
/* Clean Simulator data */
if (xbt_swag_size(host->process_list) != 0) {
- smx_process_t process = nullptr;
+ smx_actor_t process = nullptr;
xbt_swag_foreach(process, host->process_list) {
SIMIX_process_kill(process, issuer);
XBT_DEBUG("Killing %s on %s by %s",
if (xbt_swag_size(host->process_list) != 0) {
char *msg = xbt_strdup("Shutting down host, but it's not empty:");
char *tmp;
- smx_process_t process = nullptr;
+ smx_actor_t process = nullptr;
xbt_swag_foreach(process, host->process_list) {
tmp = bprintf("%s\n\t%s", msg, process->name.c_str());
sg_host_t SIMIX_host_self()
{
- smx_process_t process = SIMIX_process_self();
+ smx_actor_t process = SIMIX_process_self();
return (process == nullptr) ? nullptr : process->host;
}
return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound);
}
-smx_activity_t SIMIX_execution_start(smx_process_t issuer, const char *name, double flops_amount, double priority,
+smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name, double flops_amount, double priority,
double bound){
/* alloc structures and initialize */
XBT_PRIVATE void SIMIX_host_restart_processes(sg_host_t host);
XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
-XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_process_t issuer, const char *name,
+XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name,
double flops_amount, double priority, double bound);
XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(const char *name,
int host_nb, sg_host_t *host_list,
XBT_PRIVATE void SIMIX_vm_destroy(sg_host_t ind_vm);
// --
-XBT_PRIVATE void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer);
+XBT_PRIVATE void SIMIX_vm_resume(sg_host_t ind_vm, smx_actor_t issuer);
-XBT_PRIVATE void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer);
+XBT_PRIVATE void SIMIX_vm_suspend(sg_host_t ind_vm, smx_actor_t issuer);
// --
-XBT_PRIVATE void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer);
+XBT_PRIVATE void SIMIX_vm_save(sg_host_t ind_vm, smx_actor_t issuer);
-XBT_PRIVATE void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer);
+XBT_PRIVATE void SIMIX_vm_restore(sg_host_t ind_vm, smx_actor_t issuer);
// --
XBT_PRIVATE void SIMIX_vm_start(sg_host_t ind_vm);
-XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer);
+XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_actor_t issuer);
// --
XBT_PRIVATE e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm);
return SIMIX_file_get_size(simcall->issuer, fd);
}
-sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd)
+sg_size_t SIMIX_file_get_size(smx_actor_t process, smx_file_t fd)
{
sg_host_t host = process->host;
return surf_host_get_size(host, fd->surf_file);
return SIMIX_file_tell(simcall->issuer, fd);
}
-sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd)
+sg_size_t SIMIX_file_tell(smx_actor_t process, smx_file_t fd)
{
sg_host_t host = process->host;
return surf_host_file_tell(host, fd->surf_file);
return SIMIX_file_get_info(simcall->issuer, fd);
}
-xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd)
+xbt_dynar_t SIMIX_file_get_info(smx_actor_t process, smx_file_t fd)
{
sg_host_t host = process->host;
return surf_host_get_info(host, fd->surf_file);
return SIMIX_file_seek(simcall->issuer, fd, offset, origin);
}
-int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin)
+int SIMIX_file_seek(smx_actor_t process, smx_file_t fd, sg_offset_t offset, int origin)
{
sg_host_t host = process->host;
return surf_host_file_seek(host, fd->surf_file, offset, origin);
return SIMIX_file_move(simcall->issuer, file, fullpath);
}
-int SIMIX_file_move(smx_process_t process, smx_file_t file, const char* fullpath)
+int SIMIX_file_move(smx_actor_t process, smx_file_t file, const char* fullpath)
{
sg_host_t host = process->host;
return surf_host_file_move(host, file->surf_file, fullpath);
return SIMIX_storage_get_free_size(simcall->issuer, storage);
}
-sg_size_t SIMIX_storage_get_free_size(smx_process_t process, smx_storage_t storage)
+sg_size_t SIMIX_storage_get_free_size(smx_actor_t process, smx_storage_t storage)
{
return surf_storage_get_free_size(storage);
}
return SIMIX_storage_get_used_size(simcall->issuer, storage);
}
-sg_size_t SIMIX_storage_get_used_size(smx_process_t process, smx_storage_t storage)
+sg_size_t SIMIX_storage_get_used_size(smx_actor_t process, smx_storage_t storage)
{
return surf_storage_get_used_size(storage);
}
XBT_PRIVATE smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host);
XBT_PRIVATE smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host);
XBT_PRIVATE int SIMIX_file_unlink(smx_file_t fd, sg_host_t host);
-XBT_PRIVATE sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
-XBT_PRIVATE sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
-XBT_PRIVATE xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
-XBT_PRIVATE int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin);
-XBT_PRIVATE int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath);
-
-XBT_PRIVATE sg_size_t SIMIX_storage_get_free_size(smx_process_t process, smx_storage_t storage);
-XBT_PRIVATE sg_size_t SIMIX_storage_get_used_size(smx_process_t process, smx_storage_t storage);
+XBT_PRIVATE sg_size_t SIMIX_file_get_size(smx_actor_t process, smx_file_t fd);
+XBT_PRIVATE sg_size_t SIMIX_file_tell(smx_actor_t process, smx_file_t fd);
+XBT_PRIVATE xbt_dynar_t SIMIX_file_get_info(smx_actor_t process, smx_file_t fd);
+XBT_PRIVATE int SIMIX_file_seek(smx_actor_t process, smx_file_t fd, sg_offset_t offset, int origin);
+XBT_PRIVATE int SIMIX_file_move(smx_actor_t process, smx_file_t fd, const char* fullpath);
+
+XBT_PRIVATE sg_size_t SIMIX_storage_get_free_size(smx_actor_t process, smx_storage_t storage);
+XBT_PRIVATE sg_size_t SIMIX_storage_get_used_size(smx_actor_t process, smx_storage_t storage);
XBT_PRIVATE xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
* \param mbox The rendez-vous point
* \param process The receiving process
*/
-void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t process)
+void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_actor_t process)
{
mbox->permanent_receiver = process;
}
/******************************************************************************/
/* Communication synchros */
/******************************************************************************/
-XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_mailbox_t mbox,
+XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t src, smx_mailbox_t mbox,
double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *,smx_activity_t),
SIMCALL_SET_MC_VALUE(simcall, 0);
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src_proc, smx_mailbox_t mbox,
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t src_proc, smx_mailbox_t mbox,
double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *,smx_activity_t),
return (detached ? nullptr : other_comm);
}
-XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox,
+XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox,
void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
-XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox,
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox,
void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
return SIMIX_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
}
-smx_activity_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size,
+smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t), // used to copy data if not default one
void *data, double rate)
return SIMIX_comm_iprobe(simcall->issuer, mbox, type, src, tag, match_fun, data);
}
-smx_activity_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src,
+smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int type, int src,
int tag, int (*match_fun)(void *, void *, smx_activity_t), void *data)
{
XBT_DEBUG("iprobe from %p %p", mbox, &mbox->comm_queue);
XBT_PRIVATE smx_mailbox_t SIMIX_mbox_get_by_name(const char *name);
XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_activity_t comm);
-XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t proc);
-XBT_PRIVATE smx_activity_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox,
+XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_actor_t proc);
+XBT_PRIVATE smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox,
void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_activity_t),
void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double rate);
-XBT_PRIVATE smx_activity_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src,
+XBT_PRIVATE smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int type, int src,
int tag, int (*match_fun)(void *, void *, smx_activity_t), void *data);
#endif
xbt_dynar_t process_that_ran = nullptr;
xbt_swag_t process_list = nullptr;
xbt_swag_t process_to_destroy = nullptr;
- smx_process_t maestro_process = nullptr;
+ smx_actor_t maestro_process = nullptr;
// Maps function names to actor code:
std::unordered_map<std::string, simgrid::simix::ActorCodeFactory> registered_functions;
/** @brief Ask to the provided simix process to raise the provided exception */
#define SMX_EXCEPTION(issuer, cat, val, msg) \
if (1) { \
- smx_process_t _smx_throw_issuer = (issuer); /* evaluate only once */ \
+ smx_actor_t _smx_throw_issuer = (issuer); /* evaluate only once */ \
xbt_ex e(XBT_THROW_POINT, msg); \
e.category = cat; \
e.value = val; \
static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout);
static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout,
- smx_process_t issuer, smx_simcall_t simcall);
-static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer,
+ smx_actor_t issuer, smx_simcall_t simcall);
+static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_actor_t issuer,
smx_simcall_t simcall);
/***************************** Raw synchronization *********************************/
return sync;
}
-void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t simcall)
+void SIMIX_synchro_stop_waiting(smx_actor_t process, smx_simcall_t simcall)
{
XBT_IN("(%p, %p)",process,simcall);
switch (simcall->call) {
XBT_OUT();
}
-void Mutex::lock(smx_process_t issuer)
+void Mutex::lock(smx_actor_t issuer)
{
XBT_IN("(%p; %p)", this, issuer);
/* FIXME: check where to validate the arguments */
* \param issuer the process that tries to acquire the mutex
* \return whether we managed to lock the mutex
*/
-bool Mutex::try_lock(smx_process_t issuer)
+bool Mutex::try_lock(smx_actor_t issuer)
{
XBT_IN("(%p, %p)", this, issuer);
if (this->locked) {
* If the unlocker is not the owner of the mutex nothing happens.
* If there are no process waiting, it sets the mutex as free.
*/
-void Mutex::unlock(smx_process_t issuer)
+void Mutex::unlock(smx_actor_t issuer)
{
XBT_IN("(%p, %p)", this, issuer);
if (xbt_swag_size(this->sleeping) > 0) {
/*process to wake up */
- smx_process_t p = (smx_process_t) xbt_swag_extract(this->sleeping);
+ smx_actor_t p = (smx_actor_t) xbt_swag_extract(this->sleeping);
delete p->waiting_synchro;
p->waiting_synchro = nullptr;
this->owner = p;
void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex)
{
XBT_IN("(%p)",simcall);
- smx_process_t issuer = simcall->issuer;
+ smx_actor_t issuer = simcall->issuer;
_SIMIX_cond_wait(cond, mutex, -1, issuer, simcall);
XBT_OUT();
smx_mutex_t mutex, double timeout)
{
XBT_IN("(%p)",simcall);
- smx_process_t issuer = simcall->issuer;
+ smx_actor_t issuer = simcall->issuer;
_SIMIX_cond_wait(cond, mutex, timeout, issuer, simcall);
XBT_OUT();
static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout,
- smx_process_t issuer, smx_simcall_t simcall)
+ smx_actor_t issuer, smx_simcall_t simcall)
{
XBT_IN("(%p, %p, %f, %p,%p)",cond,mutex,timeout,issuer,simcall);
smx_activity_t synchro = nullptr;
void SIMIX_cond_signal(smx_cond_t cond)
{
XBT_IN("(%p)",cond);
- smx_process_t proc = nullptr;
+ smx_actor_t proc = nullptr;
smx_mutex_t mutex = nullptr;
smx_simcall_t simcall = nullptr;
/* If there are processes waiting for the condition choose one and try
to make it acquire the mutex */
- if ((proc = (smx_process_t) xbt_swag_extract(cond->sleeping))) {
+ if ((proc = (smx_actor_t) xbt_swag_extract(cond->sleeping))) {
/* Destroy waiter's synchronization */
delete proc->waiting_synchro;
void SIMIX_sem_release(smx_sem_t sem)
{
XBT_IN("(%p)",sem);
- smx_process_t proc;
+ smx_actor_t proc;
XBT_DEBUG("Sem release semaphore %p", sem);
- if ((proc = (smx_process_t) xbt_swag_extract(sem->sleeping))) {
+ if ((proc = (smx_actor_t) xbt_swag_extract(sem->sleeping))) {
delete proc->waiting_synchro;
proc->waiting_synchro = nullptr;
SIMIX_simcall_answer(&proc->simcall);
return sem->value;
}
-static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer,
+static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_actor_t issuer,
smx_simcall_t simcall)
{
XBT_IN("(%p, %f, %p, %p)",sem,timeout,issuer,simcall);
Mutex(Mutex const&) = delete;
Mutex& operator=(Mutex const&) = delete;
- void lock(smx_process_t issuer);
- bool try_lock(smx_process_t issuer);
- void unlock(smx_process_t issuer);
+ void lock(smx_actor_t issuer);
+ bool try_lock(smx_actor_t issuer);
+ void unlock(smx_actor_t issuer);
bool locked = false;
- smx_process_t owner = nullptr;
+ smx_actor_t owner = nullptr;
// List of sleeping processes:
xbt_swag_t sleeping = nullptr;
} s_smx_sem_t;
XBT_PRIVATE void SIMIX_post_synchro(smx_activity_t synchro);
-XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t simcall);
+XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_actor_t process, smx_simcall_t simcall);
XBT_PRIVATE void SIMIX_synchro_destroy(smx_activity_t synchro);
XBT_PRIVATE void SIMIX_synchro_finish(smx_activity_t synchro);
SIMIX_vm_migrate(vm, dst_pm);
/* Resume the VM */
- smx_process_t self = SIMIX_process_self();
+ smx_actor_t self = SIMIX_process_self();
SIMIX_vm_resume(vm, self->simcall.issuer);
}
*
* @param host the vm host to suspend (a sg_host_t)
*/
-void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer)
+void SIMIX_vm_suspend(sg_host_t ind_vm, smx_actor_t issuer)
{
const char *name = sg_host_get_name(ind_vm);
/* jump to vm_ws_suspend. The state will be set. */
surf_vm_suspend(ind_vm);
- smx_process_t smx_process, smx_process_safe;
+ smx_actor_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
XBT_DEBUG("suspend %s", smx_process->name.c_str());
SIMIX_process_suspend(smx_process, issuer);
*
* @param host the vm host to resume (a sg_host_t)
*/
-void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer)
+void SIMIX_vm_resume(sg_host_t ind_vm, smx_actor_t issuer)
{
const char *name = sg_host_get_name(ind_vm);
/* jump to vm_ws_resume() */
surf_vm_resume(ind_vm);
- smx_process_t smx_process, smx_process_safe;
+ smx_actor_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
XBT_DEBUG("resume %s", smx_process->name.c_str());
SIMIX_process_resume(smx_process, issuer);
*
* @param host the vm host to save (a sg_host_t)
*/
-void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer)
+void SIMIX_vm_save(sg_host_t ind_vm, smx_actor_t issuer)
{
const char *name = sg_host_get_name(ind_vm);
/* jump to vm_ws_save() */
surf_vm_save(ind_vm);
- smx_process_t smx_process, smx_process_safe;
+ smx_actor_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
XBT_DEBUG("suspend %s", smx_process->name.c_str());
SIMIX_process_suspend(smx_process, issuer);
*
* @param host the vm host to restore (a sg_host_t)
*/
-void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer)
+void SIMIX_vm_restore(sg_host_t ind_vm, smx_actor_t issuer)
{
const char *name = sg_host_get_name(ind_vm);
/* jump to vm_ws_restore() */
surf_vm_resume(ind_vm);
- smx_process_t smx_process, smx_process_safe;
+ smx_actor_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
XBT_DEBUG("resume %s", smx_process->name.c_str());
SIMIX_process_resume(smx_process, issuer);
*
* @param host the vm host to shutdown (a sg_host_t)
*/
-void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer)
+void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_actor_t issuer)
{
const char *name = sg_host_get_name(ind_vm);
XBT_DEBUG("shutdown %s", name);
XBT_DEBUG("%d processes in the VM", xbt_swag_size(sg_host_simix(ind_vm)->process_list));
- smx_process_t smx_process, smx_process_safe;
+ smx_actor_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
XBT_DEBUG("kill %s", smx_process->name.c_str());
SIMIX_process_kill(smx_process, issuer);
extern XBT_PRIVATE int smpi_loaded_page;
extern XBT_PRIVATE int smpi_universe_size;
-XBT_PRIVATE int SIMIX_process_get_PID(smx_process_t self);
+XBT_PRIVATE int SIMIX_process_get_PID(smx_actor_t self);
static inline __attribute__ ((always_inline))
-int smpi_process_index_of_smx_process(smx_process_t process) {
+int smpi_process_index_of_smx_process(smx_actor_t process) {
return SIMIX_process_get_PID(process) -1;
}
int intra_comm_size = 0;
int i =0;
int min_index=INT_MAX;//the minimum index will be the leader
- smx_process_t process = nullptr;
+ smx_actor_t process = nullptr;
xbt_swag_foreach(process, process_list) {
int index = process->pid -1;
{
if (argc != nullptr && argv != nullptr) {
- smx_process_t proc = SIMIX_process_self();
+ smx_actor_t proc = SIMIX_process_self();
proc->context->set_cleanup(&MSG_process_cleanup_from_SIMIX);
char* instance_id = (*argv)[1];
int rank = xbt_str_parse_int((*argv)[2], "Invalid rank: %s");
std::function<void()> code = factory(std::move(args));
smx_process_arg_t arg = nullptr;
- smx_process_t process_created = nullptr;
+ smx_actor_t process_created = nullptr;
arg = new simgrid::simix::ProcessArg();
arg->name = std::string(process->argv[0]);