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
d998c533
Commit
d998c533
authored
2 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
fix: add an epsilon-tolerence when checking which jobs to submit on a CALL_ME_LATER
parent
f65c8046
No related branches found
No related tags found
No related merge requests found
Pipeline
#5391
passed
2 years ago
Stage: build-and-test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/users/user_feedback.cpp
+7
-4
7 additions, 4 deletions
src/users/user_feedback.cpp
with
7 additions
and
4 deletions
src/users/user_feedback.cpp
+
7
−
4
View file @
d998c533
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
#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
)
...
@@ -86,14 +88,15 @@ void FeedbackUser::jobs_to_submit(
...
@@ -86,14 +88,15 @@ void FeedbackUser::jobs_to_submit(
profiles
=
std
::
list
<
Profile
*>
();
profiles
=
std
::
list
<
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
)
while
(
!
free_sessions
.
empty
()
&&
free_sessions
.
top
()
->
start_time
<
date
+
EPS
)
{
{
active_sessions
.
push_back
(
free_sessions
.
top
());
active_sessions
.
push_back
(
free_sessions
.
top
());
free_sessions
.
pop
();
free_sessions
.
pop
();
}
}
PPK_ASSERT_ERROR
(
!
active_sessions
.
empty
(),
PPK_ASSERT_ERROR
(
!
active_sessions
.
empty
(),
"User %s has been called to sumbit but she has no active session"
,
"User %s has been called to sumbit but she has no active session."
user_name
.
c_str
());
"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` */
/* For each active session, add the jobs to submit now to the list `jobs` */
...
@@ -107,7 +110,7 @@ void FeedbackUser::jobs_to_submit(
...
@@ -107,7 +110,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
)
&&
job_list
->
front
()
->
submission_time
+
offset
<
date
+
EPS
)
{
{
Job
*
job
=
new
Job
(
*
job_list
->
front
());
// Cast const Job * -> Job *
Job
*
job
=
new
Job
(
*
job_list
->
front
());
// Cast const Job * -> Job *
Profile
*
job_profile
=
new
Profile
();
Profile
*
job_profile
=
new
Profile
();
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in issue
#9 (closed)
·
2 years ago
mentioned in issue
#9 (closed)
mentioned in issue #9
Toggle commit list
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