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
1bc3fed5
Commit
1bc3fed5
authored
2 years ago
by
jgatt
Browse files
Options
Downloads
Patches
Plain Diff
optimization of scheduler we sort only if the queue had more than 10 jobs added
parent
e3e2e7f5
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!16
Merge request multibehavior
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/queue.cpp
+11
-0
11 additions, 0 deletions
src/queue.cpp
src/queue.hpp
+3
-1
3 additions, 1 deletion
src/queue.hpp
src/scheds/bin_packing_energy.cpp
+14
-6
14 additions, 6 deletions
src/scheds/bin_packing_energy.cpp
with
28 additions
and
7 deletions
src/queue.cpp
+
11
−
0
View file @
1bc3fed5
...
...
@@ -227,6 +227,17 @@ void Queue::insert_job(const Job *job)
_jobs
.
push_back
(
sjob
);
}
void
Queue
::
insert_sorted_job
(
const
Job
*
job
,
const
SortableJobOrder
::
UpdateInformation
*
update_info
,
const
SortableJobOrder
::
CompareInformation
*
compare_info
){
SortableJob
*
sjob
=
new
SortableJob
;
sjob
->
job
=
job
;
sjob
->
release_date
=
update_info
->
current_date
;
auto
start
=
_jobs
.
begin
();
auto
end
=
_jobs
.
end
();
while
(
start
!=
end
&&
_order
->
compare
((
*
start
),
sjob
,
compare_info
))
{
++
start
;
}
_jobs
.
insert
(
start
,
sjob
);
}
std
::
list
<
SortableJob
*>::
iterator
Queue
::
remove_job
(
const
Job
*
job
)
{
auto
it
=
std
::
find_if
(
_jobs
.
begin
(),
_jobs
.
end
(),
...
...
This diff is collapsed.
Click to expand it.
src/queue.hpp
+
3
−
1
View file @
1bc3fed5
...
...
@@ -106,7 +106,9 @@ public:
/* Insert the job at the beginning of the queue, setting its release_date
* to the job's submission date. */
void
insert_job
(
const
Job
*
job
);
void
insert_sorted_job
(
const
Job
*
job
,
const
SortableJobOrder
::
UpdateInformation
*
update_info
,
const
SortableJobOrder
::
CompareInformation
*
compare_info
);
std
::
list
<
SortableJob
*>::
iterator
remove_job
(
const
Job
*
job
);
std
::
list
<
SortableJob
*>::
iterator
remove_job
(
std
::
list
<
SortableJob
*>::
iterator
job_it
);
void
sort_queue
(
SortableJobOrder
::
UpdateInformation
*
update_info
,
SortableJobOrder
::
CompareInformation
*
compare_info
=
nullptr
);
...
...
This diff is collapsed.
Click to expand it.
src/scheds/bin_packing_energy.cpp
+
14
−
6
View file @
1bc3fed5
...
...
@@ -237,7 +237,7 @@ void BinPackingEnergy::make_decisions(double date,
* Handle recently released jobs from worklaod: put them in the
* queue
**********************************************************************/
bool
modified
_queue
=
false
;
bool
sort
_queue
=
_jobs_released_recently
.
size
()
>=
10
;
for
(
const
std
::
string
&
new_job_id
:
_jobs_released_recently
)
{
const
Job
*
new_job
=
(
*
_workload
)[
new_job_id
];
...
...
@@ -251,8 +251,14 @@ void BinPackingEnergy::make_decisions(double date,
else
{
_queue
->
append_job
(
new_job
,
update_info
);
modified_queue
=
true
;
if
(
sort_queue
)
{
_queue
->
append_job
(
new_job
,
update_info
);
}
else
{
_queue
->
insert_sorted_job
(
new_job
,
update_info
,
nullptr
);
}
}
}
/**********************************************************************
...
...
@@ -262,12 +268,14 @@ void BinPackingEnergy::make_decisions(double date,
* available core)
**********************************************************************/
if
(
modified
_queue
)
if
(
sort
_queue
)
{
_queue
->
sort_queue
(
update_info
,
compare_info
);
}
listofHosts
.
sort
(
HostComparator
());
if
(
_queue
->
nb_jobs
()
>
0
)
{
listofHosts
.
sort
(
HostComparator
());
}
/* Go through the job queue and try to schedule the jobs */
LOG_F
(
1
,
"makedecisions, queue of job has size %d"
,
_queue
->
nb_jobs
());
for
(
auto
job_it
=
_queue
->
begin
();
job_it
!=
_queue
->
end
();)
...
...
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