1.8 KiB
1.8 KiB
Execution flow for Reclaim action
Reclaim runs in each session and the workflow of the session is explained below with the help of diagram.
- In every session, local copies of objects(queues, queueMap, preemptorsMap, preemptorTasks) are created.
- Range over all Jobs
- If Job's Queue is not found, move on to next job
- If found, add queue to queueMap and queues local object.
- Check for Job's Pending tasks,
- If no pending tasks, move on to next job
- If Job has pending tasks, update local objects.
- Check whether queues object is empty
- If queues object is not empty
- Pop out queue from queues object
- If queue is overused, move on to next queue from queues object
- If queue is not overused, check for for jobs which has pending tasks within that queue and select preemptor task
- Pop out queue from queues object
- If queues object is not empty
- Range over all nodes and run predicateFn for preemptor task
- If predicates are not satisfied, move on to next node
- If all the predicates are satisfied
- Range over all tasks running that node but from different queue other than preemptor task's queue and find all reclaimees tasks
- Send preemptor task and set of reclaimees task to ReclaimableFn which has been loaded by following plugins such as conformance, gang and proportion
- ReclaimableFn returns all possible victim tasks that can be evicted
- If number or victim tasks is zero or resource requirement of preemptor task is greater than total resource of all victim tasks, then move on to next node
- If resouce requirement of preemptor task is satisfied, then evict tasks from victim tasks one by one until preemptor task can be pipelined
- Run this until queues object is empty
