static int master(int argc, char *argv[])
{
- m_process_t bob = NULL;
+ msg_process_t bob = NULL;
XBT_INFO("Hello!");
bob = MSG_process_create("slave", slave, NULL, MSG_get_host_by_name("bob"));
xbt_mutex_t mutex = NULL;
xbt_cond_t cond = NULL;
-static m_process_t process_to_migrate = NULL;
+static msg_process_t process_to_migrate = NULL;
/** The guy we will move from host to host. It move alone and then is moved by policeman back */
static int emigrant(int argc, char *argv[])
resumes it 10 seconds later. */
static int dream_master(int argc, char *argv[])
{
- m_process_t lazy = NULL;
+ msg_process_t lazy = NULL;
XBT_INFO("Let's create a lazy guy.");
lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
structure, but always use the provided API to interact with
processes.
*/
-typedef struct s_smx_process *m_process_t;
+typedef struct s_smx_process *msg_process_t;
+
+/* Compatibility typedefs */
+typedef msg_process_t m_process_t;
#ifdef MSG_USE_DEPRECATED
typedef int m_channel_t;
XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar(void);
/************************** Process handling *********************************/
-XBT_PUBLIC(m_process_t) MSG_process_create(const char *name,
+XBT_PUBLIC(msg_process_t) MSG_process_create(const char *name,
xbt_main_func_t code,
void *data, m_host_t host);
-XBT_PUBLIC(m_process_t) MSG_process_create_with_arguments(const char *name,
+XBT_PUBLIC(msg_process_t) MSG_process_create_with_arguments(const char *name,
xbt_main_func_t
code, void *data,
m_host_t host,
int argc,
char **argv);
-XBT_PUBLIC(m_process_t) MSG_process_create_with_environment(const char
+XBT_PUBLIC(msg_process_t) MSG_process_create_with_environment(const char
*name,
xbt_main_func_t
code,
char **argv,
xbt_dict_t
properties);
-XBT_PUBLIC(void) MSG_process_kill(m_process_t process);
+XBT_PUBLIC(void) MSG_process_kill(msg_process_t process);
XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs);
-XBT_PUBLIC(MSG_error_t) MSG_process_migrate(m_process_t process, m_host_t host);
+XBT_PUBLIC(MSG_error_t) MSG_process_migrate(msg_process_t process, m_host_t host);
-XBT_PUBLIC(void *) MSG_process_get_data(m_process_t process);
-XBT_PUBLIC(MSG_error_t) MSG_process_set_data(m_process_t process,
+XBT_PUBLIC(void *) MSG_process_get_data(msg_process_t process);
+XBT_PUBLIC(MSG_error_t) MSG_process_set_data(msg_process_t process,
void *data);
XBT_PUBLIC(void) MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
-XBT_PUBLIC(m_host_t) MSG_process_get_host(m_process_t process);
-XBT_PUBLIC(m_process_t) MSG_process_from_PID(int PID);
-XBT_PUBLIC(int) MSG_process_get_PID(m_process_t process);
-XBT_PUBLIC(int) MSG_process_get_PPID(m_process_t process);
-XBT_PUBLIC(const char *) MSG_process_get_name(m_process_t process);
+XBT_PUBLIC(m_host_t) MSG_process_get_host(msg_process_t process);
+XBT_PUBLIC(msg_process_t) MSG_process_from_PID(int PID);
+XBT_PUBLIC(int) MSG_process_get_PID(msg_process_t process);
+XBT_PUBLIC(int) MSG_process_get_PPID(msg_process_t process);
+XBT_PUBLIC(const char *) MSG_process_get_name(msg_process_t process);
XBT_PUBLIC(int) MSG_process_self_PID(void);
XBT_PUBLIC(int) MSG_process_self_PPID(void);
-XBT_PUBLIC(m_process_t) MSG_process_self(void);
+XBT_PUBLIC(msg_process_t) MSG_process_self(void);
XBT_PUBLIC(xbt_dynar_t) MSG_processes_as_dynar(void);
-XBT_PUBLIC(MSG_error_t) MSG_process_set_kill_time(m_process_t process, double kill_time);
+XBT_PUBLIC(MSG_error_t) MSG_process_set_kill_time(msg_process_t process, double kill_time);
/*property handlers*/
-XBT_PUBLIC(xbt_dict_t) MSG_process_get_properties(m_process_t process);
-XBT_PUBLIC(const char *) MSG_process_get_property_value(m_process_t
+XBT_PUBLIC(xbt_dict_t) MSG_process_get_properties(msg_process_t process);
+XBT_PUBLIC(const char *) MSG_process_get_property_value(msg_process_t
process,
const char *name);
-XBT_PUBLIC(MSG_error_t) MSG_process_suspend(m_process_t process);
-XBT_PUBLIC(MSG_error_t) MSG_process_resume(m_process_t process);
-XBT_PUBLIC(int) MSG_process_is_suspended(m_process_t process);
+XBT_PUBLIC(MSG_error_t) MSG_process_suspend(msg_process_t process);
+XBT_PUBLIC(MSG_error_t) MSG_process_resume(msg_process_t process);
+XBT_PUBLIC(int) MSG_process_is_suspended(msg_process_t process);
XBT_PUBLIC(void) MSG_process_on_exit(int_f_pvoid_t fun, void *data);
-XBT_PUBLIC(void) MSG_process_auto_restart_set(m_process_t process, int auto_restart);
+XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart);
/************************** Task handling ************************************/
XBT_PUBLIC(m_task_t) MSG_task_create(const char *name,
XBT_PUBLIC(void *) MSG_task_get_data(m_task_t task);
XBT_PUBLIC(void) MSG_task_set_data(m_task_t task, void *data);
XBT_PUBLIC(void) MSG_task_set_copy_callback(void (*callback) (
- m_task_t task, m_process_t src, m_process_t dst));
-XBT_PUBLIC(m_process_t) MSG_task_get_sender(m_task_t task);
+ m_task_t task, msg_process_t src, msg_process_t dst));
+XBT_PUBLIC(msg_process_t) MSG_task_get_sender(m_task_t task);
XBT_PUBLIC(m_host_t) MSG_task_get_source(m_task_t task);
XBT_PUBLIC(const char *) MSG_task_get_name(m_task_t task);
XBT_PUBLIC(void) MSG_task_set_name(m_task_t task, const char *name);
XBT_PUBLIC(int) MSG_vm_is_suspended(msg_vm_t);
XBT_PUBLIC(int) MSG_vm_is_running(msg_vm_t);
-XBT_PUBLIC(void) MSG_vm_bind(msg_vm_t vm, m_process_t process);
-XBT_PUBLIC(void) MSG_vm_unbind(msg_vm_t vm, m_process_t process); // simple wrapper over process_kill
+XBT_PUBLIC(void) MSG_vm_bind(msg_vm_t vm, msg_process_t process);
+XBT_PUBLIC(void) MSG_vm_unbind(msg_vm_t vm, msg_process_t process); // simple wrapper over process_kill
XBT_PUBLIC(void) MSG_vm_migrate(msg_vm_t vm, m_host_t destination);
/* ****************************************************************************************** */
/* Used only by the bindings -- unclean pimple, please ignore if you're not writing a binding */
-XBT_PUBLIC(smx_context_t) MSG_process_get_smx_ctx(m_process_t process);
+XBT_PUBLIC(smx_context_t) MSG_process_get_smx_ctx(msg_process_t process);
SG_END_DECL()
#endif
* \param src_process the sender
* \param dst_process the receiver
*/
-static void task_copy_callback(m_task_t task, m_process_t src_process,
- m_process_t dst_process) {
+static void task_copy_callback(m_task_t task, msg_process_t src_process,
+ msg_process_t dst_process) {
lua_State* src = MSG_process_get_data(src_process);
lua_State* dst = MSG_process_get_data(dst_process);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
-char *instr_process_id (m_process_t proc, char *str, int len)
+char *instr_process_id (msg_process_t proc, char *str, int len)
{
return instr_process_id_2 (proc->name, proc->pid, str, len);//MSG_process_get_name(proc), MSG_process_get_PID(proc), str, len);
}
}
/*
- * Instrumentation functions to trace MSG processes (m_process_t)
+ * Instrumentation functions to trace MSG processes (msg_process_t)
*/
-void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host, m_host_t new_host)
+void TRACE_msg_process_change_host(msg_process_t process, m_host_t old_host, m_host_t new_host)
{
if (TRACE_msg_process_is_enabled()){
static long long int counter = 0;
}
}
-void TRACE_msg_process_kill(m_process_t process)
+void TRACE_msg_process_kill(msg_process_t process)
{
if (TRACE_msg_process_is_enabled()){
int len = INSTR_DEFAULT_STR_SIZE;
}
}
-void TRACE_msg_process_suspend(m_process_t process)
+void TRACE_msg_process_suspend(msg_process_t process)
{
if (TRACE_msg_process_is_enabled()){
int len = INSTR_DEFAULT_STR_SIZE;
}
}
-void TRACE_msg_process_resume(m_process_t process)
+void TRACE_msg_process_resume(msg_process_t process)
{
if (TRACE_msg_process_is_enabled()){
int len = INSTR_DEFAULT_STR_SIZE;
}
}
-void TRACE_msg_process_sleep_in(m_process_t process)
+void TRACE_msg_process_sleep_in(msg_process_t process)
{
if (TRACE_msg_process_is_enabled()){
int len = INSTR_DEFAULT_STR_SIZE;
}
}
-void TRACE_msg_process_sleep_out(m_process_t process)
+void TRACE_msg_process_sleep_out(msg_process_t process)
{
if (TRACE_msg_process_is_enabled()){
int len = INSTR_DEFAULT_STR_SIZE;
}
}
-void TRACE_msg_process_end(m_process_t process)
+void TRACE_msg_process_end(msg_process_t process)
{
if (TRACE_msg_process_is_enabled()) {
int len = INSTR_DEFAULT_STR_SIZE;
void TRACE_msg_task_put_end(void);
/* declaration of instrumentation functions from msg_process_instr.c */
-char *instr_process_id (m_process_t proc, char *str, int len);
+char *instr_process_id (msg_process_t proc, char *str, int len);
char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len);
-void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host,
+void TRACE_msg_process_change_host(msg_process_t process, m_host_t old_host,
m_host_t new_host);
void TRACE_msg_process_create (const char *process_name, int process_pid, m_host_t host);
-void TRACE_msg_process_kill(m_process_t process);
-void TRACE_msg_process_suspend(m_process_t process);
-void TRACE_msg_process_resume(m_process_t process);
-void TRACE_msg_process_sleep_in(m_process_t process); //called from msg/gos.c
-void TRACE_msg_process_sleep_out(m_process_t process);
-void TRACE_msg_process_end(m_process_t process);
+void TRACE_msg_process_kill(msg_process_t process);
+void TRACE_msg_process_suspend(msg_process_t process);
+void TRACE_msg_process_resume(msg_process_t process);
+void TRACE_msg_process_sleep_in(msg_process_t process); //called from msg/gos.c
+void TRACE_msg_process_sleep_out(msg_process_t process);
+void TRACE_msg_process_end(msg_process_t process);
/* from surf_instr.c */
void TRACE_surf_alloc(void);
{
xbt_ex_t e;
simdata_task_t simdata = task->simdata;
- m_process_t self = SIMIX_process_self();
+ msg_process_t self = SIMIX_process_self();
simdata_process_t p_simdata = SIMIX_process_self_get_data(self);
e_smx_state_t comp_state;
MSG_error_t status = MSG_OK;
MSG_error_t MSG_process_sleep(double nb_sec)
{
MSG_error_t status = MSG_OK;
- /*m_process_t proc = MSG_process_self();*/
+ /*msg_process_t proc = MSG_process_self();*/
#ifdef HAVE_TRACING
TRACE_msg_process_sleep_in(MSG_process_self());
void *match_data)
{
simdata_task_t t_simdata = NULL;
- m_process_t process = MSG_process_self();
+ msg_process_t process = MSG_process_self();
msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
/* FIXME: these functions are not traceable */
void MSG_task_dsend(m_task_t task, const char *alias, void_f_pvoid_t cleanup)
{
simdata_task_t t_simdata = NULL;
- m_process_t process = MSG_process_self();
+ msg_process_t process = MSG_process_self();
msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
/* FIXME: these functions are not traceable */
xbt_ex_t e;
MSG_error_t ret = MSG_OK;
simdata_task_t t_simdata = NULL;
- m_process_t process = MSG_process_self();
+ msg_process_t process = MSG_process_self();
simdata_process_t p_simdata = SIMIX_process_self_get_data(process);
#ifdef HAVE_TRACING
smx_action_t comm; /* SIMIX modeling of communication */
double message_size; /* Data size */
double computation_amount; /* Computation size */
- m_process_t sender;
- m_process_t receiver;
+ msg_process_t sender;
+ msg_process_t receiver;
m_host_t source;
double priority;
double rate;
int PID;
int session;
unsigned long int sent_msg; /* Total amount of messages sent during the simulation */
- void (*task_copy_callback) (m_task_t task, m_process_t src, m_process_t dst);
+ void (*task_copy_callback) (m_task_t task, msg_process_t src, msg_process_t dst);
void_f_pvoid_t process_data_cleanup;
xbt_swag_t vms;
} s_MSG_Global_t, *MSG_Global_t;
* the concept of <em>process</em> is at the heart of the
* simulator. A process may be defined as a <em>code</em>, with
* some <em>private data</em>, executing in a <em>location</em>.
- * \see m_process_t
+ * \see msg_process_t
*/
/******************************** Process ************************************/
xbt_dict_t properties, int auto_restart)
{
m_host_t host = MSG_get_host_by_name(hostname);
- m_process_t p = MSG_process_create_with_environment(name, code, data,
+ msg_process_t p = MSG_process_create_with_environment(name, code, data,
host, argc, argv,
properties);
if (p) {
MSG_process_set_kill_time(p,kill_time);
MSG_process_auto_restart_set(p,auto_restart);
}
- *((m_process_t*) process) = p;
+ *((msg_process_t*) process) = p;
}
/** \ingroup m_process_management
- * \brief Creates and runs a new #m_process_t.
+ * \brief Creates and runs a new #msg_process_t.
*
* Does exactly the same as #MSG_process_create_with_arguments but without
providing standard arguments (\a argc, \a argv, \a start_time, \a kill_time).
* \sa MSG_process_create_with_arguments
*/
-m_process_t MSG_process_create(const char *name,
+msg_process_t MSG_process_create(const char *name,
xbt_main_func_t code, void *data,
m_host_t host)
{
}
/** \ingroup m_process_management
- * \brief Creates and runs a new #m_process_t.
+ * \brief Creates and runs a new #msg_process_t.
- * A constructor for #m_process_t taking four arguments and returning the
+ * A constructor for #msg_process_t taking four arguments and returning the
* corresponding object. The structure (and the corresponding thread) is
* created, and put in the list of ready process.
* \param name a name for the object. It is for user-level information
and can be NULL.
* \param code is a function describing the behavior of the process. It
should then only use functions described in \ref
- m_process_management (to create a new #m_process_t for example),
+ m_process_management (to create a new #msg_process_t for example),
in \ref m_host_management (only the read-only functions i.e. whose
name contains the word get), in \ref m_task_management (to create
or destroy some #m_task_t for example) and in \ref
* \param host the location where the new process is executed.
* \param argc first argument passed to \a code
* \param argv second argument passed to \a code
- * \see m_process_t
+ * \see msg_process_t
* \return The new corresponding object.
*/
-m_process_t MSG_process_create_with_arguments(const char *name,
+msg_process_t MSG_process_create_with_arguments(const char *name,
xbt_main_func_t code,
void *data, m_host_t host,
int argc, char **argv)
}
/** \ingroup m_process_management
- * \brief Creates and runs a new #m_process_t.
+ * \brief Creates and runs a new #msg_process_t.
- * A constructor for #m_process_t taking four arguments and returning the
+ * A constructor for #msg_process_t taking four arguments and returning the
* corresponding object. The structure (and the corresponding thread) is
* created, and put in the list of ready process.
* \param name a name for the object. It is for user-level information
and can be NULL.
* \param code is a function describing the behavior of the process. It
should then only use functions described in \ref
- m_process_management (to create a new #m_process_t for example),
+ m_process_management (to create a new #msg_process_t for example),
in \ref m_host_management (only the read-only functions i.e. whose
name contains the word get), in \ref m_task_management (to create
or destroy some #m_task_t for example) and in \ref
* \param argc first argument passed to \a code
* \param argv second argument passed to \a code
* \param properties list a properties defined for this process
- * \see m_process_t
+ * \see msg_process_t
* \return The new corresponding object.
*/
-m_process_t MSG_process_create_with_environment(const char *name,
+msg_process_t MSG_process_create_with_environment(const char *name,
xbt_main_func_t code,
void *data, m_host_t host,
int argc, char **argv,
{
xbt_assert(code != NULL && host != NULL, "Invalid parameters");
simdata_process_t simdata = xbt_new0(s_simdata_process_t, 1);
- m_process_t process;
+ msg_process_t process;
/* Simulator data for MSG */
simdata->PID = msg_global->PID++;
*
* This function simply kills a \a process... scary isn't it ? :)
*/
-void MSG_process_kill(m_process_t process)
+void MSG_process_kill(msg_process_t process)
{
// /* FIXME: why do we only cancel communication actions? is this useful? */
// simdata_process_t p_simdata = simcall_process_get_data(process);
* This function checks whether \a process and \a host are valid pointers
and change the value of the #m_host_t on which \a process is running.
*/
-MSG_error_t MSG_process_migrate(m_process_t process, m_host_t host)
+MSG_error_t MSG_process_migrate(msg_process_t process, m_host_t host)
{
simdata_process_t simdata = simcall_process_get_data(process);
simdata->m_host = host;
* This function checks whether \a process is a valid pointer or not
and returns the user data associated to this process.
*/
-void* MSG_process_get_data(m_process_t process)
+void* MSG_process_get_data(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
* This function checks whether \a process is a valid pointer or not
and sets the user data associated to this process.
*/
-MSG_error_t MSG_process_set_data(m_process_t process, void *data)
+MSG_error_t MSG_process_set_data(msg_process_t process, void *data)
{
xbt_assert(process != NULL, "Invalid parameter");
* \return the m_host_t corresponding to the location on which \a
* process is running.
*/
-m_host_t MSG_process_get_host(m_process_t process)
+m_host_t MSG_process_get_host(msg_process_t process)
{
simdata_process_t simdata;
if (process == NULL) {
/** \ingroup m_process_management
*
- * \brief Return a #m_process_t given its PID.
+ * \brief Return a #msg_process_t given its PID.
*
- * This function search in the list of all the created m_process_t for a m_process_t
+ * This function search in the list of all the created msg_process_t for a msg_process_t
whose PID is equal to \a PID. If no host is found, \c NULL is returned.
Note that the PID are uniq in the whole simulation, not only on a given host.
*/
-m_process_t MSG_process_from_PID(int PID)
+msg_process_t MSG_process_from_PID(int PID)
{
return SIMIX_process_from_PID(PID);
}
* \param process a process
* \param kill_time the time when the process is killed.
*/
-MSG_error_t MSG_process_set_kill_time(m_process_t process, double kill_time)
+MSG_error_t MSG_process_set_kill_time(msg_process_t process, double kill_time)
{
simcall_process_set_kill_time(process,kill_time);
return MSG_OK;
* This function checks whether \a process is a valid pointer or not
and return its PID (or 0 in case of problem).
*/
-int MSG_process_get_PID(m_process_t process)
+int MSG_process_get_PID(msg_process_t process)
{
/* Do not raise an exception here: this function is called by the logs
* and the exceptions, so it would be called back again and again */
and return its PID. Returns -1 if the process has not been created by
any other process.
*/
-int MSG_process_get_PPID(m_process_t process)
+int MSG_process_get_PPID(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
* This function checks whether \a process is a valid pointer or not
and return its name.
*/
-const char *MSG_process_get_name(m_process_t process)
+const char *MSG_process_get_name(msg_process_t process)
{
xbt_assert(process, "Invalid parameter");
* \param name a property name
* \return value of a property (or NULL if the property is not set)
*/
-const char *MSG_process_get_property_value(m_process_t process,
+const char *MSG_process_get_property_value(msg_process_t process,
const char *name)
{
return xbt_dict_get_or_null(MSG_process_get_properties(process), name);
*
* This function returns all the parameters associated with a process
*/
-xbt_dict_t MSG_process_get_properties(m_process_t process)
+xbt_dict_t MSG_process_get_properties(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
/** \ingroup m_process_management
* \brief Return the PID of the current process.
*
- * This function returns the PID of the currently running #m_process_t.
+ * This function returns the PID of the currently running #msg_process_t.
*/
int MSG_process_self_PID(void)
{
* \brief Return the PPID of the current process.
*
* This function returns the PID of the parent of the currently
- * running #m_process_t.
+ * running #msg_process_t.
*/
int MSG_process_self_PPID(void)
{
/** \ingroup m_process_management
* \brief Return the current process.
*
- * This function returns the currently running #m_process_t.
+ * This function returns the currently running #msg_process_t.
*/
-m_process_t MSG_process_self(void)
+msg_process_t MSG_process_self(void)
{
return SIMIX_process_self();
}
* This function suspends the process by suspending the task on which
* it was waiting for the completion.
*/
-MSG_error_t MSG_process_suspend(m_process_t process)
+MSG_error_t MSG_process_suspend(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
* This function resumes a suspended process by resuming the task on
* which it was waiting for the completion.
*/
-MSG_error_t MSG_process_resume(m_process_t process)
+MSG_error_t MSG_process_resume(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
* This checks whether a process is suspended or not by inspecting the
* task on which it was waiting for the completion.
*/
-int MSG_process_is_suspended(m_process_t process)
+int MSG_process_is_suspended(msg_process_t process)
{
xbt_assert(process != NULL, "Invalid parameter");
return simcall_process_is_suspended(process);
}
-smx_context_t MSG_process_get_smx_ctx(m_process_t process) {
+smx_context_t MSG_process_get_smx_ctx(msg_process_t process) {
return SIMIX_process_get_context(process);
}
/**
* If the flag is set to 1, the process will be automatically restarted when
* its host comes back up.
*/
-XBT_PUBLIC(void) MSG_process_auto_restart_set(m_process_t process, int auto_restart) {
+XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart) {
simcall_process_auto_restart_set(process,auto_restart);
}
* \param callback a callback function
*/
void MSG_task_set_copy_callback(void (*callback)
- (m_task_t task, m_process_t sender, m_process_t receiver)) {
+ (m_task_t task, msg_process_t sender, msg_process_t receiver)) {
msg_global->task_copy_callback = callback;
/** \ingroup m_task_management
* \brief Return the sender of a #m_task_t.
*
- * This functions returns the #m_process_t which sent this task
+ * This functions returns the #msg_process_t which sent this task
*/
-m_process_t MSG_task_get_sender(m_task_t task)
+msg_process_t MSG_task_get_sender(m_task_t task)
{
xbt_assert(task, "Invalid parameters");
return ((simdata_task_t) task->simdata)->sender;
res->state = msg_vm_state_running;
res->location = location;
res->coreAmount = coreAmount;
- res->processes = xbt_dynar_new(sizeof(m_process_t),NULL);
+ res->processes = xbt_dynar_new(sizeof(msg_process_t),NULL);
xbt_swag_insert(res,msg_global->vms);
xbt_swag_insert(res,location->vms);
* Afterward, when the VM is migrated or suspended or whatever, the process will have the corresponding handling, too.
*
*/
-void MSG_vm_bind(msg_vm_t vm, m_process_t process) {
+void MSG_vm_bind(msg_vm_t vm, msg_process_t process) {
/* check if the process is already in a VM */
simdata_process_t simdata = simcall_process_get_data(process);
if (simdata->vm) {
XBT_DEBUG("binding Process %s to %p",MSG_process_get_name(process),vm);
- xbt_dynar_push_as(vm->processes,m_process_t,process);
+ xbt_dynar_push_as(vm->processes,msg_process_t,process);
}
/** @brief Removes the given process from the given VM, and kill it
* @ingroup msg_VMs
*
* Will raise a not_found exception if the process were not binded to that VM
*/
-void MSG_vm_unbind(msg_vm_t vm, m_process_t process) {
+void MSG_vm_unbind(msg_vm_t vm, msg_process_t process) {
int pos = xbt_dynar_search(vm->processes,process);
xbt_dynar_remove_at(vm->processes,pos, NULL);
MSG_process_kill(process);
*/
void MSG_vm_migrate(msg_vm_t vm, m_host_t destination) {
unsigned int cpt;
- m_process_t process;
+ msg_process_t process;
xbt_dynar_foreach(vm->processes,cpt,process) {
MSG_process_migrate(process,destination);
}
*/
void MSG_vm_suspend(msg_vm_t vm) {
unsigned int cpt;
- m_process_t process;
+ msg_process_t process;
xbt_dynar_foreach(vm->processes,cpt,process) {
XBT_DEBUG("suspend process %s of host %s",MSG_process_get_name(process),MSG_host_get_name(MSG_process_get_host(process)));
MSG_process_suspend(process);
*/
void MSG_vm_resume(msg_vm_t vm) {
unsigned int cpt;
- m_process_t process;
+ msg_process_t process;
xbt_dynar_foreach(vm->processes,cpt,process) {
XBT_DEBUG("resume process %s of host %s",MSG_process_get_name(process),MSG_host_get_name(MSG_process_get_host(process)));
MSG_process_resume(process);
*/
void MSG_vm_shutdown(msg_vm_t vm)
{
- m_process_t process;
+ msg_process_t process;
XBT_DEBUG("%lu processes in the VM", xbt_dynar_length(vm->processes));
while (xbt_dynar_length(vm->processes) > 0) {
- process = xbt_dynar_get_as(vm->processes,0,m_process_t);
+ process = xbt_dynar_get_as(vm->processes,0,msg_process_t);
MSG_process_kill(process);
}
}
*/
void MSG_vm_destroy(msg_vm_t vm) {
unsigned int cpt;
- m_process_t process;
+ msg_process_t process;
xbt_dynar_foreach(vm->processes,cpt,process) {
//FIXME: Slow ?
simdata_process_t simdata = simcall_process_get_data(process);