Parallel task scheduling

From HandWiki
Revision as of 18:50, 6 February 2024 by Rtexter1 (talk | contribs) (simplify)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Optimization problem in computer science

Parallel task scheduling (also called parallel job scheduling[1][2] or parallel processing scheduling[3]) is an optimization problem in computer science and operations research. It is a variant of optimal job scheduling. In a general job scheduling problem, we are given n jobs J1J2, ..., Jn of varying processing times, which need to be scheduled on m machines while trying to minimize the makespan - the total length of the schedule (that is, when all the jobs have finished processing). In the specific variant known as parallel-task scheduling, all machines are identical. Each job j has a length parameter pj and a size parameter qj, and it must run for exactly pj time-steps on exactly qj machines in parallel.

Veltman et al.[4] and Drozdowski[3] denote this problem by [math]\displaystyle{ P|size_j|C_{\max} }[/math] in the three-field notation introduced by Graham et al.[5] P means that there are several identical machines running in parallel; sizej means that each job has a size parameter; Cmax means that the goal is to minimize the maximum completion time. Some authors use [math]\displaystyle{ P|m_j|C_{\max} }[/math] instead.[1] Note that the problem of parallel-machines scheduling is a special case of parallel-task scheduling where [math]\displaystyle{ size_j=1 }[/math] for all j, that is, each job should run on a single machine.

The origins of this problem formulation can be traced back to 1960.[6] For this problem, there exists no polynomial time approximation algorithm with a ratio smaller than [math]\displaystyle{ 3/2 }[/math] unless [math]\displaystyle{ P=NP }[/math].[citation needed]

Definition

There is a set [math]\displaystyle{ \mathcal{J} }[/math] of [math]\displaystyle{ n }[/math] jobs, and [math]\displaystyle{ m }[/math] identical machines. Each job [math]\displaystyle{ j \in \mathcal{J} }[/math] has a processing time [math]\displaystyle{ p_j \in \mathbb{N} }[/math] (also called the length of j), and requires the simultaneous use of [math]\displaystyle{ q_j\in \mathbb{N} }[/math] machines during its execution (also called the size or the width of j).

A schedule assigns each job [math]\displaystyle{ j \in \mathcal{J} }[/math] to a starting time [math]\displaystyle{ s_j \in \mathbb{N}_0 }[/math] and a set [math]\displaystyle{ m_j \subseteq \{1,\dots,m\} }[/math] of [math]\displaystyle{ |m_j| = q_j }[/math] machines to be processed on. A schedule is feasible if each processor executes at most one job at any given time. The objective of the problem denoted by [math]\displaystyle{ P|size_j|C_{\max} }[/math] is to find a schedule with minimum length [math]\displaystyle{ C_{\max}= \max_{j \in \mathcal{J}}(s_j+p_j) }[/math], also called the makespan of the schedule. A sufficient condition for the feasibility of a schedule is the following

[math]\displaystyle{ \sum_{j \in \mathcal{J}, s_j \leq t \lt s_j+p_j}q_j \leq m \, \forall t \in \{s_1, \dots, s_n\} }[/math].

If this property is satisfied for all starting times, a feasible schedule can be generated by assigning free machines to the jobs at each time starting with time [math]\displaystyle{ t = 0 }[/math].[1][2] Furthermore, the number of machine intervals used by jobs and idle intervals at each time step can be bounded by [math]\displaystyle{ |\mathcal{J}| + 1 }[/math].[1] Here a machine interval is a set of consecutive machines of maximal cardinality such that all machines in this set are processing the same job. A machine interval is completely specified by the index of its first and last machine. Therefore, it is possible to obtain a compact way of encoding the output with polynomial size.

Computational hardness

This problem is NP-hard even when there are only two machines and the sizes of all jobs are [math]\displaystyle{ q_j=1 }[/math] (i.e., each job needs to run only on a single machine). This special case, denoted by [math]\displaystyle{ P2||C_{\max} }[/math], is a variant of the partition problem, which is known to be NP-hard.

When the number of machines m is at most 3, that is: for the variants [math]\displaystyle{ P2|size_j|C_{\max} }[/math] and [math]\displaystyle{ P3|size_j|C_{\max} }[/math], there exists a pseudo-polynomial time algorithm, which solves the problem exactly.[7]

In contrast, when the number of machines is at least 4, that is: for the variants [math]\displaystyle{ Pm|size_j|C_{\max} }[/math] for any [math]\displaystyle{ m \geq 4 }[/math], the problem is also strongly NP-hard[8] (this result improved a previous result[7] showing strong NP-hardness for [math]\displaystyle{ m \geq 5 }[/math]).

If the number of machines is not bounded by a constant, then there can be no approximation algorithm with an approximation ratio smaller than [math]\displaystyle{ 3/2 }[/math] unless [math]\displaystyle{ P = NP }[/math]. This holds even for the special case in which the processing time of all jobs is [math]\displaystyle{ p_j=1 }[/math], since this special case is equivalent to the bin packing problem: each time-step corresponds to a bin, m is the bin size, each job corresponds to an item of size qj, and minimizing the makespan corresponds to minimizing the number of bins.

Variants

Several variants of this problem have been studied.[3] The following variants also have been considered in combination with each other.

Contiguous jobs: In this variant, the machines have a fixed order [math]\displaystyle{ (M_1, \dots, M_m) }[/math]. Instead of assigning the jobs to any subset [math]\displaystyle{ m_j \subseteq \{M_1,\dots,M_m\} }[/math], the jobs have to be assigned to a contiguous interval of machines. This problem corresponds to the problem formulation of the strip packing problem.

Multiple platforms: In this variant, the set of machines is partitioned into independent platforms. A scheduled job can only use the machines of one platform and is not allowed to span over multiple platforms when processed.

Moldable jobs: In this variant each job [math]\displaystyle{ j \in \mathcal{J} }[/math] has a set of feasible machine-counts [math]\displaystyle{ D_j \subseteq \{1, \dots m\} }[/math]. For each count [math]\displaystyle{ d \in D_j }[/math], the job can be processed on d machines in parallel, and in this case, its processing time will be [math]\displaystyle{ p_{j,d} }[/math]. To schedule a job [math]\displaystyle{ j \in \mathcal{J} }[/math], an algorithm has to choose a machine count [math]\displaystyle{ d \in D_j }[/math] and assign j to a starting time [math]\displaystyle{ s_j }[/math] and to [math]\displaystyle{ d }[/math] machines during the time interval [math]\displaystyle{ [s_j,s_j+p_{j,d}). }[/math] A usual assumption for this kind of problem is that the total workload of a job, which is defined as [math]\displaystyle{ d \cdot p_{j,d} }[/math], is non-increasing for an increasing number of machines.

Release dates: In this variant, denoted by [math]\displaystyle{ P|size_j,r_j|C_{\max} }[/math], not all jobs are available at time 0; each job j becomes available at a fixed and known time rj. It must be scheduled after that time.

Preemption: In this variant, denoted by [math]\displaystyle{ P|size_j,r_j,\text{pmtn}|C_{\max} }[/math], it is possible to interrupt jobs that are already running, and schedule other jobs that become available at that time.

Algorithms

The list scheduling algorithm by Garey and Graham[9] has an absolute ratio [math]\displaystyle{ 2 }[/math], as pointed out by Turek et al.[10] and Ludwig and Tiwari.[11] Feldmann, Sgall and Teng[12] observed that the length of a non-preemptive schedule produced by the list scheduling algorithm is actually at most [math]\displaystyle{ (2-1/m) }[/math] times the optimum preemptive makespan. A polynomial-time approximation scheme (PTAS) for the case when the number [math]\displaystyle{ m }[/math] of processors is constant, denoted by [math]\displaystyle{ Pm|size_j|C_{\max} }[/math], was presented by Amoura et al.[13] and Jansen et al.[14] Later, Jansen and Thöle [2] found a PTAS for the case where the number of processors is polynomially bounded in the number of jobs. In this algorithm, the number of machines appears polynomially in the time complexity of the algorithm. Since, in general, the number of machines appears only in logarithmic in the size of the instance, this algorithm is a pseudo-polynomial time approximation scheme as well. A [math]\displaystyle{ (3/2+\varepsilon) }[/math]-approximation was given by Jansen,[15] which closes the gap to the lower bound of [math]\displaystyle{ 3/2 }[/math] except for an arbitrarily small [math]\displaystyle{ \varepsilon }[/math].

Differences between contiguous and non-contiguous jobs

Given an instance of the parallel task scheduling problem, the optimal makespan can differ depending on the constraint to the contiguity of the machines. If the jobs can be scheduled on non-contiguous machines, the optimal makespan can be smaller than in the case that they have to be scheduled on contiguous ones. The difference between contiguous and non-contiguous schedules has been first demonstrated in 1992[16] on an instance with [math]\displaystyle{ n=8 }[/math] tasks, [math]\displaystyle{ m=23 }[/math] processors, [math]\displaystyle{ C^{nc}_{\max}=17 }[/math], and [math]\displaystyle{ C^c_{\max}=18 }[/math]. Błądek et al.[17] studied these so-called c/nc-differences and proved the following points:

  • For a c/nc-difference to arise, there must be at least three tasks with [math]\displaystyle{ q_j \gt 1. }[/math]
  • For a c/nc-difference to arise, there must be at least three tasks with [math]\displaystyle{ p_j\gt 1. }[/math]
  • For a c/nc-difference to arise, at least [math]\displaystyle{ m=4 }[/math] processors are required (and there exists an instance with a c/nc-difference with [math]\displaystyle{ m=4 }[/math]).
  • For a c/nc-difference to arise, the non-contiguous schedule length must be at least [math]\displaystyle{ C^{nc}_{\max}=4. }[/math]
  • The maximal c/nc-difference [math]\displaystyle{ \sup_{I}C^{c}_{\max}(I)/C^{nc}_{\max}(I) }[/math] is at least [math]\displaystyle{ 5/4 }[/math] and at most [math]\displaystyle{ 2. }[/math]
  • To decide whether there is an c/nc-difference in a given instance is NP-complete.

Furthermore, they proposed the following two conjectures, which remain unproven:

  • For a c/nc-difference to arise, at least [math]\displaystyle{ n=7 }[/math] tasks are required.
  • [math]\displaystyle{ \sup_{I}C^{c}_{\max}(I)/C^{nc}_{\max}(I) = 5/4 }[/math]

Related problems

There are related scheduling problems in which each job consists of several operations, which must be executed in sequence (rather than in parallel). These are the problems of open shop scheduling, flow shop scheduling and job shop scheduling.

References

  1. 1.0 1.1 1.2 1.3 Johannes, Berit (2006-10-01). "Scheduling parallel jobs to minimize the makespan" (in en). Journal of Scheduling 9 (5): 433–452. doi:10.1007/s10951-006-8497-6. ISSN 1099-1425. 
  2. 2.0 2.1 2.2 Jansen, Klaus.; Thöle, Ralf. (2010-01-01). "Approximation Algorithms for Scheduling Parallel Jobs". SIAM Journal on Computing 39 (8): 3571–3615. doi:10.1137/080736491. ISSN 0097-5397. 
  3. 3.0 3.1 3.2 Drozdowski, Maciej (2009). "Scheduling for Parallel Processing" (in en-gb). Computer Communications and Networks. doi:10.1007/978-1-84882-310-5. ISBN 978-1-84882-309-9. ISSN 1617-7975. 
  4. Veltman, B; Lageweg, B. J; Lenstra, J. K (1990-12-01). "Multiprocessor scheduling with communication delays" (in en). Parallel Computing 16 (2): 173–182. doi:10.1016/0167-8191(90)90056-F. ISSN 0167-8191. https://ir.cwi.nl/pub/5713. 
  5. Graham, R. L.; Lawler, E. L.; Lenstra, J.K.; Rinnooy Kan, A.H.G. (1979). "Optimization and Approximation in Deterministic Sequencing and Scheduling: a Survey". Elsevier. pp. (5) 287–326. http://mat.uab.es/~alseda/MasterOpt/79_03_scheduling_survey.pdf. 
  6. Codd, E. F. (1960-06-01). "Multiprogram scheduling" (in EN). Communications of the ACM 3 (6): 347–350. doi:10.1145/367297.367317. 
  7. 7.0 7.1 Du, Jianzhong.; Leung, Joseph Y.-T. (1 November 1989). "Complexity of Scheduling Parallel Task Systems". SIAM Journal on Discrete Mathematics 2 (4): 473–487. doi:10.1137/0402042. ISSN 0895-4801. 
  8. Henning, Sören; Jansen, Klaus; Rau, Malin; Schmarje, Lars (1 January 2020). "Complexity and Inapproximability Results for Parallel Task Scheduling and Strip Packing" (in en). Theory of Computing Systems 64 (1): 120–140. doi:10.1007/s00224-019-09910-6. ISSN 1433-0490. 
  9. Garey, M. R.; Graham, R. L. (1 June 1975). "Bounds for Multiprocessor Scheduling with Resource Constraints". SIAM Journal on Computing 4 (2): 187–200. doi:10.1137/0204015. ISSN 0097-5397. 
  10. Turek, John; Wolf, Joel L.; Yu, Philip S. (in EN). Approximate algorithms scheduling parallelizable tasks | Proceedings of the fourth annual ACM symposium on Parallel algorithms and architectures. doi:10.1145/140901.141909. 
  11. Ludwig, Walter; Tiwari, Prasoon (1994). "Scheduling malleable and nonmalleable parallel tasks | Proceedings of the fifth annual ACM-SIAM symposium on Discrete algorithms" (in EN). Fifth Annual {ACM-SIAM} Symposium on Discrete Algorithms (SODA): 167–176. http://dl.acm.org/citation.cfm?id=314464.314491. 
  12. Feldmann, Anja; Sgall, Jiří; Teng, Shang-Hua (1 August 1994). "Dynamic scheduling on parallel machines" (in en). Theoretical Computer Science 130 (1): 49–72. doi:10.1016/0304-3975(94)90152-X. ISSN 0304-3975. 
  13. Amoura, Abdel Krim; Bampis, Evripidis; Kenyon, Claire; Manoussakis, Yannis (1 February 2002). "Scheduling Independent Multiprocessor Tasks" (in en). Algorithmica 32 (2): 247–261. doi:10.1007/s00453-001-0076-9. ISSN 1432-0541. 
  14. Jansen, Klaus; Porkolab, Lorant (1 March 2002). "Linear-Time Approximation Schemes for Scheduling Malleable Parallel Tasks" (in en). Algorithmica 32 (3): 507–520. doi:10.1007/s00453-001-0085-8. ISSN 1432-0541. 
  15. Jansen, Klaus (2012). "A(3/2+ε) approximation algorithm for scheduling moldable and non-moldable parallel tasks | Proceedings of the twenty-fourth annual ACM symposium on Parallelism in algorithms and architectures" (in EN). 24th {ACM} Symposium on Parallelism in Algorithms and Architectures,{SPAA}. doi:10.1145/2312005.2312048. 
  16. (in EN) Approximate algorithms scheduling parallelizable tasks | Proceedings of the fourth annual ACM symposium on Parallel algorithms and architectures. doi:10.1145/140901.141909. 
  17. Błądek, Iwo; Drozdowski, Maciej; Guinand, Frédéric; Schepler, Xavier (1 October 2015). "On contiguous and non-contiguous parallel task scheduling" (in en). Journal of Scheduling 18 (5): 487–495. doi:10.1007/s10951-015-0427-z. ISSN 1099-1425.