X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0ca1291c2f63ca6235f4b4885c48413a900aade4..6c57f2bcd30205dd1a6f11b8b4c2c77d45d9a81d:/src/msg/m_process.c diff --git a/src/msg/m_process.c b/src/msg/m_process.c index 66cafcb688..a7b18f880e 100644 --- a/src/msg/m_process.c +++ b/src/msg/m_process.c @@ -158,15 +158,15 @@ m_process_t MSG_process_create_with_environment(const char *name, 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--; @@ -213,16 +213,15 @@ void MSG_process_kill(m_process_t 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_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; }