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
a9c903cc
Commit
a9c903cc
authored
2 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
doc: cosmetics in bin_backing_energy
parent
d06890e5
No related branches found
No related tags found
1 merge request
!16
Merge request multibehavior
Pipeline
#5825
passed
2 years ago
Stage: build-and-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scheds/bin_packing_energy.cpp
+10
-15
10 additions, 15 deletions
src/scheds/bin_packing_energy.cpp
with
10 additions
and
15 deletions
src/scheds/bin_packing_energy.cpp
+
10
−
15
View file @
a9c903cc
...
...
@@ -258,20 +258,18 @@ void BinPackingEnergy::make_decisions(double date,
}
}
}
/**********************************************************************
* Binpacking scheduling decision:
* Sort jobs in decreasing number of requested cores
* (DescendingSizeOrder) and hosts in our custom order (~ increasing
* available core)
**********************************************************************/
LOG_F
(
1
,
"makedecisions, queue of job has size %d"
,
_queue
->
nb_jobs
());
if
(
sort_queue
)
{
_queue
->
sort_queue
(
update_info
,
compare_info
);
}
/**********************************************************************
* Binpacking scheduling decision:
* Go through the job queue and try to schedule the jobs
**********************************************************************/
if
(
_queue
->
nb_jobs
()
>
0
)
{
/* Go through the job queue and try to schedule the jobs */
bin_packing_algo
(
date
);
}
...
...
@@ -319,24 +317,21 @@ void BinPackingEnergy::make_decisions(double date,
void
BinPackingEnergy
::
bin_packing_algo
(
double
date
)
{
/**********************************************************************
* Binpacking scheduling decision:
* Sort jobs in decreasing number of requested cores
* (DescendingSizeOrder) and hosts in our custom order (~ increasing
* available core)
**********************************************************************/
/* Binpacking main algo:
* Go through jobs in decreasing number of requested cores (DescendingSizeOrder)
* and hosts in our custom order (~ increasing available core) */
listofHosts
.
sort
(
HostComparator
());
bool
host_found
=
true
;
int
previous_job_requested_resources
=
((
*
(
_queue
->
begin
()))
->
job
)
->
nb_requested_resources
;
for
(
auto
job_it
=
_queue
->
begin
();
job_it
!=
_queue
->
end
();)
{
const
Job
*
job
=
(
*
job_it
)
->
job
;
/* Optimization part, can be removed if it created bugs
* If the previous job had the same size as the considered job
* and didn't find a host we skip the bin-packing step for this job
* If the previous job was of size 1 then that means that all host are full so
* we end the algorithm */
if
(
!
(
host_found
)
&&
(
previous_job_requested_resources
==
job
->
nb_requested_resources
)){
if
(
previous_job_requested_resources
==
1
){
return
;
...
...
@@ -447,4 +442,4 @@ void BinPackingEnergy::update_machine_states(double date)
mit
=
states_to_switch
.
erase
(
mit
);
}
}
\ No newline at end of file
}
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