diff --git a/src/scheds/HARD_DEFINED_VAR.hpp b/src/scheds/HARD_DEFINED_VAR.hpp index f8115b5c77374bf6c7fc5c7bbdd3ccae6e5227b7..eac0f44b8a4d9a1cc6a85ccddc22743b855ef88a 100644 --- a/src/scheds/HARD_DEFINED_VAR.hpp +++ b/src/scheds/HARD_DEFINED_VAR.hpp @@ -2,4 +2,6 @@ #define NB_CORE_PER_MACHINE 16 #define INITIAL_MACHINE_STATE AWAKE #define PSTATE_AWAKE 0 -#define PSTATE_ASLEEP 1 \ No newline at end of file +#define PSTATE_ASLEEP 1 + +#define EPSILON 0.00001 /* For float rounding issues */ \ No newline at end of file diff --git a/src/users/user_feedback.cpp b/src/users/user_feedback.cpp index a8c748429f52c8b04a5c65cfab9e3852fe9e4639..515f62b5050a046dce1ae512f738f9d903bc4dc3 100644 --- a/src/users/user_feedback.cpp +++ b/src/users/user_feedback.cpp @@ -5,8 +5,6 @@ #include <limits> #include <string> -#define EPS 0.00001 - /* FeedbackUser */ void FeedbackUser::init_FeedbackUser( std::string name, const rapidjson::Value ¶m) @@ -88,7 +86,7 @@ void FeedbackUser::jobs_to_submit( profiles = std::list<const Profile *>(); /* Add the free sessions starting now to the list of active sessions */ - while (!free_sessions.empty() && free_sessions.top()->start_time < date + EPS) + while (!free_sessions.empty() && free_sessions.top()->start_time < date + EPSILON) { active_sessions.push_back(free_sessions.top()); free_sessions.pop(); @@ -110,7 +108,7 @@ void FeedbackUser::jobs_to_submit( double offset = active_sess->start_time; while (!job_list->empty() - && job_list->front()->submission_time + offset < date + EPS) + && job_list->front()->submission_time + offset < date + EPSILON) { shared_ptr<Job> job = shared_ptr<Job>(new Job(*job_list->front())); // Cast const Job * -> shared_ptr<Job> Profile *job_profile = new Profile(); diff --git a/src/users/user_replay.cpp b/src/users/user_replay.cpp index e16f089fd814baf6be4dff664768957a97fabb82..7ccb4208d4ed75abc7f573becfc193c4dace636f 100644 --- a/src/users/user_replay.cpp +++ b/src/users/user_replay.cpp @@ -43,14 +43,14 @@ void ReplayUser::jobs_to_submit( PPK_ASSERT_ERROR(!original_trace->is_empty(), "User %s has been called to sumbit but her job queue is empty", user_name.c_str()); - PPK_ASSERT_ERROR(original_trace->first_job()->submission_time <= date, - "First job in user %s's queue has greater sumbmission time than " - "current date", - user_name.c_str()); + PPK_ASSERT_ERROR(original_trace->first_job()->submission_time < date + EPSILON, + "First job in user %s's queue has greater sumbmission time (%f) than " + "current date (%f)", + user_name.c_str(), original_trace->first_job()->submission_time, date); /* Submit all jobs that have same submit time */ while (!original_trace->is_empty() - && original_trace->first_job()->submission_time <= date) + && original_trace->first_job()->submission_time < date + EPSILON) { /* Cast const Job * into Job * */ shared_ptr<Job> job = shared_ptr<Job>(new Job(*original_trace->first_job()));