Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move assert befort assignment.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 27 Mar 2018 09:58:50 +0000 (11:58 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 27 Mar 2018 14:07:13 +0000 (16:07 +0200)
src/surf/cpu_cas01.cpp
src/surf/network_cm02.cpp

index 52d7f2c..bacf715 100644 (file)
@@ -43,10 +43,10 @@ CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
   if (optim == "Full") {
     setUpdateMechanism(UM_FULL);
   } else if (optim == "Lazy") {
-    setUpdateMechanism(UM_LAZY);
+    xbt_assert(select || xbt_cfg_is_default_value("cpu/maxmin-selective-update"),
+               "You cannot disable cpu selective update when using the lazy update mechanism");
     select = true;
-    xbt_assert(select || (xbt_cfg_is_default_value("cpu/maxmin-selective-update")),
-               "Disabling selective update while using the lazy update mechanism is dumb!");
+    setUpdateMechanism(UM_LAZY);
   } else {
     xbt_die("Unsupported optimization (%s) for this model", optim.c_str());
   }
index e0c2bd9..a0678ac 100644 (file)
@@ -143,10 +143,10 @@ NetworkCm02Model::NetworkCm02Model()
   if (optim == "Full") {
     setUpdateMechanism(UM_FULL);
   } else if (optim == "Lazy") {
+    xbt_assert(select || xbt_cfg_is_default_value("network/maxmin-selective-update"),
+               "You cannot disable network selective update when using the lazy update mechanism");
     select = true;
     setUpdateMechanism(UM_LAZY);
-    xbt_assert(select || (xbt_cfg_is_default_value("network/maxmin-selective-update")),
-               "You cannot disable selective update when using the lazy update mechanism");
   } else {
     xbt_die("Unsupported optimization (%s) for this model. Accepted: Full, Lazy.", optim.c_str());
   }