Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix bug #14412 (Killing a SIMIX process just after migrate won't work)
authorSamuel Lepetit <samuel.lepetit@inria.fr>
Thu, 21 Jun 2012 08:44:38 +0000 (10:44 +0200)
committerSamuel Lepetit <samuel.lepetit@inria.fr>
Thu, 21 Jun 2012 08:44:38 +0000 (10:44 +0200)
examples/msg/cloud/masterslave_virtual_machines.c
src/simix/smx_process.c

index ed1ac27..2ed5704 100644 (file)
@@ -99,6 +99,8 @@ int master(int argc, char *argv[]) {
     MSG_vm_bind(vm, MSG_process_create_with_arguments(slavename,slave_fun,NULL,slaves[i],2,argv));
   }
 
+  work_batch(slaves_count*2);
+
   XBT_INFO("Migrate everyone to the second host.");
   for (i=0;i<xbt_dynar_length(vms);i++)
     MSG_vm_migrate(xbt_dynar_get_as(vms,i,msg_vm_t),slaves[1]);
@@ -111,7 +113,6 @@ int master(int argc, char *argv[]) {
     MSG_vm_resume(vm);
   }
 
-  work_batch(slaves_count*2);
 
   XBT_INFO("Let's shut down the simulation. 10 first processes will be shut down cleanly while the second half will forcefully get killed");
   for (i = 0; i < slaves_count; i++) {
index cf9f267..18656fa 100644 (file)
@@ -638,6 +638,11 @@ void SIMIX_process_yield(smx_process_t self)
   /* Ok, maestro returned control to us */
   XBT_DEBUG("Control returned to me: '%s'", self->name);
 
+  if (self->new_host) {
+    SIMIX_process_change_host(self, self->new_host);
+    self->new_host = NULL;
+  }
+
   if (self->context->iwannadie){
     XBT_DEBUG("I wanna die!");
     SIMIX_context_stop(self->context);
@@ -654,11 +659,6 @@ void SIMIX_process_yield(smx_process_t self)
     self->doexception = 0;
     SMX_THROW();
   }
-  
-  if (self->new_host) {
-    SIMIX_process_change_host(self, self->new_host);
-    self->new_host = NULL;
-  }
 }
 
 /* callback: context fetching */