Commit 35611845 authored by Millian Poquet's avatar Millian Poquet

Refactoring machin_state -> Machine::State

parent 854d759e
...@@ -32,7 +32,7 @@ void Machines::createMachines(xbt_dynar_t hosts) ...@@ -32,7 +32,7 @@ void Machines::createMachines(xbt_dynar_t hosts)
machine.name = MSG_host_get_name(host); machine.name = MSG_host_get_name(host);
machine.host = host; machine.host = host;
machine.jobs_being_computed = {}; machine.jobs_being_computed = {};
machine.state = machine_state::IDLE; machine.state = Machine::IDLE;
} }
} }
...@@ -51,7 +51,7 @@ void Machines::updateMachinesOnJobRun(int jobID, const std::vector<int> & usedMa ...@@ -51,7 +51,7 @@ void Machines::updateMachinesOnJobRun(int jobID, const std::vector<int> & usedMa
for (int machineID : usedMachines) for (int machineID : usedMachines)
{ {
Machine & machine = _machines[machineID]; Machine & machine = _machines[machineID];
machine.state = machine_state::COMPUTING; machine.state = Machine::COMPUTING;
// cout << machine; // cout << machine;
machine.jobs_being_computed.insert(jobID); machine.jobs_being_computed.insert(jobID);
...@@ -72,7 +72,7 @@ void Machines::updateMachinesOnJobEnd(int jobID, const std::vector<int> & usedMa ...@@ -72,7 +72,7 @@ void Machines::updateMachinesOnJobEnd(int jobID, const std::vector<int> & usedMa
if (machine.jobs_being_computed.empty()) if (machine.jobs_being_computed.empty())
{ {
machine.state = machine_state::IDLE; machine.state = Machine::IDLE;
// todo: handle the Pajé trace in this file, not directly in batsim.c // todo: handle the Pajé trace in this file, not directly in batsim.c
} }
......
...@@ -7,22 +7,19 @@ ...@@ -7,22 +7,19 @@
#include <simgrid/msg.h> #include <simgrid/msg.h>
namespace machine_state struct Machine
{ {
enum MachineState enum State
{ {
SLEEPING, SLEEPING,
IDLE, IDLE,
COMPUTING, COMPUTING,
}; };
}
struct Machine
{
int id; int id;
std::string name; std::string name;
msg_host_t host; msg_host_t host;
machine_state::MachineState state; State state;
std::set<int> jobs_being_computed; std::set<int> jobs_being_computed;
}; };
......
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