* @brief Stores the different types of inter-process messages
*/
enumclassIPMessageType
{
JOB_SUBMITTED//!< Submitter -> Server. The submitter tells the server a new job has been submitted.
...
...
@@ -31,56 +35,86 @@ enum class IPMessageType
,SWITCHED_OFF//!< SwitcherOFF -> Server. The switcherOFF process tells the server the machine pstate has been changed.
};
/**
* @brief The content of the JobSubmitted message
*/
structJobSubmittedMessage
{
intjob_id;//! The job ID
};
/**
* @brief The content of the JobCompleted message
*/
structJobCompletedMessage
{
intjob_id;//! The job ID
};
/**
* @brief The content of the JobRejected message
*/
structJobRejectedMessage
{
intjob_id;//! The job ID
};
/**
* @brief A subpart of the SchedulingAllocation message
*/
structSchedulingAllocation
{
intjob_id;
intjob_id;//! The job unique number
MachineRangemachine_ids;//! The IDs of the machines on which the job should be allocated
std::vector<msg_host_t>hosts;//! The corresponding SimGrid hosts
};
/**
* @brief The content of the JobSubmitted message
*/
structSchedulingAllocationMessage
{
std::vector<SchedulingAllocation*>allocations;//! Possibly several allocations
};
/**
* @brief The content of the PstateModification message
*/
structPStateModificationMessage
{
MachineRangemachine_ids;//! The IDs of the machines on which the pstate should be changed
intnew_pstate;//! The pstate the machines should be put into
};
/**
* @brief The content of the NOPMeLater message
*/
structNOPMeLaterMessage
{
doubletarget_time;
};
/**
* @brief The content of the SwitchON message
*/
structSwitchONMessage
{
intmachine_id;
intnew_pstate;
};
/**
* @brief The content of the SwitchOFF message
*/
structSwitchOFFMessage
{
intmachine_id;
intnew_pstate;
};
/**
* @brief The base struct sent in inter-process messages
*/
structIPMessage
{
~IPMessage();
...
...
@@ -88,29 +122,44 @@ struct IPMessage
void*data;//! The message data (can be NULL if type is in [SCHED_NOP, SUBMITTER_HELLO, SUBMITTER_BYE, SUBMITTER_READY]). Otherwise, it is either a JobSubmittedMessage*, a JobCompletedMessage* or a SchedulingAllocationMessage* according to type.
};
/**
* @brief The arguments of the request_reply_scheduler_process process
*/
structRequestReplyProcessArguments
{
BatsimContext*context;
std::stringsend_buffer;
};
/**
* @brief The arguments of the uds_server_process process
*/
structServerProcessArguments
{
BatsimContext*context;
};
/**
* @brief The arguments of the execute_job_process process
*/
structExecuteJobProcessArguments
{
BatsimContext*context;
SchedulingAllocation*allocation;
};
/**
* @brief The arguments of the killer_process process
*/
structKillerProcessArguments
{
msg_task_ttask;//! The task that will be cancelled if the walltime is reached
doublewalltime;//! The number of seconds to wait before cancelling the task
};
/**
* @brief The arguments of the switch_on_machine_process and switch_off_machine_process processes
* @brief Contains the different states a job can be in
*/
enumclassJobState
{
JOB_STATE_NOT_SUBMITTED//!< The job exists but cannot be scheduled yet.
...
...
@@ -23,44 +27,100 @@ enum class JobState
,JOB_STATE_REJECTED//!< The job has been rejected by the scheduler.
};
/**
* @brief Represents a job
*/
structJob
{
intid;
std::stringprofile;
doublesubmission_time;
doublewalltime;
intrequired_nb_res;
intid;//! The unique job number
std::stringprofile;//! The job profile name. The corresponding profile tells how the job should be computed
doublesubmission_time;//! The job submission time: The time at which the becomes available
doublewalltime;//! The job walltime: if the job is executed for more than this amount of time, it will be killed
intrequired_nb_res;//! The number of resources the job is requested to be executed on
longdoubleconsumed_energy;//! The sum, for each machine on which the job has been allocated, of the consumed energy (in Joules) during the job execution time (consumed_energy_after_job_completion - consumed_energy_before_job_start)
doublestarting_time;
doubleruntime;
MachineRangeallocation;
JobStatestate;
doublestarting_time;//! The time at which the job starts to be executed.
doubleruntime;//! The amount of time during which the job has been executed
MachineRangeallocation;//! The machines on which the job has been executed.
JobStatestate;//! The current state of the job
};
/**
* @brief Compares job thanks to their submission times
* @param[in] a The first job
* @param[in] b The second job
* @return True if and only if the first job's submission time is lower than the second job's submission time