Commit e0dc0d59 authored by Millian Poquet's avatar Millian Poquet
Browse files

[code] fix warnings + cosmetics

parent be859270
......@@ -876,12 +876,13 @@ void export_schedule_to_csv(const std::string &filename, const BatsimContext *co
XBT_INFO("jobs=%d, finished=%d, success=%d, killed=%d, success_rate=%lf",
nb_jobs, nb_jobs_finished, nb_jobs_success, nb_jobs_killed, success_rate);
XBT_INFO("makespan=%lf, scheduling_time=%lf, mean_waiting_time=%lf, mean_turnaround_time=%lf, mean_slowdown=%lf, max_waiting_time=%lf, max_turnaround_time=%lf, max_slowdown=%lf",
(double)makespan, (double)seconds_used_by_scheduler,
mean_waiting_time, mean_turnaround_time, mean_slowdown,
max_waiting_time, max_turnaround_time, max_slowdown);
XBT_INFO("makespan=%lf, scheduling_time=%lf, mean_waiting_time=%lf, mean_turnaround_time=%lf,"
"mean_slowdown=%lf, max_waiting_time=%lf, max_turnaround_time=%lf, max_slowdown=%lf",
(double)makespan, (double)seconds_used_by_scheduler,
mean_waiting_time, mean_turnaround_time, mean_slowdown,
(double)max_waiting_time, (double)max_turnaround_time, (double)max_slowdown);
XBT_INFO("mean_machines_running=%lf, max_machines_running=%lf",
mean_time_running, max_time_running);
mean_time_running, max_time_running);
Rational total_consumed_energy = context->energy_last_job_completion - context->energy_first_job_submission;
output_map["consumed_joules"] = to_string((double) total_consumed_energy);
......
......@@ -347,31 +347,51 @@ Profile *Profile::from_json(const std::string & profile_name,
xbt_assert(data->size >= 0, "%s: profile '%s' has a non-positive 'size' field (%g)",
error_prefix.c_str(), profile_name.c_str(), data->size);
if (json_desc.HasMember("direction")) {
auto direction = json_desc["direction"].GetString();
if (direction == std::string("to_storage")) {
if (json_desc.HasMember("direction"))
{
xbt_assert(json_desc["direction"].IsString(),
"%s: profile '%s' has a non-string 'direction' field",
error_prefix.c_str(), profile_name.c_str());
string direction = json_desc["direction"].GetString();
if (direction == "to_storage")
{
data->direction = MsgParallelHomogeneousPFSMultipleTiersProfileData::Direction::TO_STORAGE;
} else if (direction == std::string("from_storage")) {
}
else if (direction == "from_storage")
{
data->direction = MsgParallelHomogeneousPFSMultipleTiersProfileData::Direction::FROM_STORAGE;
} else {
xbt_assert(false, "%s: profile '%s' has an invalid 'direction' field (%g)",
error_prefix.c_str(), profile_name.c_str(), direction);
}
} else {
else
{
xbt_assert(false, "%s: profile '%s' has an invalid 'direction' field (%s)",
error_prefix.c_str(), profile_name.c_str(), direction.c_str());
}
}
else
{
data->direction = MsgParallelHomogeneousPFSMultipleTiersProfileData::Direction::TO_STORAGE;
}
if (json_desc.HasMember("host")) {
auto host = json_desc["host"].GetString();
if (host == std::string("HPST")) {
if (json_desc.HasMember("host"))
{
string host = json_desc["host"].GetString();
if (host == "HPST")
{
data->host = MsgParallelHomogeneousPFSMultipleTiersProfileData::Host::HPST;
} else if (host == std::string("LCST") || host == std::string("PFS")) {
}
else if (host == "LCST" || host == "PFS")
{
data->host = MsgParallelHomogeneousPFSMultipleTiersProfileData::Host::LCST;
} else {
xbt_assert(false, "%s: profile '%s' has an invalid 'host' field (%g)",
error_prefix.c_str(), profile_name.c_str(), host);
}
} else {
else
{
xbt_assert(false, "%s: profile '%s' has an invalid 'host' field (%s)",
error_prefix.c_str(), profile_name.c_str(), host.c_str());
}
}
else
{
data->host = MsgParallelHomogeneousPFSMultipleTiersProfileData::Host::LCST;
}
......@@ -392,14 +412,23 @@ Profile *Profile::from_json(const std::string & profile_name,
xbt_assert(json_desc.HasMember("direction"), "%s: profile '%s' has no 'direction' field",
error_prefix.c_str(), profile_name.c_str());
auto direction = json_desc["direction"].GetString();
if (direction == std::string("hpst_to_lcst")) {
xbt_assert(json_desc["direction"].IsString(),
"%s: profile '%s' has a non-string 'direction' field",
error_prefix.c_str(), profile_name.c_str());
string direction = json_desc["direction"].GetString();
if (direction == std::string("hpst_to_lcst"))
{
data->direction = MsgDataStagingProfileData::Direction::HPST_TO_LCST;
} else if (direction == std::string("lcst_to_hpst")) {
}
else if (direction == std::string("lcst_to_hpst"))
{
data->direction = MsgDataStagingProfileData::Direction::LCST_TO_HPST;
} else {
xbt_assert(false, "%s: profile '%s' has an invalid 'direction' field (%g)",
error_prefix.c_str(), profile_name.c_str(), direction);
}
else
{
xbt_assert(false, "%s: profile '%s' has an invalid 'direction' field (%s)",
error_prefix.c_str(), profile_name.c_str(), direction.c_str());
}
profile->data = data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment