Skip to content
Snippets Groups Projects
Commit 5bc8f4a9 authored by Maël Madon's avatar Maël Madon Committed by jgatt
Browse files

fix: more robust CALL_ME_LATER date checking. Related to issue #12

parent 8ac8bc4a
Branches
No related tags found
1 merge request!16Merge request multibehavior
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
#include "../pempek_assert.hpp" #include "../pempek_assert.hpp"
#include "json_workload.hpp" #include "json_workload.hpp"
#include "loguru.hpp" #include "loguru.hpp"
#include <cmath>
#include <limits> #include <limits>
#include <map> #include <map>
#include <math.h>
#include <string> #include <string>
DynScheduler::DynScheduler(Workload *workload, SchedulingDecision *decision, DynScheduler::DynScheduler(Workload *workload, SchedulingDecision *decision,
...@@ -86,7 +88,7 @@ void DynScheduler::make_decisions(double date, ...@@ -86,7 +88,7 @@ void DynScheduler::make_decisions(double date,
/* Time of next_submission might have changed in response to feedback */ /* Time of next_submission might have changed in response to feedback */
double new_date_of_next_submission = broker->next_submission(date); double new_date_of_next_submission = broker->next_submission(date);
if (abs(date - new_date_of_next_submission) < .00001) if (new_date_of_next_submission == lround(date))
{ {
submit_broker_jobs(date); submit_broker_jobs(date);
new_date_of_next_submission = broker->next_submission(date); new_date_of_next_submission = broker->next_submission(date);
...@@ -115,7 +117,7 @@ void DynScheduler::on_requested_call(double date) ...@@ -115,7 +117,7 @@ void DynScheduler::on_requested_call(double date)
ISchedulingAlgorithm::on_requested_call(date); ISchedulingAlgorithm::on_requested_call(date);
/* Check if this call concerns the broker */ /* Check if this call concerns the broker */
if (broker_enabled && abs(date - broker->next_submission(date)) < .00001) if (broker_enabled && broker->next_submission(date) == lround(date))
{ {
/* Handle the jobs to submit */ /* Handle the jobs to submit */
submit_broker_jobs(date); submit_broker_jobs(date);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment