Commit eaea2768 authored by MOMMESSIN Clement's avatar MOMMESSIN Clement
Browse files

[schedulers] Directly reject jobs that do not fit in the platform

parent ca81c4a4
......@@ -248,11 +248,14 @@ class EasyBackfill(BatsimScheduler):
self.listWaitingJob = []
def onJobSubmission(self, just_submitted_job):
current_time = self.bs.time()
self.listWaitingJob.append(just_submitted_job)
# if (self.cpu_snapshot.free_processors_available_at(current_time) >=
# just_submitted_job.requested_resources):
self._schedule_jobs(current_time)
if just_submitted_job.requested_resources > self.bs.nb_compute_resources:
self.bs.reject_jobs([just_submitted_job]) # This job requests more resources than the machine has
else:
current_time = self.bs.time()
self.listWaitingJob.append(just_submitted_job)
# if (self.cpu_snapshot.free_processors_available_at(current_time) >=
# just_submitted_job.requested_resources):
self._schedule_jobs(current_time)
def onJobCompletion(self, job):
current_time = self.bs.time()
......
......@@ -146,8 +146,11 @@ class FcfsSchedSleep(BatsimScheduler):
self.bs.set_resource_state(ProcSet(r1), val)
def onJobSubmission(self, job):
self.open_jobs.append(job)
self.scheduleJobs()
if job.requested_resources > self.bs.nb_compute_resources:
self.bs.reject_jobs([job]) # This job requests more resources than the machine has
else:
self.open_jobs.add(job)
self.scheduleJobs()
def onJobCompletion(self, job):
for res in job.allocation:
......
......@@ -52,8 +52,11 @@ class FillerSched(BatsimScheduler):
print('')
def onJobSubmission(self, job):
self.openJobs.add(job)
self.scheduleJobs()
if job.requested_resources > self.bs.nb_compute_resources:
self.bs.reject_jobs([job]) # This job requests more resources than the machine has
else:
self.openJobs.add(job)
self.scheduleJobs()
def onJobCompletion(self, job):
self.availableResources |= job.allocation
......
......@@ -58,8 +58,10 @@ class FillerSchedWithEvents(BatsimScheduler):
#print('')
def onJobSubmission(self, job):
self.openJobs.add(job)
#self.scheduleJobs()
if job.requested_resources > self.bs.nb_compute_resources:
self.bs.reject_jobs([job]) # This job requests more resources than the machine has
else:
self.openJobs.add(job)
def onJobCompletion(self, job):
# Resources used by the job and that are unavailable should not be added to available resources
......
......@@ -32,8 +32,11 @@ class RandomSched(BatsimScheduler):
self.bs.execute_jobs(scheduledJobs)
def onJobSubmission(self, job):
self.openJobs.add(job)
self.scheduleJobs()
if job.requested_resources > self.bs.nb_compute_resources:
self.bs.reject_jobs([job]) # This job requests more resources than the machine has
else:
self.openJobs.add(job)
self.scheduleJobs()
def onJobCompletion(self, job):
pass
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