Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Huge import with Lucas tracing modifications.
[simgrid.git] / examples / msg / migration / migration.c
index 04186be..44de664 100644 (file)
@@ -16,6 +16,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
 /** 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[])
 {
+  TRACE_msg_set_process_category (MSG_process_self(), "emigrant");
   m_task_t task;
   INFO0
     ("I'll look for a new job on another machine where the grass is greener.");
@@ -24,8 +25,11 @@ static int emigrant(int argc, char *argv[])
   task = MSG_task_create("job", 98095000, 0, NULL);
   MSG_task_execute(task);
   MSG_task_destroy(task);
+  MSG_process_sleep (2);
   INFO0("Moving back home after work");
   MSG_process_change_host(MSG_get_host_by_name("Jacquelin"));
+  MSG_process_change_host(MSG_get_host_by_name("Boivin"));
+  MSG_process_sleep (4);
   INFO0("Uh, nothing to do here. Stopping now");
   return 0;
 }                               /* end_of_emigrant */
@@ -45,6 +49,9 @@ int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
 
+  TRACE_start_with_mask ("zmsg_test.trace", TRACE_PLATFORM|TRACE_PROCESS);
+  TRACE_category ("emigrant");
+
   /* Argument checking */
   MSG_global_init(&argc, argv);
   if (argc < 3) {
@@ -67,6 +74,8 @@ int main(int argc, char *argv[])
   if (res == MSG_OK)
     res = MSG_clean();
 
+  TRACE_end ();
+
   if (res == MSG_OK)
     return 0;
   else