Commit 0cff1144 authored by rashadul.kabir's avatar rashadul.kabir
Browse files

Implemented aging (wait time) with priority.

parent 69fe602b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,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']
choices = ['fcfs', 'sjf', 'prq', 'prq+ag']
parser.add_argument('--schedule', type=str, choices=choices, default=choices[0], help='Type of schedule to use')
choices = ['random', 'benchmark', 'peak', 'idle']
parser.add_argument('-w', '--workload', type=str, choices=choices, default=choices[0], help='Type of synthetic workload')
+4 −0
Original line number Diff line number Diff line
@@ -276,6 +276,8 @@ class Scheduler:
            self.queue.sort(key=lambda job: job.wall_time)
        elif self.schedule_method == 'prq':
            self.queue.sort(key=lambda job: -job.priority)
        elif self.schedule_method == 'prq+ag':
            self.queue.sort(key=lambda job: -(job.priority+job.wait_time))
    
    def increment_deferred_jobs(self, tasks):
        for task in tasks:
@@ -301,6 +303,8 @@ class Scheduler:
            # print("self.queue: ", len(self.queue))
            # priorities = [job.priority for job in self.queue]
            # print("priorities: ", priorities)
            # priorities_aging = [(job.priority+job.wait_time) for job in self.queue]
            # print("priorities: ", priorities_aging)
            job = self.queue.pop(0)
            synthetic_bool = len(self.available_nodes) >= job.nodes_required
            telemetry_bool = job.requested_nodes and job.requested_nodes[0] in self.available_nodes