Commit 46579ce6 authored by S. Lackner's avatar S. Lackner

[sched] simplify jobs: 'marked_for_' methods are omitted

parent 31165f48
This diff is collapsed.
......@@ -53,7 +53,6 @@ class Resource:
self._pstate = None
self._old_pstate = None
self._pstate_update_in_progress = False
self._pstate_update_request_necessary = False
@property
def id(self):
......@@ -103,7 +102,8 @@ class Resource:
if not self.pstate_update_in_progress:
self._old_pstate = self._pstate
self._pstate_update_request_necessary = True
scheduler._batsim.set_resource_state([self.id], self._pstate)
self._pstate_update_in_progress = True
self._pstate = newval
......@@ -151,17 +151,8 @@ class Resource:
self._old_pstate = self._pstate
self._pstate = pstate
self._pstate_update_in_progress = False
self._pstate_update_request_necessary = False
self._resources_list.update_element(self)
def _do_change_state(self, scheduler):
"""Instruct Batsim to change the state of the resource.
:param scheduler: the scheduler handling this resource
"""
self._pstate_update_request_necessary = False
scheduler._batsim.set_resource_state([self.id], self._pstate)
def _do_add_allocation(self, allocation):
"""Adds an allocation to this resource.
......
......@@ -104,7 +104,7 @@ class BaseBatsimScheduler(BatsimScheduler):
job=newjob, type="job_submission_received")
if newjob.is_dynamic_job:
for job2 in self._scheduler.jobs.dynamically_submitted:
for job2 in self._scheduler.jobs.dynamic_submission_request:
if job.id == job2.id:
newjob.move_properties_from(job2)
self._scheduler.jobs.remove(job2)
......@@ -435,22 +435,6 @@ class Scheduler(metaclass=ABCMeta):
If the _post_schedule method is overridden the super method should be called with:
`super()._post_schedule()`
"""
for r in self._resources:
if r._pstate_update_request_necessary:
r._do_change_state(self)
for j in self.jobs.filter(marked_for_dynamic_submission=True):
j._do_dyn_submit()
for j in self.jobs.marked_for_rejection:
j._do_reject()
for j in self.jobs.marked_for_killing:
j._do_kill()
for j in self.jobs.marked_for_scheduling:
j._do_execute()
if self.jobs.open:
self.debug(
"{num_jobs} jobs open at end of scheduling iteration",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment