#endif
xbt_free(msg_proc);
- SIMIX_req_process_cleanup(smx_proc);
}
/* This function creates a MSG process. It has the prototype enforced by SIMIX_function_register_process_create */
int argc, char **argv,
xbt_dict_t properties)
{
- xbt_assert0(code != NULL && host != NULL, "Invalid parameters");
+ xbt_assert(code != NULL && host != NULL, "Invalid parameters");
simdata_process_t simdata = xbt_new0(s_simdata_process_t, 1);
m_process_t process;
simdata->PPID = -1;
}
+#ifdef HAVE_TRACING
+ TRACE_msg_process_create(name, simdata->PID, simdata->m_host);
+#endif
+
/* Let's create the process: SIMIX may decide to start it right now,
* even before returning the flow control to us */
SIMIX_req_process_create(&process, name, code, simdata, host->name,
argc, argv, properties);
-#ifdef HAVE_TRACING
- TRACE_msg_process_create(process);
-#endif
-
if (!process) {
/* Undo everything we have just changed */
msg_global->PID--;
* 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_change_host(m_host_t host)
+MSG_error_t MSG_process_migrate(m_process_t process, m_host_t host)
{
- m_process_t process = MSG_process_self();
- simdata_process_t simdata = SIMIX_process_self_get_data();
- m_host_t now = simdata->m_host;
+ simdata_process_t simdata = SIMIX_req_process_get_data(process);
simdata->m_host = host;
#ifdef HAVE_TRACING
+ m_host_t now = simdata->m_host;
TRACE_msg_process_change_host(process, now, host);
#endif
- SIMIX_req_process_change_host(process, now->name, host->name);
+ SIMIX_req_process_change_host(process, host->simdata->smx_host);
return MSG_OK;
}
*/
void* MSG_process_get_data(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
/* get from SIMIX the MSG process data, and then the user data */
simdata_process_t simdata = SIMIX_req_process_get_data(process);
*/
MSG_error_t MSG_process_set_data(m_process_t process, void *data)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
simdata_process_t simdata = SIMIX_req_process_get_data(process);
simdata->data = data;
*/
m_host_t MSG_process_get_host(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
simdata_process_t simdata = SIMIX_req_process_get_data(process);
return simdata->m_host;
*/
int MSG_process_get_PPID(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
simdata_process_t simdata = SIMIX_req_process_get_data(process);
*/
const char *MSG_process_get_name(m_process_t process)
{
- xbt_assert0(process, "Invalid parameter");
+ xbt_assert(process, "Invalid parameter");
return SIMIX_req_process_get_name(process);
}
*/
xbt_dict_t MSG_process_get_properties(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
return SIMIX_req_process_get_properties(process);
*/
MSG_error_t MSG_process_suspend(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
CHECK_HOST();
#ifdef HAVE_TRACING
*/
MSG_error_t MSG_process_resume(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
CHECK_HOST();
#ifdef HAVE_TRACING
*/
int MSG_process_is_suspended(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
return SIMIX_req_process_is_suspended(process);
}