From 9f3bf03bc16c127eac07b0a576636e1116599342 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 27 Mar 2018 11:58:50 +0200 Subject: [PATCH] Move assert befort assignment. --- src/surf/cpu_cas01.cpp | 6 +++--- src/surf/network_cm02.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 52d7f2c339..bacf7159d5 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -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()); } diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index e0c2bd9b7e..a0678ac1ed 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -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()); } -- 2.20.1