Commit 096a0949 authored by Pierre-François's avatar Pierre-François
Browse files

Adding submitter in the request to get rid of origin map in batsim.

parent c543a617
......@@ -57,8 +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 | REQ,TIME | Batsim queries the scheduler about potential waiting time for requested number of processors, for a given walltime.
| 4+ | W | Sched->Batsim | REQ,TIME,WAIT | Scheduler notifies Batsim about potential waiting time for requested number of processors and walltime.
| 4+ | Q | Batsim->Sched | SUB,REQ,TIME | Batsim queries the scheduler about potential waiting time for requested number of processors, for a given walltime. SUB is the submitter.
| 4+ | W | Sched->Batsim | SUB,REQ,TIME,WAIT | Scheduler notifies Batsim about potential waiting time for requested number of processors and walltime. SUB is the submitter.
# Message Examples #
......
......@@ -170,6 +170,7 @@ struct WaitQueryMessage
*/
struct SchedWaitAnswerMessage
{
std::string submitter_name; //!< The name of the submitter which submitted the job.
int nb_resources; //!< The number of resources for which we would like to know the waiting time
double processing_time; //!< The duration for which the resources would be used
double expected_time; //!< The expected waiting time supplied by the scheduler
......
......@@ -467,14 +467,15 @@ int request_reply_scheduler_process(int argc, char *argv[])
vector<string> parts3;
boost::split(parts3, parts2[2], boost::is_any_of(","), boost::token_compress_on);
xbt_assert(parts3.size() == 3, "Invalid event received ('%s'): invalid wait answer message content ('%s'): it must be"
" formated like R,T,W where R is the number of requested resource, T the requested walltime and W the waiting time",
event_string.c_str(), parts2[2].c_str());
// xbt_assert(parts3.size() == 3, "Invalid event received ('%s'): invalid wait answer message content ('%s'): it must be"
// " formated like R,T,W where R is the number of requested resource, T the requested walltime and W the waiting time",
// event_string.c_str(), parts2[2].c_str());
int nb_resources = std::stoi(parts3[0]);
double processing_time = std::stod(parts3[1]);
double expected_time = std::stod(parts3[2]);
int nb_resources = std::stoi(parts3[1]);
double processing_time = std::stod(parts3[2]);
double expected_time = std::stod(parts3[3]);
message->submitter_name = parts3[0];
message->nb_resources = nb_resources;
message->processing_time = processing_time;
message->expected_time = expected_time;
......
......@@ -437,12 +437,12 @@ int uds_server_process(int argc, char *argv[])
SchedWaitAnswerMessage * message = new SchedWaitAnswerMessage;
*message = *( (SchedWaitAnswerMessage *) task_data->data);
Submitter * submitter = origin_of_wait_queries.at({message->nb_resources,message->processing_time});
// Submitter * submitter = origin_of_wait_queries.at({message->nb_resources,message->processing_time});
dsend_message(submitter->mailbox, IPMessageType::SCHED_WAIT_ANSWER, (void*) message);
dsend_message(message->submitter_name, IPMessageType::SCHED_WAIT_ANSWER, (void*) message);
origin_of_wait_queries.erase({message->nb_resources,message->processing_time});
// origin_of_wait_queries.erase({message->nb_resources,message->processing_time});
} break; // end of case SCHED_WAIT_ANSWER
......@@ -452,12 +452,13 @@ int uds_server_process(int argc, char *argv[])
// XBT_INFO("received : %s , %s\n", to_string(message->nb_resources).c_str(), to_string(message->processing_time).c_str());
send_buffer += "|" + std::to_string(MSG_get_clock()) + ":Q:"
+ message->submitter_name.c_str() + ","
+ to_string(message->nb_resources).c_str() + ","
+ boost::lexical_cast<string>(message->processing_time).c_str();
// XBT_INFO("INFO!!! Message to send to scheduler : '%s'", send_buffer.c_str());
Submitter * submitter = submitters.at(message->submitter_name);
origin_of_wait_queries[{message->nb_resources,message->processing_time}] = submitter;
//Submitter * submitter = submitters.at(message->submitter_name);
//origin_of_wait_queries[{message->nb_resources,message->processing_time}] = submitter;
} break; // end of case WAIT_QUERY
......
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