From: Martin Quinson Date: Sun, 14 Aug 2016 21:56:23 +0000 (+0200) Subject: rename smx_process_t to smx_actor_t X-Git-Tag: v3_14~551 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e81b0628a697bddad304e69a82d898299ff9fe40 rename smx_process_t to smx_actor_t --- diff --git a/doc/doxygen/uhood_switch.doc b/doc/doxygen/uhood_switch.doc index 43fac9b403..3515d8c23c 100644 --- a/doc/doxygen/uhood_switch.doc +++ b/doc/doxygen/uhood_switch.doc @@ -304,14 +304,14 @@ as input. It looks like this: # 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(); @@ -330,7 +330,7 @@ struct s_smx_simcall { // 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: @@ -481,7 +481,7 @@ auto kernelSync(F code) -> decltype(code().get()) 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 result; simcall_run_blocking([&result, self, &code]{ @@ -551,7 +551,7 @@ T simgrid::simix::Future::get() { 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 result; simcall_run_blocking([this, &result, self]{ try { diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 37eca20384..0be8eadb9d 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -142,7 +142,7 @@ typedef struct msg_comm *msg_comm_t; 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 diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 95daaa287a..fe29ab2d24 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -133,7 +133,7 @@ namespace s4u { 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 @@ -147,7 +147,7 @@ XBT_PUBLIC_CLASS Actor { }; } - explicit Actor(smx_process_t pimpl) : pimpl_(pimpl) {} + explicit Actor(smx_actor_t pimpl) : pimpl_(pimpl) {} public: @@ -255,7 +255,7 @@ public: protected: /** Returns the internal implementation of this actor */ - smx_process_t getImpl(); + smx_actor_t getImpl(); }; /** @ingroup s4u_api diff --git a/include/simgrid/s4u/comm.hpp b/include/simgrid/s4u/comm.hpp index 941a553ddc..7ff86151a3 100644 --- a/include/simgrid/s4u/comm.hpp +++ b/include/simgrid/s4u/comm.hpp @@ -122,8 +122,8 @@ private: 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; }; diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 42a9c5808f..9033727663 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -41,14 +41,14 @@ namespace simix { } 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; @@ -115,7 +115,7 @@ typedef enum { /******************************* 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); @@ -127,7 +127,7 @@ extern int smx_context_guard_size_was_set; 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 */ @@ -194,35 +194,35 @@ XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host, */ 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)); @@ -241,7 +241,7 @@ XBT_PUBLIC(void) SIMIX_comm_finish(smx_activity_t synchro); /* 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); @@ -279,7 +279,7 @@ XBT_PUBLIC(void) simcall_vm_shutdown(sg_host_t vm); /**************************** 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, @@ -288,29 +288,29 @@ XBT_PUBLIC(smx_process_t) simcall_process_create(const char *name, 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); @@ -318,18 +318,18 @@ 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, @@ -338,13 +338,13 @@ XBT_PUBLIC(smx_activity_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_ 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), diff --git a/include/simgrid/simix.hpp b/include/simgrid/simix.hpp index d4200a3080..fe3d4fd611 100644 --- a/include/simgrid/simix.hpp +++ b/include/simgrid/simix.hpp @@ -100,7 +100,7 @@ XBT_PUBLIC(void) registerFunction(const char* name, ActorCodeFactory factory); * 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 code, /* userdata */ void*, @@ -108,12 +108,12 @@ typedef smx_process_t (*smx_creation_func_t) ( /* 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 code, void *data, const char *hostname, diff --git a/include/simgrid/simix/blocking_simcall.hpp b/include/simgrid/simix/blocking_simcall.hpp index 5389d8fce5..3a41904109 100644 --- a/include/simgrid/simix/blocking_simcall.hpp +++ b/include/simgrid/simix/blocking_simcall.hpp @@ -24,7 +24,7 @@ XBT_PUBLIC(void) simcall_run_blocking(std::function const& code); 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. @@ -53,7 +53,7 @@ auto kernelSync(F code) -> decltype(code().get()) 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 result; simcall_run_blocking([&result, self, &code]{ @@ -89,7 +89,7 @@ public: { 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 result; simcall_run_blocking([this, &result, self]{ try { @@ -120,7 +120,7 @@ public: 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... diff --git a/src/bindings/java/JavaContext.cpp b/src/bindings/java/JavaContext.cpp index d97796ef2a..54bc03fe57 100644 --- a/src/bindings/java/JavaContext.cpp +++ b/src/bindings/java/JavaContext.cpp @@ -45,7 +45,7 @@ JavaContext* JavaContextFactory::self() JavaContext* JavaContextFactory::create_context( std::function code, - void_pfn_smxprocess_t cleanup, smx_process_t process) + void_pfn_smxprocess_t cleanup, smx_actor_t process) { return this->new_context(std::move(code), cleanup, process); } @@ -53,7 +53,7 @@ JavaContext* JavaContextFactory::create_context( 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(SIMIX_process_get_context(process))->resume(); @@ -62,7 +62,7 @@ void JavaContextFactory::run_all() JavaContext::JavaContext(std::function 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; diff --git a/src/bindings/java/JavaContext.hpp b/src/bindings/java/JavaContext.hpp index aa9094a3e7..a1a7ba16e6 100644 --- a/src/bindings/java/JavaContext.hpp +++ b/src/bindings/java/JavaContext.hpp @@ -42,7 +42,7 @@ public: friend class JavaContextFactory; JavaContext(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_process_t process); + smx_actor_t process); ~JavaContext() override; void stop() override; void suspend() override; @@ -57,7 +57,7 @@ public: ~JavaContextFactory() override; JavaContext* self() override; JavaContext* create_context(std::function code, - void_pfn_smxprocess_t, smx_process_t process) override; + void_pfn_smxprocess_t, smx_actor_t process) override; void run_all() override; }; diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp index 724fdc2b17..7598c39ee1 100644 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@ -332,7 +332,7 @@ void java_main_jprocess(jobject jprocess) JNIEnv *env = get_current_thread_env(); simgrid::kernel::context::JavaContext* context = static_cast(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) diff --git a/src/bindings/java/jmsg_process.cpp b/src/bindings/java/jmsg_process.cpp index 374f714d01..eb7a29a046 100644 --- a/src/bindings/java/jmsg_process.cpp +++ b/src/bindings/java/jmsg_process.cpp @@ -144,7 +144,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv * env, jobject 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); diff --git a/src/include/mc/mc.h b/src/include/mc/mc.h index 6e09a7420a..39213e1bd1 100644 --- a/src/include/mc/mc.h +++ b/src/include/mc/mc.h @@ -63,8 +63,8 @@ XBT_PRIVATE void _mc_cfg_cb_send_determinism(const char *name); 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 **********************************/ @@ -73,7 +73,7 @@ XBT_PUBLIC(void) MC_remove_ignore_heap(void *address, size_t size); 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 *************************************/ diff --git a/src/kernel/activity/SynchroComm.hpp b/src/kernel/activity/SynchroComm.hpp index c2b136b9ed..37a4b96052 100644 --- a/src/kernel/activity/SynchroComm.hpp +++ b/src/kernel/activity/SynchroComm.hpp @@ -51,8 +51,8 @@ namespace activity { 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; diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index 81d5cb7d98..2288faa8d1 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -25,7 +25,7 @@ smx_context_t SIMIX_context_new( std::function 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( @@ -54,20 +54,20 @@ void ContextFactory::declare_context(void* context, std::size_t size) #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 code, smx_process_t process) +Context* ContextFactory::create_maestro(std::function 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 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. diff --git a/src/kernel/context/Context.hpp b/src/kernel/context/Context.hpp index 72f73ec1ee..7f8544d221 100644 --- a/src/kernel/context/Context.hpp +++ b/src/kernel/context/Context.hpp @@ -49,7 +49,7 @@ namespace context { explicit ContextFactory(std::string name) : name_(std::move(name)) {} virtual ~ContextFactory(); virtual Context* create_context(std::function 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: @@ -57,8 +57,8 @@ namespace 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 code, smx_process_t process); + virtual Context* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process); + virtual Context* create_maestro(std::function code, smx_actor_t process); virtual void run_all() = 0; virtual Context* self(); @@ -82,22 +82,22 @@ namespace context { private: std::function 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 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(code_); } - smx_process_t process() + smx_actor_t process() { return this->process_; } @@ -117,7 +117,7 @@ namespace context { AttachContext(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_process_t process) + smx_actor_t process) : Context(std::move(code), cleanup_func, process) {} @@ -154,7 +154,7 @@ XBT_PRIVATE void SIMIX_context_mod_exit(); XBT_PRIVATE smx_context_t SIMIX_context_new( std::function 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]); diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index 414a476e03..8fe39e2538 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -28,7 +28,7 @@ class BoostSerialContext : public BoostContext { public: BoostSerialContext(std::function 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; @@ -39,7 +39,7 @@ class BoostParallelContext : public BoostContext { public: BoostParallelContext(std::function 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; @@ -87,7 +87,7 @@ BoostContextFactory::~BoostContextFactory() } smx_context_t BoostContextFactory::create_context(std::function 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_) @@ -110,7 +110,7 @@ void BoostContextFactory::run_all() BoostContext::threads_working_ = 0; xbt_parmap_apply(BoostContext::parmap_, [](void* arg) { - smx_process_t process = static_cast(arg); + smx_actor_t process = static_cast(arg); BoostContext* context = static_cast(process->context); return context->resume(); }, @@ -120,8 +120,8 @@ void BoostContextFactory::run_all() { 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(first_process->context)->resume(); @@ -139,7 +139,7 @@ static void smx_ctx_boost_wrapper(std::intptr_t arg) } BoostContext::BoostContext(std::function 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) { @@ -204,7 +204,7 @@ void BoostSerialContext::suspend() /* execute the next process */ XBT_DEBUG("Run next process"); next_context = static_cast(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 */ @@ -234,7 +234,7 @@ void BoostSerialContext::stop() 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) { diff --git a/src/kernel/context/ContextBoost.hpp b/src/kernel/context/ContextBoost.hpp index 957bd77bc3..660601489c 100644 --- a/src/kernel/context/ContextBoost.hpp +++ b/src/kernel/context/ContextBoost.hpp @@ -44,7 +44,7 @@ public: friend BoostContextFactory; BoostContext(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_process_t process); + smx_actor_t process); ~BoostContext() override; virtual void resume(); private: @@ -60,7 +60,7 @@ public: BoostContextFactory(); ~BoostContextFactory() override; Context* create_context(std::function code, - void_pfn_smxprocess_t, smx_process_t process) override; + void_pfn_smxprocess_t, smx_actor_t process) override; void run_all() override; }; diff --git a/src/kernel/context/ContextRaw.cpp b/src/kernel/context/ContextRaw.cpp index 6cbe9f6895..2d87f6bf94 100644 --- a/src/kernel/context/ContextRaw.cpp +++ b/src/kernel/context/ContextRaw.cpp @@ -43,7 +43,7 @@ public: friend class RawContextFactory; RawContext(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_process_t process); + smx_actor_t process); ~RawContext() override; public: static void wrapper(void* arg); @@ -62,7 +62,7 @@ public: RawContextFactory(); ~RawContextFactory() override; RawContext* create_context(std::function 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(); @@ -292,7 +292,7 @@ RawContextFactory::~RawContextFactory() } RawContext* RawContextFactory::create_context(std::function code, - void_pfn_smxprocess_t cleanup, smx_process_t process) + void_pfn_smxprocess_t cleanup, smx_actor_t process) { return this->new_context(std::move(code), cleanup, process); @@ -306,7 +306,7 @@ void RawContext::wrapper(void* arg) } RawContext::RawContext(std::function 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()) { @@ -349,8 +349,8 @@ void RawContextFactory::run_all_serial() 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(first_process->context)->resume_serial(); } @@ -364,7 +364,7 @@ void RawContextFactory::run_all_parallel() SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode()); xbt_parmap_apply(raw_parmap, [](void* arg) { - smx_process_t process = static_cast(arg); + smx_actor_t process = static_cast(arg); RawContext* context = static_cast(process->context); context->resume_parallel(); }, @@ -392,7 +392,7 @@ void RawContext::suspend_serial() /* 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 */ @@ -407,7 +407,7 @@ void RawContext::suspend_parallel() { #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) { diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index bef60c90e1..9b6d207425 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -50,7 +50,7 @@ ThreadContextFactory::~ThreadContextFactory() ThreadContext* ThreadContextFactory::create_context( std::function code, - void_pfn_smxprocess_t cleanup, smx_process_t process) + void_pfn_smxprocess_t cleanup, smx_actor_t process) { return this->new_context(std::move(code), cleanup, process, !code); } @@ -59,7 +59,7 @@ void ThreadContextFactory::run_all() { 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); @@ -70,7 +70,7 @@ void ThreadContextFactory::run_all() } 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(process->context)->begin_); xbt_dynar_foreach(simix_global->process_to_run, index, process) @@ -83,19 +83,19 @@ ThreadContext* ThreadContextFactory::self() return static_cast(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( std::function(), cleanup_func, process, false); } -ThreadContext* ThreadContextFactory::create_maestro(std::function code, smx_process_t process) +ThreadContext* ThreadContextFactory::create_maestro(std::function code, smx_actor_t process) { return this->new_context(std::move(code), nullptr, process, true); } ThreadContext::ThreadContext(std::function 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, diff --git a/src/kernel/context/ContextThread.hpp b/src/kernel/context/ContextThread.hpp index 8cc8753538..2bfb881543 100644 --- a/src/kernel/context/ContextThread.hpp +++ b/src/kernel/context/ContextThread.hpp @@ -24,7 +24,7 @@ public: friend ThreadContextFactory; ThreadContext(std::function 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; @@ -49,13 +49,13 @@ public: ThreadContextFactory(); ~ThreadContextFactory() override; ThreadContext* create_context(std::function 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 code, smx_process_t process) override; + ThreadContext* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process) override; + ThreadContext* create_maestro(std::function code, smx_actor_t process) override; }; }}} // namespace diff --git a/src/kernel/context/ContextUnix.cpp b/src/kernel/context/ContextUnix.cpp index 692898d007..550172e6ce 100644 --- a/src/kernel/context/ContextUnix.cpp +++ b/src/kernel/context/ContextUnix.cpp @@ -82,14 +82,14 @@ protected: public: friend UContextFactory; UContext(std::function 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 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; @@ -100,7 +100,7 @@ public: class ParallelUContext : public UContext { public: ParallelUContext(std::function 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; @@ -117,7 +117,7 @@ public: UContextFactory(); ~UContextFactory() override; Context* create_context(std::function 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; }; @@ -176,7 +176,7 @@ void UContextFactory::run_all() 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(process->context); context->resume(); }, @@ -189,8 +189,8 @@ void UContextFactory::run_all() 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(first_process->context); @@ -199,7 +199,7 @@ void UContextFactory::run_all() } Context* UContextFactory::create_context(std::function 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(std::move(code), cleanup, process); @@ -208,7 +208,7 @@ Context* UContextFactory::create_context(std::function code, } UContext::UContext(std::function 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 */ @@ -278,7 +278,7 @@ void SerialUContext::suspend() /* 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 */ @@ -350,7 +350,7 @@ void ParallelUContext::suspend() #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; diff --git a/src/mc/Client.cpp b/src/mc/Client.cpp index 661d404e57..7d326ff873 100644 --- a/src/mc/Client.cpp +++ b/src/mc/Client.cpp @@ -95,7 +95,7 @@ void Client::handleMessages() { // 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) @@ -123,7 +123,7 @@ void Client::handleMessages() 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); @@ -228,7 +228,7 @@ void Client::declareSymbol(const char *name, int* 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(); diff --git a/src/mc/Client.hpp b/src/mc/Client.hpp index 4f8071ecbe..6de722cbeb 100644 --- a/src/mc/Client.hpp +++ b/src/mc/Client.hpp @@ -44,7 +44,7 @@ public: 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 :/ diff --git a/src/mc/CommunicationDeterminismChecker.cpp b/src/mc/CommunicationDeterminismChecker.cpp index b8df5622c1..9f03fe9028 100644 --- a/src/mc/CommunicationDeterminismChecker.cpp +++ b/src/mc/CommunicationDeterminismChecker.cpp @@ -103,9 +103,9 @@ static void update_comm_pattern( simgrid::kernel::activity::Comm* comm = static_cast(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; @@ -178,7 +178,7 @@ void CommunicationDeterminismChecker::deterministic_comm_pattern( 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( @@ -448,7 +448,7 @@ void CommunicationDeterminismChecker::restoreState() /* 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 */ diff --git a/src/mc/LivenessChecker.cpp b/src/mc/LivenessChecker.cpp index 4f60bc148a..f573622cf1 100644 --- a/src/mc/LivenessChecker.cpp +++ b/src/mc/LivenessChecker.cpp @@ -208,7 +208,7 @@ void LivenessChecker::replay() 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 */ diff --git a/src/mc/SafetyChecker.cpp b/src/mc/SafetyChecker.cpp index 285330b32b..0c8d7aff95 100644 --- a/src/mc/SafetyChecker.cpp +++ b/src/mc/SafetyChecker.cpp @@ -216,7 +216,7 @@ int SafetyChecker::backtrack() 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 @@ -251,7 +251,7 @@ int SafetyChecker::backtrack() } 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, diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index b82c3f2554..18447d090f 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -59,7 +59,7 @@ void wait_for_requests(void) xbt_assert(mc_model_checker == nullptr); #endif - smx_process_t process; + smx_actor_t process; smx_simcall_t req; unsigned int iter; diff --git a/src/mc/mc_client_api.cpp b/src/mc/mc_client_api.cpp index 0e4fcf05ef..9fbd031688 100644 --- a/src/mc/mc_client_api.cpp +++ b/src/mc/mc_client_api.cpp @@ -78,7 +78,7 @@ void MC_automaton_new_propositional_symbol_pointer(const char *name, int* value) * @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()) diff --git a/src/mc/mc_global.cpp b/src/mc/mc_global.cpp index ebe9ffcd24..c4b23fef33 100644 --- a/src/mc/mc_global.cpp +++ b/src/mc/mc_global.cpp @@ -97,7 +97,7 @@ void MC_run() 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(); @@ -177,7 +177,7 @@ static void MC_dump_stacks(FILE* file) } #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; @@ -186,7 +186,7 @@ double MC_process_clock_get(smx_process_t process) 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; } diff --git a/src/mc/mc_record.cpp b/src/mc/mc_record.cpp index ce0fc90312..8fff9d029d 100644 --- a/src/mc/mc_record.cpp +++ b/src/mc/mc_record.cpp @@ -52,7 +52,7 @@ void replay(RecordTrace const& trace) 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); diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index cf79f695c3..e2087298af 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -223,7 +223,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid 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) { @@ -295,9 +295,9 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid } 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, @@ -332,9 +332,9 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid 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, @@ -466,7 +466,7 @@ bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx) 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); } @@ -496,7 +496,7 @@ std::string request_get_dot_output(smx_simcall_t req, int value) { 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: @@ -529,9 +529,9 @@ std::string request_get_dot_output(smx_simcall_t req, int value) static_cast(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)]", diff --git a/src/mc/mc_request.h b/src/mc/mc_request.h index c03e2a35fd..674b763e90 100644 --- a/src/mc/mc_request.h +++ b/src/mc/mc_request.h @@ -32,7 +32,7 @@ XBT_PRIVATE bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx); * * 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); diff --git a/src/mc/mc_smx.cpp b/src/mc/mc_smx.cpp index e3d50c9b18..69a1e87901 100644 --- a/src/mc/mc_smx.cpp +++ b/src/mc/mc_smx.cpp @@ -25,14 +25,14 @@ 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; @@ -45,7 +45,7 @@ simgrid::mc::SimixProcessInformation* process_info_cast(smx_process_t p) /** 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( @@ -61,7 +61,7 @@ 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; @@ -70,7 +70,7 @@ static void MC_process_refresh_simix_process_list( 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); } @@ -122,11 +122,11 @@ void Process::refresh_simix() * @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: @@ -140,7 +140,7 @@ smx_process_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req) 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); @@ -176,7 +176,7 @@ const char* MC_smx_process_get_host_name(smx_process_t p) 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) diff --git a/src/mc/mc_smx.h b/src/mc/mc_smx.h index 70f9968bea..cf61c67eba 100644 --- a/src/mc/mc_smx.h +++ b/src/mc/mc_smx.h @@ -50,10 +50,10 @@ SG_BEGIN_DECL() * @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); diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 28152cbae4..5033b70e23 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -69,7 +69,7 @@ Transition State::getTransition() const } 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; diff --git a/src/mc/mc_state.h b/src/mc/mc_state.h index ba4ffa7f55..371d24843a 100644 --- a/src/mc/mc_state.h +++ b/src/mc/mc_state.h @@ -148,7 +148,7 @@ struct XBT_PRIVATE State { State(); std::size_t interleaveSize() const; - void interleave(smx_process_t process) + void interleave(smx_actor_t process) { this->processStates[process->pid].interleave(); } diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index a275943730..d81cd1520d 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -137,12 +137,12 @@ XBT_PRIVATE void __MSG_host_priv_free(msg_host_priv_t priv); 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 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(); diff --git a/src/msg/msg_process.cpp b/src/msg/msg_process.cpp index baf54c810d..17b02ef0d2 100644 --- a/src/msg/msg_process.cpp +++ b/src/msg/msg_process.cpp @@ -29,7 +29,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (proc * \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; @@ -55,10 +55,10 @@ void MSG_process_cleanup_from_SIMIX(smx_process_t smx_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 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( diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 7a53a102dd..1b46b96d40 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -35,7 +35,7 @@ ActorPtr Actor::createActor(const char* name, s4u::Host *host, double killTime, { // 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()); @@ -46,7 +46,7 @@ ActorPtr Actor::createActor(const char* name, s4u::Host *host, double killTime, { 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()); @@ -97,7 +97,7 @@ void Actor::kill(int pid) { } } -smx_process_t Actor::getImpl() { +smx_actor_t Actor::getImpl() { return pimpl_; } @@ -109,7 +109,7 @@ void Actor::kill() { 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 diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index e4d3d6c06a..0d3cad43ac 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -69,7 +69,7 @@ Host* Host::by_name_or_create(const char* name) } 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; diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index d071d520d9..465cfe4bdc 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -39,7 +39,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix, "Logging specific to SIMIX 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); @@ -47,7 +47,7 @@ smx_process_t SIMIX_process_ref(smx_process_t 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); @@ -60,7 +60,7 @@ void SIMIX_process_unref(smx_process_t 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(); @@ -71,7 +71,7 @@ smx_process_t SIMIX_process_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; } @@ -79,7 +79,7 @@ int SIMIX_process_has_pending_comms(smx_process_t process) { /** * \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); @@ -149,9 +149,9 @@ void SIMIX_process_cleanup(smx_process_t process) */ 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); } @@ -173,7 +173,7 @@ ActorImpl::~ActorImpl() void create_maestro(std::function 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++; @@ -210,7 +210,7 @@ void SIMIX_maestro_create(void (*code)(void*), void* data) * 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); @@ -237,7 +237,7 @@ void SIMIX_process_stop(smx_process_t arg) { * * \return the process created */ -smx_process_t SIMIX_process_create( +smx_actor_t SIMIX_process_create( const char *name, std::function code, void *data, @@ -245,9 +245,9 @@ smx_process_t SIMIX_process_create( 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); @@ -308,7 +308,7 @@ smx_process_t SIMIX_process_create( 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", @@ -324,12 +324,12 @@ smx_process_t SIMIX_process_create( 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. @@ -343,7 +343,7 @@ smx_process_t SIMIX_process_attach( 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); @@ -388,7 +388,7 @@ smx_process_t SIMIX_process_attach( 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); @@ -438,7 +438,7 @@ void SIMIX_process_runall() 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); } /** @@ -450,7 +450,7 @@ void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process) * \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)); @@ -507,7 +507,7 @@ void SIMIX_process_kill(smx_process_t process, smx_process_t issuer) { } 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); } } @@ -517,7 +517,7 @@ void SIMIX_process_kill(smx_process_t process, smx_process_t issuer) { * @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) @@ -542,7 +542,7 @@ void SIMIX_process_throw(smx_process_t process, xbt_errcat_t cat, int value, con 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); } } @@ -567,11 +567,11 @@ void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid) { * \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); } @@ -585,11 +585,11 @@ void SIMIX_process_killall(smx_process_t issuer, int reset_pid) 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); @@ -598,7 +598,7 @@ void SIMIX_process_change_host(smx_process_t process, sg_host_t dest) } -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); @@ -612,7 +612,7 @@ void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t proces /* 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()); @@ -635,11 +635,11 @@ smx_activity_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer } } -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); @@ -672,7 +672,7 @@ int SIMIX_process_count() 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; @@ -682,7 +682,7 @@ int SIMIX_process_get_PID(smx_process_t self) void* SIMIX_process_self_get_data() { - smx_process_t self = SIMIX_process_self(); + smx_actor_t self = SIMIX_process_self(); if (!self) { return nullptr; @@ -692,17 +692,17 @@ void* SIMIX_process_self_get_data() 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; } @@ -711,16 +711,16 @@ void SIMIX_process_set_data(smx_process_t process, void *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; @@ -728,17 +728,17 @@ smx_process_t SIMIX_process_get_by_name(const char* name) 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 @@ -777,7 +777,7 @@ static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activ 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(res)->ref(); @@ -798,7 +798,7 @@ void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration) 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; @@ -835,7 +835,7 @@ void SIMIX_process_sleep_destroy(smx_activity_t synchro) * * \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()); @@ -881,11 +881,11 @@ void SIMIX_process_exception_terminate(xbt_ex_t * e) 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; } @@ -900,9 +900,9 @@ xbt_dynar_t SIMIX_process_get_runnable() /** * \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 (PID)) return proc; @@ -912,15 +912,15 @@ smx_process_t SIMIX_process_from_PID(int PID) /** @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)) { @@ -929,7 +929,7 @@ void SIMIX_process_on_exit_runall(smx_process_t process) { } } -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) { @@ -946,15 +946,15 @@ void SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void * 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 @@ -980,7 +980,7 @@ smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer) 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; } @@ -1001,7 +1001,7 @@ void SIMIX_segment_index_set(smx_process_t proc, int 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, @@ -1016,20 +1016,20 @@ smx_process_t simcall_process_create(const char *name, 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 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); }); diff --git a/src/simix/ActorImpl.hpp b/src/simix/ActorImpl.hpp index 8ebe7db01f..9719f32d01 100644 --- a/src/simix/ActorImpl.hpp +++ b/src/simix/ActorImpl.hpp @@ -102,11 +102,11 @@ private: 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 code, void *data, @@ -114,33 +114,33 @@ XBT_PRIVATE smx_process_t SIMIX_process_create( 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() diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 7ceacadc7c..c50995f4e2 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -33,7 +33,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix); #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(), @@ -339,7 +339,7 @@ void simcall_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t d * * \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); } @@ -358,7 +358,7 @@ void simcall_process_killall(int reset_pid) * \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); } @@ -372,12 +372,12 @@ void simcall_process_cleanup(smx_process_t 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); } @@ -391,7 +391,7 @@ void simcall_process_join(smx_process_t process, double 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"); @@ -407,7 +407,7 @@ void simcall_process_suspend(smx_process_t process) * * \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); } @@ -425,24 +425,24 @@ int simcall_process_count() /** * \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)); } @@ -451,7 +451,7 @@ void simcall_process_set_data(smx_process_t process, void *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) @@ -467,7 +467,7 @@ void simcall_process_set_kill_time(smx_process_t process, double kill_time) * \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); } @@ -479,7 +479,7 @@ double simcall_process_get_kill_time(smx_process_t process) { * \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); } @@ -490,7 +490,7 @@ int simcall_process_is_suspended(smx_process_t 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); } @@ -499,7 +499,7 @@ xbt_dict_t simcall_process_get_properties(smx_process_t 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); } @@ -509,7 +509,7 @@ XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_pvoi * 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); } @@ -518,9 +518,9 @@ XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int aut * \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 @@ -551,7 +551,7 @@ smx_mailbox_t simcall_mbox_create(const char *name) 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); } @@ -559,7 +559,7 @@ void simcall_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t 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, @@ -589,7 +589,7 @@ void simcall_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_siz /** * \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 *), @@ -611,7 +611,7 @@ smx_activity_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox, doub /** * \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) @@ -635,7 +635,7 @@ void simcall_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buf /** * \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) @@ -1018,7 +1018,7 @@ const char *SIMIX_simcall_name(e_smx_simcall_t kind) { 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); diff --git a/src/simix/popping.cpp b/src/simix/popping.cpp index 22099f6305..ccbc8d8c21 100644 --- a/src/simix/popping.cpp +++ b/src/simix/popping.cpp @@ -30,7 +30,7 @@ void SIMIX_simcall_answer(smx_simcall_t 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; */ } } diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index 1acf3f05b9..d911ffccad 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -49,11 +49,11 @@ static inline void simcall_vm_restore__set__ind_vm(smx_simcall_t simcall, sg_hos simgrid::simix::marshal(simcall->args[0], arg); } -static inline smx_process_t simcall_process_kill__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_kill__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_kill__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline int simcall_process_killall__get__reset_pid(smx_simcall_t simcall) { @@ -63,32 +63,32 @@ static inline void simcall_process_killall__set__reset_pid(smx_simcall_t simcall simgrid::simix::marshal(simcall->args[0], arg); } -static inline smx_process_t simcall_process_cleanup__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_cleanup__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } -static inline smx_process_t simcall_process_suspend__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_suspend__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_suspend__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_suspend__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } -static inline smx_process_t simcall_process_resume__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_resume__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_resume__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_resume__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } -static inline smx_process_t simcall_process_set_host__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_set_host__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_set_host__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_set_host__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline sg_host_t simcall_process_set_host__get__dest(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[1]); @@ -97,11 +97,11 @@ static inline void simcall_process_set_host__set__dest(smx_simcall_t simcall, sg simgrid::simix::marshal(simcall->args[1], arg); } -static inline smx_process_t simcall_process_is_suspended__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_is_suspended__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_is_suspended__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_is_suspended__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline int simcall_process_is_suspended__get__result(smx_simcall_t simcall){ return simgrid::simix::unmarshal(simcall->result); @@ -110,11 +110,11 @@ static inline void simcall_process_is_suspended__set__result(smx_simcall_t simca simgrid::simix::marshal(simcall->result, result); } -static inline smx_process_t simcall_process_join__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_join__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_join__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_join__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline double simcall_process_join__get__timeout(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[1]); @@ -268,11 +268,11 @@ static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, in simgrid::simix::marshal(simcall->result, result); } -static inline smx_process_t simcall_process_on_exit__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_on_exit__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(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(simcall->args[1]); @@ -287,11 +287,11 @@ static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, voi simgrid::simix::marshal(simcall->args[2], arg); } -static inline smx_process_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(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(simcall->args[0], arg); } static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[1]); @@ -300,17 +300,17 @@ static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simca simgrid::simix::marshal(simcall->args[1], arg); } -static inline smx_process_t simcall_process_restart__get__process(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } -static inline smx_process_t simcall_process_restart__get__result(smx_simcall_t simcall){ - return simgrid::simix::unmarshal(simcall->result); +static inline smx_actor_t simcall_process_restart__get__result(smx_simcall_t simcall){ + return simgrid::simix::unmarshal(simcall->result); } -static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_process_t result){ - simgrid::simix::marshal(simcall->result, result); +static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_actor_t result){ + simgrid::simix::marshal(simcall->result, result); } static inline const char* simcall_mbox_create__get__name(smx_simcall_t simcall) { @@ -332,11 +332,11 @@ static inline smx_mailbox_t simcall_mbox_set_receiver__get__mbox(smx_simcall_t s static inline void simcall_mbox_set_receiver__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg) { simgrid::simix::marshal(simcall->args[0], arg); } -static inline smx_process_t simcall_mbox_set_receiver__get__receiver(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[1]); +static inline smx_actor_t simcall_mbox_set_receiver__get__receiver(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[1]); } -static inline void simcall_mbox_set_receiver__set__receiver(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[1], arg); +static inline void simcall_mbox_set_receiver__set__receiver(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[1], arg); } static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall) { @@ -382,11 +382,11 @@ static inline void simcall_comm_iprobe__set__result(smx_simcall_t simcall, smx_a simgrid::simix::marshal(simcall->result, result); } -static inline smx_process_t simcall_comm_send__get__sender(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_comm_send__get__sender(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline smx_mailbox_t simcall_comm_send__get__mbox(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[1]); @@ -443,11 +443,11 @@ static inline void simcall_comm_send__set__timeout(smx_simcall_t simcall, double simgrid::simix::marshal(simcall->args[9], arg); } -static inline smx_process_t simcall_comm_isend__get__sender(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_comm_isend__get__sender(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline smx_mailbox_t simcall_comm_isend__get__mbox(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[1]); @@ -516,11 +516,11 @@ static inline void simcall_comm_isend__set__result(smx_simcall_t simcall, smx_ac simgrid::simix::marshal(simcall->result, result); } -static inline smx_process_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline smx_mailbox_t simcall_comm_recv__get__mbox(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[1]); @@ -571,11 +571,11 @@ static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double ar simgrid::simix::marshal(simcall->args[8], arg); } -static inline smx_process_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall) { - return simgrid::simix::unmarshal(simcall->args[0]); +static inline smx_actor_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall) { + return simgrid::simix::unmarshal(simcall->args[0]); } -static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_process_t arg) { - simgrid::simix::marshal(simcall->args[0], arg); +static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_actor_t arg) { + simgrid::simix::marshal(simcall->args[0], arg); } static inline smx_mailbox_t simcall_comm_irecv__get__mbox(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[1]); @@ -1151,21 +1151,21 @@ XBT_PRIVATE void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t ind_ 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); diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index 9dee59693c..bebfa0ea67 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -23,7 +23,7 @@ template 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(), @@ -65,10 +65,10 @@ inline static void simcall_BODY_vm_restore(sg_host_t ind_vm) { return simcall(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(SIMCALL_PROCESS_KILL, process); + return simcall(SIMCALL_PROCESS_KILL, process); } inline static void simcall_BODY_process_killall(int reset_pid) { @@ -77,40 +77,40 @@ inline static void simcall_BODY_process_killall(int reset_pid) { return simcall(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(SIMCALL_PROCESS_CLEANUP, process); + return simcall(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(SIMCALL_PROCESS_SUSPEND, process); + return simcall(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(SIMCALL_PROCESS_RESUME, process); + return simcall(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(SIMCALL_PROCESS_SET_HOST, process, dest); + return simcall(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(SIMCALL_PROCESS_IS_SUSPENDED, process); + return simcall(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(SIMCALL_PROCESS_JOIN, process, timeout); + return simcall(SIMCALL_PROCESS_JOIN, process, timeout); } inline static int simcall_BODY_process_sleep(double duration) { @@ -155,22 +155,22 @@ inline static int simcall_BODY_execution_wait(smx_activity_t execution) { return simcall(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(SIMCALL_PROCESS_ON_EXIT, process, fun, data); + return simcall(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(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart); + return simcall(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(SIMCALL_PROCESS_RESTART, process); + return simcall(SIMCALL_PROCESS_RESTART, process); } inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) { @@ -179,10 +179,10 @@ inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) { return simcall(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(SIMCALL_MBOX_SET_RECEIVER, mbox, receiver); + return simcall(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) { @@ -191,28 +191,28 @@ inline static smx_activity_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int ty return simcall(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(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); + return simcall(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(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); + return simcall(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(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); + return simcall(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(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); + return simcall(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) { diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index e98ae72455..68fb148f87 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -129,7 +129,7 @@ case SIMCALL_VM_RESTORE: break; case SIMCALL_PROCESS_KILL: - simcall_HANDLER_process_kill(simcall, simgrid::simix::unmarshal(simcall->args[0])); + simcall_HANDLER_process_kill(simcall, simgrid::simix::unmarshal(simcall->args[0])); SIMIX_simcall_answer(simcall); break; @@ -139,31 +139,31 @@ case SIMCALL_PROCESS_KILLALL: break; case SIMCALL_PROCESS_CLEANUP: - SIMIX_process_cleanup(simgrid::simix::unmarshal(simcall->args[0])); + SIMIX_process_cleanup(simgrid::simix::unmarshal(simcall->args[0])); SIMIX_simcall_answer(simcall); break; case SIMCALL_PROCESS_SUSPEND: - simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal(simcall->args[0])); + simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal(simcall->args[0])); break; case SIMCALL_PROCESS_RESUME: - simcall_HANDLER_process_resume(simcall, simgrid::simix::unmarshal(simcall->args[0])); + simcall_HANDLER_process_resume(simcall, simgrid::simix::unmarshal(simcall->args[0])); SIMIX_simcall_answer(simcall); break; case SIMCALL_PROCESS_SET_HOST: - simcall_HANDLER_process_set_host(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); + simcall_HANDLER_process_set_host(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); SIMIX_simcall_answer(simcall); break; case SIMCALL_PROCESS_IS_SUSPENDED: - simgrid::simix::marshal(simcall->result, SIMIX_process_is_suspended(simgrid::simix::unmarshal(simcall->args[0]))); + simgrid::simix::marshal(simcall->result, SIMIX_process_is_suspended(simgrid::simix::unmarshal(simcall->args[0]))); SIMIX_simcall_answer(simcall); break; case SIMCALL_PROCESS_JOIN: - simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); + simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); break; case SIMCALL_PROCESS_SLEEP: @@ -200,17 +200,17 @@ case SIMCALL_EXECUTION_WAIT: break; case SIMCALL_PROCESS_ON_EXIT: - SIMIX_process_on_exit(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2])); + SIMIX_process_on_exit(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2])); SIMIX_simcall_answer(simcall); break; case SIMCALL_PROCESS_AUTO_RESTART_SET: - SIMIX_process_auto_restart_set(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); + SIMIX_process_auto_restart_set(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); SIMIX_simcall_answer(simcall); break; case SIMCALL_PROCESS_RESTART: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal(simcall->args[0]))); + simgrid::simix::marshal(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal(simcall->args[0]))); SIMIX_simcall_answer(simcall); break; @@ -220,7 +220,7 @@ case SIMCALL_MBOX_CREATE: break; case SIMCALL_MBOX_SET_RECEIVER: - SIMIX_mbox_set_receiver(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); + SIMIX_mbox_set_receiver(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); SIMIX_simcall_answer(simcall); break; @@ -230,20 +230,20 @@ case SIMCALL_COMM_IPROBE: break; case SIMCALL_COMM_SEND: - simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9])); + simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9])); break; case SIMCALL_COMM_ISEND: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9]), simgrid::simix::unmarshal(simcall->args[10]))); + simgrid::simix::marshal(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8]), simgrid::simix::unmarshal(simcall->args[9]), simgrid::simix::unmarshal(simcall->args[10]))); SIMIX_simcall_answer(simcall); break; case SIMCALL_COMM_RECV: - simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8])); + simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]), simgrid::simix::unmarshal(simcall->args[8])); break; case SIMCALL_COMM_IRECV: - simgrid::simix::marshal(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]))); + simgrid::simix::marshal(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1]), simgrid::simix::unmarshal(simcall->args[2]), simgrid::simix::unmarshal(simcall->args[3]), simgrid::simix::unmarshal(simcall->args[4]), simgrid::simix::unmarshal(simcall->args[5]), simgrid::simix::unmarshal(simcall->args[6]), simgrid::simix::unmarshal(simcall->args[7]))); SIMIX_simcall_answer(simcall); break; diff --git a/src/simix/popping_private.h b/src/simix/popping_private.h index c1f47e0832..542adbff4d 100644 --- a/src/simix/popping_private.h +++ b/src/simix/popping_private.h @@ -44,7 +44,7 @@ union u_smx_scalar { */ 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]; diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index a54af013c9..f2b8b0fca4 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -42,14 +42,14 @@ void vm_shutdown(sg_host_t ind_vm); 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); @@ -59,18 +59,18 @@ void execution_set_priority(smx_activity_t execution, double priority) 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]]; diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index 67ae8fc7f9..eff39b7a07 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -351,7 +351,7 @@ if __name__ == '__main__': template 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(), diff --git a/src/simix/smx_deployment.cpp b/src/simix/smx_deployment.cpp index b688ebd41c..b34c5bb805 100644 --- a/src/simix/smx_deployment.cpp +++ b/src/simix/smx_deployment.cpp @@ -94,12 +94,12 @@ void SIMIX_function_register_default(xbt_main_func_t code) } /** - * \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) { diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 90a9c486c0..0a8a05c46b 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -155,7 +155,7 @@ double SIMIX_timer_next() 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); } @@ -197,8 +197,8 @@ void SIMIX_global_init(int *argc, char **argv) simix_global = std::unique_ptr(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; @@ -334,7 +334,7 @@ double SIMIX_get_clock() 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; @@ -425,7 +425,7 @@ void SIMIX_run() } 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)); @@ -634,7 +634,7 @@ void SIMIX_display_process_status() 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); diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 01d227f9c8..6f932c5bfa 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -69,7 +69,7 @@ void SIMIX_host_on(sg_host_t h) } /** @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); @@ -81,7 +81,7 @@ void SIMIX_host_off(sg_host_t h, smx_process_t issuer) /* 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", @@ -109,7 +109,7 @@ void SIMIX_host_destroy(void *h) 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()); @@ -130,7 +130,7 @@ void SIMIX_host_destroy(void *h) 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; } @@ -207,7 +207,7 @@ smx_activity_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char 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 */ diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 66d6d4d829..4fbadfb77c 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -40,7 +40,7 @@ XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, 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, @@ -59,17 +59,17 @@ XBT_PRIVATE sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host) 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); diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index 9f15b73421..1485d5903a 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -162,7 +162,7 @@ sg_size_t simcall_HANDLER_file_get_size(smx_simcall_t simcall, smx_file_t fd) 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); @@ -173,7 +173,7 @@ sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd) 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); @@ -185,7 +185,7 @@ xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd) 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); @@ -196,7 +196,7 @@ int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t 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); @@ -207,7 +207,7 @@ int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t file, const char 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); @@ -222,7 +222,7 @@ sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall, smx_stora 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); } @@ -232,7 +232,7 @@ sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall, smx_stora 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); } diff --git a/src/simix/smx_io_private.h b/src/simix/smx_io_private.h index c5fd3b8c8d..d518efd37d 100644 --- a/src/simix/smx_io_private.h +++ b/src/simix/smx_io_private.h @@ -29,14 +29,14 @@ XBT_PRIVATE smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_ho 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); diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index a5ff8a7263..e25d531619 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -72,7 +72,7 @@ smx_mailbox_t SIMIX_mbox_get_by_name(const char *name) * \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; } @@ -150,7 +150,7 @@ static smx_activity_t _find_matching_comm(std::deque *deque, e_s /******************************************************************************/ /* 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), @@ -162,7 +162,7 @@ XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_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), @@ -238,7 +238,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx 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), @@ -249,7 +249,7 @@ XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_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), @@ -258,7 +258,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx 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) @@ -342,7 +342,7 @@ smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t 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); diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index c2a9aa683a..9c155946ec 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -48,13 +48,13 @@ XBT_PRIVATE smx_mailbox_t SIMIX_mbox_create(const char *name); 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 diff --git a/src/simix/smx_private.h b/src/simix/smx_private.h index 0c08be8ac6..ab1a6dad23 100644 --- a/src/simix/smx_private.h +++ b/src/simix/smx_private.h @@ -49,7 +49,7 @@ public: 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 registered_functions; @@ -80,7 +80,7 @@ XBT_PUBLIC(void) SIMIX_clean(); /** @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; \ diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 0ec524fa60..782547113b 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -16,8 +16,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_synchro, simix, "SIMIX Synchronization (mu 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 *********************************/ @@ -33,7 +33,7 @@ static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout) 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) { @@ -113,7 +113,7 @@ Mutex::~Mutex() 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 */ @@ -140,7 +140,7 @@ void Mutex::lock(smx_process_t issuer) * \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) { @@ -160,7 +160,7 @@ bool Mutex::try_lock(smx_process_t issuer) * 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); @@ -171,7 +171,7 @@ void Mutex::unlock(smx_process_t 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; @@ -251,7 +251,7 @@ smx_cond_t SIMIX_cond_init() 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(); @@ -265,7 +265,7 @@ void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, 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(); @@ -273,7 +273,7 @@ void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, 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; @@ -304,7 +304,7 @@ static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout, 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; @@ -312,7 +312,7 @@ void SIMIX_cond_signal(smx_cond_t cond) /* 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; @@ -426,10 +426,10 @@ void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem){ 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); @@ -458,7 +458,7 @@ int SIMIX_sem_get_capacity(smx_sem_t sem) 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); diff --git a/src/simix/smx_synchro_private.h b/src/simix/smx_synchro_private.h index 7faa04904f..06bd94b76f 100644 --- a/src/simix/smx_synchro_private.h +++ b/src/simix/smx_synchro_private.h @@ -26,12 +26,12 @@ public: 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; @@ -76,7 +76,7 @@ typedef struct s_smx_sem { } 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); diff --git a/src/simix/smx_vm.cpp b/src/simix/smx_vm.cpp index 25cf08746a..3e50acab7f 100644 --- a/src/simix/smx_vm.cpp +++ b/src/simix/smx_vm.cpp @@ -134,7 +134,7 @@ void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst 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); } @@ -166,7 +166,7 @@ void SIMIX_vm_set_bound(sg_host_t host, double bound) * * @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); @@ -178,7 +178,7 @@ void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer) /* 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); @@ -206,7 +206,7 @@ void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t ind_vm) * * @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); @@ -218,7 +218,7 @@ void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer) /* 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); @@ -238,7 +238,7 @@ void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t ind_vm) * * @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); @@ -251,7 +251,7 @@ void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer) /* 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); @@ -270,7 +270,7 @@ void simcall_HANDLER_vm_save(smx_simcall_t simcall, sg_host_t ind_vm) * * @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); @@ -282,7 +282,7 @@ void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer) /* 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); @@ -302,7 +302,7 @@ void simcall_HANDLER_vm_restore(smx_simcall_t simcall, sg_host_t ind_vm) * * @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); @@ -312,7 +312,7 @@ void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer) 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); diff --git a/src/smpi/private.h b/src/smpi/private.h index 3f9c284bba..23fb524a9b 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -715,10 +715,10 @@ extern XBT_PRIVATE smpi_privatisation_region_t smpi_privatisation_regions; 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; } diff --git a/src/smpi/smpi_comm.cpp b/src/smpi/smpi_comm.cpp index 9029fde22e..22aab8e289 100644 --- a/src/smpi/smpi_comm.cpp +++ b/src/smpi/smpi_comm.cpp @@ -373,7 +373,7 @@ void smpi_comm_init_smp(MPI_Comm comm){ 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; diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index ad0791ecc4..6c827c1105 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -98,7 +98,7 @@ void smpi_process_init(int *argc, char ***argv) { 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"); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index b6b2ec26df..19d8243883 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -582,7 +582,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process) std::function 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]);