Commit 82cb1368 authored by Millian Poquet's avatar Millian Poquet

Energy: trimming of the sleep_pstates XML property. Exportation of the total...

Energy: trimming of the sleep_pstates XML property. Exportation of the total consumed energy in the CSV output file. Addition of a line in README.org to know which SimGrid reversion should be used for energy-aware experiments.
parent 5e3ba296
......@@ -2,7 +2,9 @@
* Installation
** dependencies
- simgrid (revision 8de23104635721196 on git://scm.gforge.inria.fr/simgrid/simgrid.git)
- simgrid
- without energy: rev 8de23104635721196 on git://scm.gforge.inria.fr/simgrid/simgrid.git
- with energy: rev 685c03b7bc7bbc on https://github.com/mquinson/simgrid.git
- rapidjson
- boost (system, filesystem)
- C++11 compiler
......
......@@ -588,7 +588,7 @@ void exportScheduleToCSV(const string &filename, double scheduling_time, BatsimC
ofstream f(filename, ios_base::trunc);
xbt_assert(f.is_open(), "Cannot write file '%s'", filename.c_str());
f << "nb_jobs,nb_jobs_finished,nb_jobs_success,nb_jobs_killed,success_rate,makespan,max_turnaround_time,scheduling_time,jobs_execution_time_boundary_ratio\n";
f << "nb_jobs,nb_jobs_finished,nb_jobs_success,nb_jobs_killed,success_rate,makespan,max_turnaround_time,scheduling_time,jobs_execution_time_boundary_ratio,consumed_joules\n";
int nb_jobs = 0;
int nb_jobs_finished = 0;
......@@ -629,11 +629,24 @@ void exportScheduleToCSV(const string &filename, double scheduling_time, BatsimC
}
}
long double total_consumed_energy = 0;
if (context->energy_used)
{
for (const Machine * m : context->machines.machines())
{
total_consumed_energy += MSG_host_get_consumed_energy(m->host);
}
}
else
total_consumed_energy = -1;
char * buf;
int ret = asprintf(&buf, "%d,%d,%d,%d,%lf,%lf,%lf,%lf,%lf\n",
int ret = asprintf(&buf, "%d,%d,%d,%d,%lf,%lf,%lf,%lf,%lf,%Lg\n",
nb_jobs, nb_jobs_finished, nb_jobs_success, nb_jobs_killed,
(double)nb_jobs_success/nb_jobs, makespan, max_turnaround_time,
scheduling_time, max_job_execution_time / min_job_execution_time);
scheduling_time, max_job_execution_time / min_job_execution_time,
total_consumed_energy);
xbt_assert(ret != -1, "asprintf failed (not enough memory?)");
f << buf;
......
......@@ -65,7 +65,7 @@ void Machines::createMachines(xbt_dynar_t hosts, BatsimContext *context, const s
vector<string> sleep_pstate_triplets;
boost::split(sleep_pstate_triplets, sleep_states_str, boost::is_any_of(","), boost::token_compress_on);
for (const auto & triplet : sleep_pstate_triplets)
for (const string & triplet : sleep_pstate_triplets)
{
vector<string> pstates;
boost::split(pstates, triplet, boost::is_any_of(":"), boost::token_compress_on);
......@@ -80,6 +80,10 @@ void Machines::createMachines(xbt_dynar_t hosts, BatsimContext *context, const s
bool conversion_succeeded = true;
try
{
boost::trim(pstates[0]);
boost::trim(pstates[1]);
boost::trim(pstates[2]);
sleep_ps = boost::lexical_cast<unsigned int>(pstates[0]);
on_ps = boost::lexical_cast<unsigned int>(pstates[1]);
off_ps = boost::lexical_cast<unsigned int>(pstates[2]);
......
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