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
5b4e30a6
Commit
5b4e30a6
authored
2 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
dev: make scheduler easy_bf into dynamic sched
parent
af873b2c
No related branches found
No related tags found
1 merge request
!5
New dynamic schedulers: fcfs and easy-bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/algo/easy_bf.cpp
+24
-1
24 additions, 1 deletion
src/algo/easy_bf.cpp
src/algo/easy_bf.hpp
+2
-3
2 additions, 3 deletions
src/algo/easy_bf.hpp
with
26 additions
and
4 deletions
src/algo/easy_bf.cpp
+
24
−
1
View file @
5b4e30a6
...
...
@@ -12,7 +12,7 @@ EasyBackfilling::EasyBackfilling(Workload * workload,
ResourceSelector
*
selector
,
double
rjms_delay
,
rapidjson
::
Document
*
variant_options
)
:
I
Schedul
ingAlgorithm
(
workload
,
decision
,
queue
,
selector
,
rjms_delay
,
variant_options
)
Dyn
Schedul
er
(
workload
,
decision
,
queue
,
selector
,
rjms_delay
,
variant_options
)
{
}
...
...
@@ -23,6 +23,9 @@ EasyBackfilling::~EasyBackfilling()
void
EasyBackfilling
::
on_simulation_start
(
double
date
,
const
rapidjson
::
Value
&
batsim_config
)
{
/* Call superclass. If broker enabled, submit jobs date=0. */
DynScheduler
::
on_simulation_start
(
date
,
batsim_config
);
_schedule
=
Schedule
(
_nb_machines
,
date
);
(
void
)
batsim_config
;
}
...
...
@@ -51,12 +54,16 @@ void EasyBackfilling::make_decisions(double date,
if
(
new_job
->
nb_requested_resources
>
_nb_machines
)
{
_decision
->
add_reject_job
(
new_job_id
,
date
);
if
(
broker_enabled
)
broker
->
update_status_if_dyn_job
(
new_job_id
,
KILLED
);
}
else
if
(
!
new_job
->
has_walltime
)
{
LOG_SCOPE_FUNCTION
(
INFO
);
LOG_F
(
INFO
,
"Date=%g. Rejecting job '%s' as it has no walltime"
,
date
,
new_job_id
.
c_str
());
_decision
->
add_reject_job
(
new_job_id
,
date
);
if
(
broker_enabled
)
broker
->
update_status_if_dyn_job
(
new_job_id
,
KILLED
);
}
else
{
...
...
@@ -92,6 +99,10 @@ void EasyBackfilling::make_decisions(double date,
if
(
alloc
.
started_in_first_slice
)
{
_decision
->
add_execute_job
(
new_job_id
,
alloc
.
used_machines
,
date
);
if
(
broker_enabled
)
broker
->
update_status_if_dyn_job
(
new_job_id
,
RUNNING
);
_queue
->
remove_job
(
new_job
);
nb_available_machines
-=
new_job
->
nb_requested_resources
;
}
...
...
@@ -121,6 +132,9 @@ void EasyBackfilling::make_decisions(double date,
if
(
alloc
.
started_in_first_slice
)
{
_decision
->
add_execute_job
(
job
->
id
,
alloc
.
used_machines
,
date
);
if
(
broker_enabled
)
broker
->
update_status_if_dyn_job
(
job
->
id
,
RUNNING
);
job_it
=
_queue
->
remove_job
(
job_it
);
// Updating job_it to remove on traversal
priority_job_after
=
_queue
->
first_job_or_nullptr
();
}
...
...
@@ -134,6 +148,9 @@ void EasyBackfilling::make_decisions(double date,
if
(
alloc
.
started_in_first_slice
)
{
_decision
->
add_execute_job
(
job
->
id
,
alloc
.
used_machines
,
date
);
if
(
broker_enabled
)
broker
->
update_status_if_dyn_job
(
job
->
id
,
RUNNING
);
job_it
=
_queue
->
remove_job
(
job_it
);
}
else
...
...
@@ -144,6 +161,10 @@ void EasyBackfilling::make_decisions(double date,
}
}
}
/* make_decisions from superclass, will in particular take care of sending
* feedback about job status to the users, if broker enabled */
DynScheduler
::
make_decisions
(
date
,
update_info
,
compare_info
);
}
...
...
@@ -180,6 +201,8 @@ void EasyBackfilling::sort_queue_while_handling_priority_job(const Job * priorit
if
(
alloc
.
started_in_first_slice
)
{
_decision
->
add_execute_job
(
priority_job_after
->
id
,
alloc
.
used_machines
,
(
double
)
update_info
->
current_date
);
if
(
broker_enabled
)
broker
->
update_status_if_dyn_job
(
priority_job_after
->
id
,
RUNNING
);
_queue
->
remove_job
(
priority_job_after
);
priority_job_after
=
_queue
->
first_job_or_nullptr
();
could_run_priority_job
=
true
;
...
...
This diff is collapsed.
Click to expand it.
src/algo/easy_bf.hpp
+
2
−
3
View file @
5b4e30a6
...
...
@@ -2,12 +2,11 @@
#include
<list>
#include
"../isalgorithm.hpp"
#include
"../json_workload.hpp"
#include
"../broker/dynscheduler.hpp"
#include
"../locality.hpp"
#include
"../schedule.hpp"
class
EasyBackfilling
:
public
I
Schedul
ingAlgorithm
class
EasyBackfilling
:
public
Dyn
Schedul
er
{
public:
EasyBackfilling
(
Workload
*
workload
,
SchedulingDecision
*
decision
,
Queue
*
queue
,
ResourceSelector
*
selector
,
...
...
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