Skip to content
Snippets Groups Projects
Commit d998c533 authored by Maël Madon's avatar Maël Madon
Browse files

fix: add an epsilon-tolerence when checking which jobs to submit on a CALL_ME_LATER

parent f65c8046
Branches
Tags
No related merge requests found
Pipeline #5391 passed
......@@ -5,6 +5,8 @@
#include <limits>
#include <string>
#define EPS 0.00001
/* FeedbackUser */
void FeedbackUser::init_FeedbackUser(
std::string name, const rapidjson::Value &param)
......@@ -86,14 +88,15 @@ void FeedbackUser::jobs_to_submit(
profiles = std::list<Profile *>();
/* Add the free sessions starting now to the list of active sessions */
while (!free_sessions.empty() && free_sessions.top()->start_time <= date)
while (!free_sessions.empty() && free_sessions.top()->start_time < date + EPS)
{
active_sessions.push_back(free_sessions.top());
free_sessions.pop();
}
PPK_ASSERT_ERROR(!active_sessions.empty(),
"User %s has been called to sumbit but she has no active session",
user_name.c_str());
"User %s has been called to sumbit but she has no active session."
"Her next_submission date is %f, her next free session start time is %f",
user_name.c_str(), this->date_of_next_submission, free_sessions.top()->start_time);
/* For each active session, add the jobs to submit now to the list `jobs` */
......@@ -107,7 +110,7 @@ void FeedbackUser::jobs_to_submit(
double offset = active_sess->start_time;
while (!job_list->empty()
&& job_list->front()->submission_time + offset <= date)
&& job_list->front()->submission_time + offset < date + EPS)
{
Job *job = new Job(*job_list->front()); // Cast const Job * -> Job *
Profile *job_profile = new Profile();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment