Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
batsched
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
poquet
millian
batsched
Commits
3f006800
Commit
3f006800
authored
1 year ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
fix: easy_bf_fast also checks remaining resources at expected start time of priority job
parent
7d465ab0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/algo/easy_bf_fast.cpp
+13
-7
13 additions, 7 deletions
src/algo/easy_bf_fast.cpp
with
13 additions
and
7 deletions
src/algo/easy_bf_fast.cpp
+
13
−
7
View file @
3f006800
...
...
@@ -139,10 +139,11 @@ void EasyBackfillingFast::make_decisions(double date,
job_it
!=
_pending_jobs
.
end
();
)
{
const
Job
*
pending_job
=
*
job_it
;
// Can the job be executed now ?
if
(
pending_job
->
nb_requested_resources
<=
_nb_available_machines
&&
date
+
pending_job
->
walltime
<=
_priority_job_expected_start_time
)
{
// Can the job be executed now (without hindering priority job)?
if
(
pending_job
->
nb_requested_resources
<=
_nb_available_machines
&&
(
date
+
pending_job
->
walltime
<=
_priority_job_expected_start_time
||
pending_job
->
nb_requested_resources
<=
_remaining_resources_at_priority_job_start
))
{
// Yes, it can be backfilled!
alloc
.
machines
=
_available_machines
.
left
(
pending_job
->
nb_requested_resources
);
...
...
@@ -158,11 +159,13 @@ void EasyBackfillingFast::make_decisions(double date,
_nb_available_machines
-=
pending_job
->
nb_requested_resources
;
_current_allocations
[
pending_job
->
id
]
=
alloc
;
job_it
=
_pending_jobs
.
erase
(
job_it
);
if
(
date
+
pending_job
->
walltime
>
_priority_job_expected_start_time
)
_remaining_resources_at_priority_job_start
-=
pending_job
->
nb_requested_resources
;
// Directly get out of the backfilling loop if all machines are busy.
if
(
_nb_available_machines
<=
0
)
break
;
}
}
else
{
++
job_it
;
...
...
@@ -192,9 +195,10 @@ void EasyBackfillingFast::make_decisions(double date,
else
if
(
new_job
->
nb_requested_resources
<=
_nb_available_machines
)
{
//LOG_F(INFO, "There are enough available resources (%d) to execute job %s", _nb_available_machines, new_job->id.c_str());
// Can it be executed now (without hindering priority job
?
)
// Can it be executed now (without hindering priority job)
?
if
(
_priority_job
==
nullptr
||
date
+
new_job
->
walltime
<=
_priority_job_expected_start_time
)
date
+
new_job
->
walltime
<=
_priority_job_expected_start_time
||
new_job
->
nb_requested_resources
<=
_remaining_resources_at_priority_job_start
)
{
//LOG_F(INFO, "Job %s can be started right away!", new_job->id.c_str());
// Yes, the job can be executed right away!
...
...
@@ -213,6 +217,8 @@ void EasyBackfillingFast::make_decisions(double date,
_available_machines
-=
alloc
.
machines
;
_nb_available_machines
-=
new_job
->
nb_requested_resources
;
_current_allocations
[
new_job_id
]
=
alloc
;
if
(
_priority_job
!=
nullptr
&&
date
+
new_job
->
walltime
>
_priority_job_expected_start_time
)
_remaining_resources_at_priority_job_start
-=
new_job
->
nb_requested_resources
;
}
else
{
...
...
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