Commit 0c5aea1f authored by Millian Poquet's avatar Millian Poquet
Browse files

[code] _schedule: add nb_switches fields

parent e752b0d6
...@@ -66,6 +66,9 @@ struct BatsimContext ...@@ -66,6 +66,9 @@ struct BatsimContext
my_timestamp simulation_start_time; //!< The moment in time at which the simulation has started my_timestamp simulation_start_time; //!< The moment in time at which the simulation has started
my_timestamp simulation_end_time; //!< The moment in time at which the simulation has ended my_timestamp simulation_end_time; //!< The moment in time at which the simulation has ended
unsigned long long nb_machine_switches = 0; //!< The number of machine switches done in the simulation (should be greater or equal to SET_RESOURCE_STATE events. Equal if all requested switches only concern single machines). Does not count transition states.
unsigned long long nb_grouped_switches = 0; //!< The number of switches done in the simulation (should equal to the number of received SET_RESOURCE_STATE events). Does not count transition states.
bool energy_used; //!< Stores whether the energy part of Batsim should be used bool energy_used; //!< Stores whether the energy part of Batsim should be used
bool smpi_used; //!< Stores whether SMPI should be used bool smpi_used; //!< Stores whether SMPI should be used
bool allow_time_sharing; //!< Stores whether time sharing (using the same machines to compute different jobs) should be allowed bool allow_time_sharing; //!< Stores whether time sharing (using the same machines to compute different jobs) should be allowed
......
...@@ -853,6 +853,8 @@ void export_schedule_to_csv(const std::string &filename, const BatsimContext *co ...@@ -853,6 +853,8 @@ void export_schedule_to_csv(const std::string &filename, const BatsimContext *co
Rational total_consumed_energy = context->energy_last_job_completion - context->energy_first_job_submission; Rational total_consumed_energy = context->energy_last_job_completion - context->energy_first_job_submission;
output_map["consumed_joules"] = to_string((double) total_consumed_energy); output_map["consumed_joules"] = to_string((double) total_consumed_energy);
output_map["nb_machine_switches"] = to_string(context->nb_machine_switches);
output_map["nb_grouped_switches"] = to_string(context->nb_grouped_switches);
// Let's compute machine-related metrics // Let's compute machine-related metrics
map<MachineState, Rational> time_spent_in_each_state; map<MachineState, Rational> time_spent_in_each_state;
......
...@@ -363,6 +363,10 @@ int server_process(int argc, char *argv[]) ...@@ -363,6 +363,10 @@ int server_process(int argc, char *argv[])
context->pstate_tracer.add_pstate_change(MSG_get_clock(), message->machine_ids, context->pstate_tracer.add_pstate_change(MSG_get_clock(), message->machine_ids,
transition_state); transition_state);
// Let's mark that some switches have been requested
context->nb_grouped_switches++;
context->nb_machine_switches += message->machine_ids.size();
for (auto machine_it = message->machine_ids.elements_begin(); for (auto machine_it = message->machine_ids.elements_begin();
machine_it != message->machine_ids.elements_end(); machine_it != message->machine_ids.elements_end();
++machine_it) ++machine_it)
......
Supports Markdown
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