Commit 443d8926 authored by Pierre-François's avatar Pierre-François

first draft

parent 5f99e694
......@@ -57,6 +57,8 @@ the job ID of the job which just completed. This part is not mandatory, it depen
| 3+ | Z | Batsim->Sched | No content | Batsim tells the scheduler that the simulation is about to end (all jobs have been submitted and completed/rejected)
| 3+ | F | Batsim->Sched | MID1,MID2,MIDn | Batsim tells the scheduler that the given machines are in a failure state (crashed, no jobs can be computed on them). Each MIDk part can be a single machine ID or a closed interval MIDa-MIDb where MIDa <= MIDb
| 3+ | f | Batsim->Sched | MID1,MID2,MIDn | Batsim tells the scheduler that the given machines are no longer in a failure state (jobs can now be computed on them). Each MIDk part can be a single machine ID or a closed interval MIDa-MIDb where MIDa <= MIDb
| 4+ | Q | Batsim->Sched | REQ1[;...] | Batsim queries the scheduler about potential waiting times for requested number of processors.
| 4+ | W | Sched->Batsim | REQ1=WAIT1[;...] | Scheduler notifies Batsim about potential waiting times for requested number of processors.
# Message Examples #
......
......@@ -84,6 +84,12 @@ std::string ipMessageTypeToString(IPMessageType type)
case IPMessageType::SCHED_TELL_ME_ENERGY:
s = "SCHED_TELL_ME_ENERGY";
break;
case IPMessageType::SCHED_WAIT_ANSWER:
s = "SCHED_WAIT_ANSWER";
break;
case IPMessageType::WAIT_QUERY:
s = "WAIT_QUERY";
break;
case IPMessageType::SCHED_READY:
s = "SCHED_READY";
break;
......@@ -163,6 +169,16 @@ IPMessage::~IPMessage()
case IPMessageType::SCHED_TELL_ME_ENERGY:
{
} break;
case IPMessageType::WAIT_QUERY:
{
WaitQueryMessage * msg = (WaitQueryMessage *) data;
delete msg;
} break;
case IPMessageType::SCHED_WAIT_ANSWER:
{
SchedWaitAnswerMessage * msg = (SchedWaitAnswerMessage *) data;
delete msg;
} break;
case IPMessageType::SCHED_READY:
{
} break;
......
......@@ -58,6 +58,8 @@ enum class IPMessageType
,SCHED_NOP //!< SchedulerHandler -> Server. The scheduler handler tells the server a scheduling event occured (a NOP message).
,SCHED_NOP_ME_LATER //!< SchedulerHandler -> Server. The scheduler handler tells the server a scheduling event occured (a NOP_ME_LATTER message).
,SCHED_TELL_ME_ENERGY //!< SchedulerHandler -> Server. The scheduler handler tells the server a scheduling event occured (a TELL_ME_CONSUMED_ENERGY message).
,SCHED_WAIT_ANSWER //!< SchedulerHandler -> Server. The scheduler handler tells the server a scheduling event occured (a WAIT_ANSWER message).
,WAIT_QUERY //!< Server -> SchedulerHandler. The scheduler handler tells the server a scheduling event occured (a WAIT_ANSWER message).
,SCHED_READY //!< SchedulerHandler -> Server. The scheduler handler tells the server that the scheduler is ready (messages can be sent to it).
,WAITING_DONE //!< Waiter -> server. The waiter tells the server that the target time has been reached.
,SUBMITTER_HELLO //!< Submitter -> Server. The submitter tells it starts submitting to the server.
......@@ -153,6 +155,23 @@ struct NOPMeLaterMessage
double target_time; //!< The time at which Batsim should send a NOP message to the decision real process
};
/**
* @brief The content of the WaitQuery message
*/
struct WaitQueryMessage
{
int nb_resources; //!< The number of resources for which we would like to know the waiting time
};
/**
* @brief The content of the SchedWaitAnswer message
*/
struct SchedWaitAnswerMessage
{
int nb_resources; //!< The number of resources for which we would like to know the waiting time
double expected_time; //!< The expected waiting time supplied by the scheduler
};
/**
* @brief The content of the SwitchON message
*/
......
......@@ -458,6 +458,13 @@ int request_reply_scheduler_process(int argc, char *argv[])
send_message("server", IPMessageType::SCHED_TELL_ME_ENERGY);
} break; // End of case received_stamp == TELL_ME_CONSUMED_ENERGY
case ANSWER_WAIT:
{
xbt_assert(parts2.size() == 2, "Invalid event received ('%s'): messages to ask the consumed energy must be composed of 2 parts separated by ':'",
event_string.c_str());
send_message("server", IPMessageType::SCHED_WAIT_ANSWER);
} break; // End of case received_stamp == ANSWER_WAIT
default:
{
xbt_die("Invalid event received ('%s') : unhandled network stamp received ('%c')", event_string.c_str(), received_stamp);
......
......@@ -24,7 +24,9 @@ enum NetworkStamp : char
,NOP_ME_LATER = 'n' //!< Decision -> Batsim. The Decision real process wants to be awaken at a future simulation time
,TELL_ME_CONSUMED_ENERGY = 'E' //!< Decision -> Batsim. The Decision real process wants to know how much energy has been consumed on computing machines since the beginning of the simulation
,PSTATE_HAS_BEEN_SET = 'p' //!< Batsim -> Decision. Batsim acknowledges that the power state of one of several machines has been changed
,QUERY_WAIT = 'Q' //!< Batsim -> Decision. Batsim queries the Decision process on the waiting time to get a given amount of resources
,CONSUMED_ENERGY = 'e' //!< Batsim -> Decision. Batsim tells the Decision process how much energy has been used since the beginning of the simulation
,ANSWER_WAIT = 'W' //!< Decision -> Batsim. The Decision process answers to Batsim on the waiting time to get a given amount of resources
};
/**
......
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