Successfully reported this slideshow.

Parallel machines


Published on

Published in: Career, Business
  • Be the first to comment

  • Be the first to like this

Parallel machines

  1. 1. Parallel MachinesIn this section we consider scheduling problems in which more than one machineis available for processing the jobs. It does not matter which machine a job isassigned to, but it cannot be processed on more than one machine at the same time.Such machines are known as parallel,k is the time required of machine k by job j. If tj,k1 = tj,k2 = tj for all machines k1 andk2, then they are said to be identical processors. If there exists a constant 0 < Rk ≤ 1associated with each machine k such that tj,k = tj / Rk for all jobs j, then themachines are known as uniform processors. If no such processing rate can beassociated with each machine, the machines are known as independent processors.The rest of this section will consider the special case of parallel identicalprocessors, in which all Rk = 1.Minimizing MakespanMakespan is the total time required to process a set of jobs. In the single machinemodel, this was simply the sum of all processing and idle time, while in themultiple machine model it is the maximum value of this quantity over allmachines.
  2. 2. As a job can be processed on at most one machine at a time, we have thatM ≥ M1 = max{tj : ∀ jobs j},M ≥ M2 = ∑{tj/m : ∀ jobs j}.If preempt-resume is allowed, the following, known as McNaughtons Algorithm[McNaughton, R. Scheduling with deadlines and loss functions. ManagementScience 6.1(1959)] constructs a schedule which achieves one of these bounds andthus is optimal.Determine M = max{M1 , M2}.Arrange the jobs in any arbitrary order.Assign the first M units of time to machine 1, the next M units to machine 2, andso on until all jobs are scheduled.Note that if the division occurs part of the way through a job, then that job isassigned to two machines, its time being preempted on the larger numberedmachine and resumed on the other.
  3. 3. The algorithm may be proven by showing that the resulting schedule is feasible(i.e. no job is scheduled on two machines at the same time, which is guaranteed byM1) and that its makespan is no greater than the larger of M1 and M2 (which isguaranteed by M2).If jobs may not be preempted, no simple algorithm to find an optimal schedule isknown. However, the following heuristic LPT dispatching rule may be used to finda reasonable but not necessarily optimal schedule.Whenever a machine is available, schedule a job requiring the greatest amount oftime.Minimizing Mean FlowtimeLet nk be the number of jobs assigned to machine k, and let tj,k be the time requiredof machine k by job j. Assuming all jobs are initially available, the mean flowtimeof the schedule is ∑∑{tj,k (nk+1−j)/n : ∀ jobs j, ∀ machines k},The following algorithm may be used to schedule a set of n jobs on m parallelidentical processors, minimizing the mean flowtime.If n ≤ m, schedule all jobs on different machines. Otherwise schedule the smallestn−m jobs optimally followed by the largest m jobs all on different machines.
  4. 4. we know that in an optimal schedule the jobs on each machine must be in SPTorder, a condition clearly satisfied by this algorithm. Now suppose some scheduledoes not have the largest m jobs on different machines. Then one machine, say m1,has none of the largest m jobs, while another machine, say m2, has at least two ofthem, say j1 and j2. If i is the last job scheduled on m1, then ti < tj1 ≤ tj2. If weinterchange the scheduled positions of i and j1, then the total flowtime on m1 isincreased by tj1 − ti, while the total flowtime on m2 is decreased by 2 (tj1 − ti) asboth i and j2 finish that much earlier. Thus there is a net decrease in the totalflowtime and the original schedule must not be optimal, thus proving that anyoptimal schedule must have the largest m jobs on different machines. Now supposethe last job on each of two different machines are interchanged. The change in totalflowtime on one machine will be equal and opposite to that on the other machine,and so it does not matter in which order the largest m jobs are assigned to differentmachines.As there is no restriction as to which machines the jobs must be placed on, thisalgorithm can be used to generate many (in fact all) optimal schedules. Thefollowing SPT dispatching rule may also be used to find some, but not all, optimalschedules.Whenever a machine is available, schedule a job requiring the smallestamount of time.Notice that this is the exact opposite of the heuristic for minimizingmakespan.Minimizing Makespan with Precedence ConstraintsNo efficient algorithm is known for the general problem of minimizing makespanwith precedence constraints, although some are known for special cases.
  5. 5. If all processing times are constant, say 1, and the precedence constraints form anassembly forest, then the following, known as Hus algorithm [Hu, T.C. Parallelsequencing and assembly line problems. Operations Research 9.6(1961)] willproduce an optimal schedule.Assign a label Xj to each node j such that Xj = 1 if j is a terminal job, or Xj = 1 + Xi where i is the direct successor of j.Until all jobs are scheduled, if there are fewer than m jobs with no unscheduledpredecessors then schedule the remaining machines with one unit of idle time each,otherwise schedule the m jobs with largest labels and no unscheduled predecessorsto different machines.If preemption is allowed, the following, known as the Muntz-Coffman algorithm[Muntz, R.R.; Coffman, E. Optimal preemptive scheduling on two-processorsystems. IEEE Transactions on Computers 18.11(1969)] may be used witharbitrary precedence constraints, although the solution may be suboptimal for thecase of more than two machines.Assign a label Xj to each job j such that Xj = 1 if j has no successors, and Xj = 1 + max{ Xi : i ← j }.Let K = max{ Xj }.Let Sk = { Xj : Xj = k }.For k = K, K−1, K−2, ... ,1 if |Sk| <m, try to complete Sk by adding jobs withoutunscheduled predecessors, choosing those with largest labels first.Schedule Sk using McNaughtons algorithm.
  6. 6. The previous two algorithms may also be used to schedule jobs with unequalprocessing times if preemption is allowed and if the processing times arecommensurable, by simply subdividing each job j into a string of tj jobs each withunit processing time. The resulting set of jobs may be quite large however.If processor sharing is allowed, and the precedence constraints form an assemblytree, then the following modified version of the Muntz-Coffman algorithm [Muntz,R.R.; Coffman, E. Preemptive scheduling of real-time tasks on multiprocessorsystems. JACM 17.2(1970)] may be used to minimize makespan of a set of jobswith arbitrary processing times on any number of machines.Assign a label Xj to each job j such that Xj = tj if j has no successors, and Xj = tj + max{ Xi : i ← j }.Until all jobs are completed, use the following dispatching rule, the first decisionpoint being the availability of all m machines. Set all Rj = 0. Set m = m, the number of available machines. While m > 0, Let S = { j : Xj ≥ Xi ∀ jobs i }.
  7. 7. Set Rj = min{ 1, m/|S| } ∀ j ∈ S. Reduce m by |S|.Update the labels on each job by reducing Xj by Rj for each unit of scheduled time,until either some job is completed in which case it is removed from furtherconsideration, or until there are two jobs i and j such that Ri < Rj and Xi ≥ Xj.The resulting schedule may be converted into a schedule with identical makespanbut without processor sharing by applying McNaughtons algorithm to each timeinterval delimited by changes in the set of jobs with positive R.