From: Christian Heinrich Date: Thu, 22 Jan 2015 11:34:25 +0000 (+0100) Subject: Modified error messages when creating CPUs for more verbosity. X-Git-Tag: v3_12~760^2~29 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/40778ac106dfafd9f790d8bdadf737de01c3d3e3 Modified error messages when creating CPUs for more verbosity. As 0 may be assumed as the default powerPeak value (if no value specified), the error message should point out that the power attribute may have been forgotten. This was added in this commit. --- diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index b58815c16a..98ad19a55c 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -118,8 +118,8 @@ CpuPtr CpuCas01Model::createCpu(const char *name, xbt_dynar_t power_peak, "Host '%s' declared several times in the platform file", name); xbt_assert(xbt_dynar_getfirst_as(power_peak, double) > 0.0, - "Power has to be >0.0"); - xbt_assert(core > 0, "Invalid number of cores %d", core); + "Power has to be >0.0. Did you forget to specify the mandatory power attribute?"); + xbt_assert(core > 0, "Invalid number of cores %d. Must be larger than 0", core); cpu = new CpuCas01(this, name, power_peak, pstate, power_scale, power_trace, core, state_initial, state_trace, cpu_properties); xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu); diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 38717da785..81a156d427 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -437,6 +437,8 @@ CpuPtr CpuTiModel::createCpu(const char *name, xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)), "Host '%s' declared several times in the platform file", name); + xbt_assert(xbt_dynar_getfirst_as(powerPeak, double) > 0.0, + "Power has to be >0.0. Did you forget to specify the mandatory power attribute?"); CpuTiPtr cpu = new CpuTi(this, name, powerPeak, pstate, powerScale, powerTrace, core, stateInitial, stateTrace, cpuProperties); xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, static_cast(cpu));