Loading main.py +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ parser.add_argument('-p', '--plot', nargs='+', choices=['power', 'loss', 'pue', choices = ['png', 'svg', 'jpg', 'pdf', 'eps'] parser.add_argument('--imtype', type=str, choices=choices, default=choices[0], help='Plot image type') parser.add_argument('--system', type=str, default='frontier', help='System config to use') choices = ['fcfs', 'sjf', 'prq', 'backfill'] choices = ['fcfs', 'sjf', 'priority', 'backfill'] parser.add_argument('-s', '--schedule', type=str, choices=choices, default=choices[0], help='Schedule policy to use') choices = ['random', 'benchmark', 'peak', 'idle'] parser.add_argument('-w', '--workload', type=str, choices=choices, default=choices[0], help='Type of synthetic workload') Loading raps/policy.py +3 −3 Original line number Diff line number Diff line Loading @@ -5,16 +5,16 @@ class PolicyType(Enum): BACKFILL = 'backfill' DEADLINE = 'deadline' PRIORITY = 'priority' SJF = 'sfj' SJF = 'sjf' class Policy: def __init__(self, strategy): self.strategy = strategy self.strategy = PolicyType(strategy) def sort_jobs(self, jobs): if self.strategy == PolicyType.FCFS or PolicyType.BACKFILL: if self.strategy == PolicyType.FCFS or self.strategy == PolicyType.BACKFILL: return sorted(jobs, key=lambda job: job.submit_time) elif self.strategy == PolicyType.SJF: return sorted(jobs, key=lambda job: job.wall_time) Loading raps/scheduler.py +1 −5 Original line number Diff line number Diff line Loading @@ -168,7 +168,6 @@ class Scheduler: # Mark the job as running job.state = JobState.RUNNING self.running.append(job) if job.id == 22: print('***', job.nodes_required, self.available_nodes, job.scheduled_nodes) def schedule(self, jobs): Loading @@ -195,13 +194,11 @@ class Scheduler: f"{job.wall_time} on nodes {scheduled_nodes}") else: # If the job cannot be scheduled, either try backfilling or requeue it if self.queue and self.policy == PolicyType.BACKFILL: if self.queue and self.policy.strategy == PolicyType.BACKFILL: self.queue.insert(0, job) backfill_job = self.policy.find_backfill_job(self.queue, len(self.available_nodes), self.current_time) if backfill_job: print('here') self.assign_nodes_to_job(backfill_job) self.queue.remove(backfill_job) if self.debug: Loading Loading @@ -233,7 +230,6 @@ class Scheduler: job.state = JobState.COMPLETED if job.state == JobState.RUNNING: # Deal with node that fails during the course of a running job #if any(node in job.scheduled_nodes for node in newly_downed_nodes): if False: # currently disabled b/c not working correctly Loading Loading
main.py +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ parser.add_argument('-p', '--plot', nargs='+', choices=['power', 'loss', 'pue', choices = ['png', 'svg', 'jpg', 'pdf', 'eps'] parser.add_argument('--imtype', type=str, choices=choices, default=choices[0], help='Plot image type') parser.add_argument('--system', type=str, default='frontier', help='System config to use') choices = ['fcfs', 'sjf', 'prq', 'backfill'] choices = ['fcfs', 'sjf', 'priority', 'backfill'] parser.add_argument('-s', '--schedule', type=str, choices=choices, default=choices[0], help='Schedule policy to use') choices = ['random', 'benchmark', 'peak', 'idle'] parser.add_argument('-w', '--workload', type=str, choices=choices, default=choices[0], help='Type of synthetic workload') Loading
raps/policy.py +3 −3 Original line number Diff line number Diff line Loading @@ -5,16 +5,16 @@ class PolicyType(Enum): BACKFILL = 'backfill' DEADLINE = 'deadline' PRIORITY = 'priority' SJF = 'sfj' SJF = 'sjf' class Policy: def __init__(self, strategy): self.strategy = strategy self.strategy = PolicyType(strategy) def sort_jobs(self, jobs): if self.strategy == PolicyType.FCFS or PolicyType.BACKFILL: if self.strategy == PolicyType.FCFS or self.strategy == PolicyType.BACKFILL: return sorted(jobs, key=lambda job: job.submit_time) elif self.strategy == PolicyType.SJF: return sorted(jobs, key=lambda job: job.wall_time) Loading
raps/scheduler.py +1 −5 Original line number Diff line number Diff line Loading @@ -168,7 +168,6 @@ class Scheduler: # Mark the job as running job.state = JobState.RUNNING self.running.append(job) if job.id == 22: print('***', job.nodes_required, self.available_nodes, job.scheduled_nodes) def schedule(self, jobs): Loading @@ -195,13 +194,11 @@ class Scheduler: f"{job.wall_time} on nodes {scheduled_nodes}") else: # If the job cannot be scheduled, either try backfilling or requeue it if self.queue and self.policy == PolicyType.BACKFILL: if self.queue and self.policy.strategy == PolicyType.BACKFILL: self.queue.insert(0, job) backfill_job = self.policy.find_backfill_job(self.queue, len(self.available_nodes), self.current_time) if backfill_job: print('here') self.assign_nodes_to_job(backfill_job) self.queue.remove(backfill_job) if self.debug: Loading Loading @@ -233,7 +230,6 @@ class Scheduler: job.state = JobState.COMPLETED if job.state == JobState.RUNNING: # Deal with node that fails during the course of a running job #if any(node in job.scheduled_nodes for node in newly_downed_nodes): if False: # currently disabled b/c not working correctly Loading