Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
batmen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sepia-pub
mael
batmen
Commits
2c6a79cd
Commit
2c6a79cd
authored
2 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
fix: floating point rounding issue with dates
parent
c225da33
Branches
Branches containing commit
No related tags found
1 merge request
!10
Better memory management and float rounding issues
Pipeline
#5407
passed
2 years ago
Stage: build-and-test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/scheds/HARD_DEFINED_VAR.hpp
+3
-1
3 additions, 1 deletion
src/scheds/HARD_DEFINED_VAR.hpp
src/users/user_feedback.cpp
+2
-4
2 additions, 4 deletions
src/users/user_feedback.cpp
src/users/user_replay.cpp
+5
-5
5 additions, 5 deletions
src/users/user_replay.cpp
with
10 additions
and
10 deletions
src/scheds/HARD_DEFINED_VAR.hpp
+
3
−
1
View file @
2c6a79cd
...
@@ -2,4 +2,6 @@
...
@@ -2,4 +2,6 @@
#define NB_CORE_PER_MACHINE 16
#define NB_CORE_PER_MACHINE 16
#define INITIAL_MACHINE_STATE AWAKE
#define INITIAL_MACHINE_STATE AWAKE
#define PSTATE_AWAKE 0
#define PSTATE_AWAKE 0
#define PSTATE_ASLEEP 1
#define PSTATE_ASLEEP 1
\ No newline at end of file
#define EPSILON 0.00001
/* For float rounding issues */
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/users/user_feedback.cpp
+
2
−
4
View file @
2c6a79cd
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
#include
<limits>
#include
<limits>
#include
<string>
#include
<string>
#define EPS 0.00001
/* FeedbackUser */
/* FeedbackUser */
void
FeedbackUser
::
init_FeedbackUser
(
void
FeedbackUser
::
init_FeedbackUser
(
std
::
string
name
,
const
rapidjson
::
Value
&
param
)
std
::
string
name
,
const
rapidjson
::
Value
&
param
)
...
@@ -88,7 +86,7 @@ void FeedbackUser::jobs_to_submit(
...
@@ -88,7 +86,7 @@ void FeedbackUser::jobs_to_submit(
profiles
=
std
::
list
<
const
Profile
*>
();
profiles
=
std
::
list
<
const
Profile
*>
();
/* Add the free sessions starting now to the list of active sessions */
/* 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
+
EPS
ILON
)
{
{
active_sessions
.
push_back
(
free_sessions
.
top
());
active_sessions
.
push_back
(
free_sessions
.
top
());
free_sessions
.
pop
();
free_sessions
.
pop
();
...
@@ -110,7 +108,7 @@ void FeedbackUser::jobs_to_submit(
...
@@ -110,7 +108,7 @@ void FeedbackUser::jobs_to_submit(
double
offset
=
active_sess
->
start_time
;
double
offset
=
active_sess
->
start_time
;
while
(
!
job_list
->
empty
()
while
(
!
job_list
->
empty
()
&&
job_list
->
front
()
->
submission_time
+
offset
<
date
+
EPS
)
&&
job_list
->
front
()
->
submission_time
+
offset
<
date
+
EPS
ILON
)
{
{
shared_ptr
<
Job
>
job
=
shared_ptr
<
Job
>
(
new
Job
(
*
job_list
->
front
()));
// Cast const Job * -> shared_ptr<Job>
shared_ptr
<
Job
>
job
=
shared_ptr
<
Job
>
(
new
Job
(
*
job_list
->
front
()));
// Cast const Job * -> shared_ptr<Job>
Profile
*
job_profile
=
new
Profile
();
Profile
*
job_profile
=
new
Profile
();
...
...
This diff is collapsed.
Click to expand it.
src/users/user_replay.cpp
+
5
−
5
View file @
2c6a79cd
...
@@ -43,14 +43,14 @@ void ReplayUser::jobs_to_submit(
...
@@ -43,14 +43,14 @@ void ReplayUser::jobs_to_submit(
PPK_ASSERT_ERROR
(
!
original_trace
->
is_empty
(),
PPK_ASSERT_ERROR
(
!
original_trace
->
is_empty
(),
"User %s has been called to sumbit but her job queue is empty"
,
"User %s has been called to sumbit but her job queue is empty"
,
user_name
.
c_str
());
user_name
.
c_str
());
PPK_ASSERT_ERROR
(
original_trace
->
first_job
()
->
submission_time
<
=
date
,
PPK_ASSERT_ERROR
(
original_trace
->
first_job
()
->
submission_time
<
date
+
EPSILON
,
"First job in user %s's queue has greater sumbmission time than "
"First job in user %s's queue has greater sumbmission time
(%f)
than "
"current date"
,
"current date
(%f)
"
,
user_name
.
c_str
());
user_name
.
c_str
()
,
original_trace
->
first_job
()
->
submission_time
,
date
);
/* Submit all jobs that have same submit time */
/* Submit all jobs that have same submit time */
while
(
!
original_trace
->
is_empty
()
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 * */
/* Cast const Job * into Job * */
shared_ptr
<
Job
>
job
=
shared_ptr
<
Job
>
(
new
Job
(
*
original_trace
->
first_job
()));
shared_ptr
<
Job
>
job
=
shared_ptr
<
Job
>
(
new
Job
(
*
original_trace
->
first_job
()));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment