diff --git a/src/users/user_feedback.cpp b/src/users/user_feedback.cpp index 2d539f95665a08806139cb6286fffd06e01c728d..bdf922ea03d2459a11b7ad7d2d52598b33e645f2 100644 --- a/src/users/user_feedback.cpp +++ b/src/users/user_feedback.cpp @@ -5,6 +5,8 @@ #include <limits> #include <string> +#define EPS 0.00001 + /* FeedbackUser */ void FeedbackUser::init_FeedbackUser( std::string name, const rapidjson::Value ¶m) @@ -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();