Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Call getBound before unref on p_action.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 7 Feb 2014 10:28:45 +0000 (11:28 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Sat, 8 Feb 2014 09:43:45 +0000 (10:43 +0100)
src/surf/vm_workstation_hl13.cpp

index 1be5053..a0b0b75 100644 (file)
@@ -432,9 +432,6 @@ void WorkstationVMHL13::migrate(surf_resource_t ind_dst_pm)
      if (p_action->getRemainsNoUpdate() > 0)
        XBT_CRITICAL("FIXME: need copy the state(?), %f", p_action->getRemainsNoUpdate());
 
-     int ret = p_action->unref();
-     xbt_assert(ret == 1, "Bug: some resource still remains");
-
      /* keep the bound value of the cpu action of the VM. */
      double old_bound = p_action->getBound();
      if (old_bound != 0) {
@@ -442,6 +439,9 @@ void WorkstationVMHL13::migrate(surf_resource_t ind_dst_pm)
        new_cpu_action->setBound(old_bound);
      }
 
+     int ret = p_action->unref();
+     xbt_assert(ret == 1, "Bug: some resource still remains");
+
      p_action = new_cpu_action;
    }