Disclaimer and Legal Information

Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purposes or for creating new collective works for resale or redistribution to servers or lists or to reuse any copyrighted component of this work in other works must be obtained from the IEEE. All opinions expressed in this document are those of the author individually and are not reflective or indicative of the opinions and positions of any author’s present or past employer and/or its affiliated companies (hereinafter referred to as “employer”). The technology described in this document is or could be under development and is being presented solely for the purpose of soliciting feedback. The content and any information in this document shall in no way be regarded as a warranty or guarantee of conditions of characteristics. This document reflects the current state of the subject matter and may unilaterally be changed by the employer at any time according to its entitlement to dispose. Unless otherwise formally agreed with the entitled employer, the employer assumes no warranties or liabilities of any kind, including without limitation warranties of non-infringement of intellectual property rights of any third party with respect to the content and information given in this document.

A Distributed Hardware Algorithm for Scheduling Dependent Tasks on Multicore Architectures Lorenzo Di Gregorio Infineon Technologies AG Munich, Germany

Abstract—We present a novel hardware algorithm for scheduling tasks with dependency constraints on multicore architectures. This algorithm provides a deadlock-free scheduling over a large class of architectures by employing a generalization of a fundamental algorithm by Tomasulo. Performance measurements show that the proposed algorithm can deliver higher performance than a large increase in the number of processing cores. Several authors have already pointed out how the “threads” model of computation can lead to a painstaking and error-prone programming process. Our approach does not preclude backward compatibility and the use of traditional techniques, but still supports a different and more advanced programming model, which is generally better suited for many complex embedded multicore systems. Index Terms—Scheduling, Sequencing, Tomasulo, Multicore.

I. I NTRODUCTION Recently the industry has been moving toward multithreaded and multicore architectures in the hope of exploiting parallelism rather than pushing on crude performance: there is growing evidence across the semiconductor industry that the number of cores per chip doubles at least every three years. Many embedded multicore architectures resemble the block diagram of Figure 1: one control processor executes a management software and delegates the processing of data streams by dispatching tasks to a data plane of specialized cores. It has been just the need for introducing processor cores into the data-planes of programmable chip architectures, that has driven several developments of the last decade in the field of embedded microprocessors. These data-plane processor cores may be equipped with memories, accelerators or coprocessors which can be shared within restricted local pools, hence the control flow of an application must actually migrate across the processors and may itself dispatch further tasks to the dataplane. Such architectures are typical of network processors and graphic processors, but get widely employed whenever the applications provide enough parallelism and the computation demands exceed the capabilities of standard processors. For programming such parallel architectures, the threads model of computation seemed a straightforward and relatively small step from the conventional models, but it has faced surprising difficulties in establishing itself within the mainstream programming practices. According to Lee [1], the large amount of concurrency allowed within the thread model is actually excessive: he points out that synchronization primitives such as semaphores or barriers have turned out to be alien and deceptive to programmers, while techniques for the

Figure 1.

Example of one embedded multicore architecture

automatic extraction of concurrency are still far from achieving maturity. As a consequence of the lacking focus and magnitude in demand, multithreading has typically received only indispensable hardware support and most of its problems must be handled by software layers. Rather than insisting on thread parallelism, developers have been recently focusing on task parallelism, also known as function parallelism. For example, the recent OpenMP 3.0 specification introduces a task model [2]. We stress the point that the bookkeeping and sequencing activities required to schedule tasks should be a hardware duty and to this purpose we propose a novel hardware-based scheduling management infrastructure with a twofold purpose: • •

retaining backward compatibility with legacy firmware and traditional programming models, offering the possibility of a gradual transition to a different programming model, by delegating part of the event management to the hardware layer.

We employ a distributed network of small hardware devices associated to the processing cores of the data plane. Every processing core interacts with its associated hardware unit by means of three operations: “declare”, “provide” and “require”. These operations are directly related to the conventional concepts of function call, value write and value read and can be as simple as memory-mapped accesses to the associated hardware units. Other structures for increased efficiency are

equally possible, e.g. these units can be connected to the exception mechanism or to the context switch services of more sophisticated processor cores In contrast to conventional synchronization techniques, what this setup actually provides is a sequencing capability in hardware: this is key to hiding from the software all the event passing and enforcing sequences over code chunks. Yet, this sequencing support can still provide conventional mutex and barrier synchronization. II. E XAMPLES In this section we show some programming use cases. We want to schedule functions over a generic network of processing cores and in order to operate, we require that these functions get annotated to identify which shared resources are accessed by them. On issuing a function to one core of the network, we first state which resources might need to be read within the body of the function and which resources shall be released by the function. This purpose is served by the operation DECLARE((p1 , · · · , pn ), (r1 , · · · , rm )), which states that the function being entered might request access to the resources associated to the variables r1 , · · · , rm and at any time before terminating it shall release the resources associated to the variables p1 , · · · , pn . It is legal to release a resource which has not been requested. It is the operation REQUIRE(ri , · · · , rj ) which actually requests access to the resources associated to the variables ri , · · · , rj and stalls the execution until all these resources are released. A non-blocking variant can be implemented as well. The operation PROVIDE(pi , · · · , pj ) releases the resources associated to the variables pi , · · · , pj . This programming model is known as task model and every properly annotated function is considered a task. Tasks can call other functions or further tasks. loop (x0 , x1 ) ⇐ task(x0 , x1 ) end loop (x0 , x1 ) = task(x0 , x1 ) { DECLARE((x0 , x1 ),(x0 , x1 )) REQUIRE(x0 ) use device 0 PROVIDE(x0 ) ··· REQUIRE(x1 ) use device 1 PROVIDE(x1 ) ··· } Figure 2.

Declaration, requirements and provisions

The algorithm in Figure 2 shows an example of an endless loop on a task in charge of accessing two devices. If the

iterations are distributed to parallel processing entities, it is well known that Dijkstra’s classical dining philosophers problem could lead to a deadlock or a livelock in the system if the two devices are interacting. To prevent this situation, our algorithm ensures in hardware that whenever any task accesses x0 , that same task is guaranteed at some point in time in the future to get access to x1 with the same task access order which has been applied to x0 . In this example we declare that in the body of the task we might require x0 and x1 and we shall provide x0 and x1 . Subsequently, we do actually require access to device 0 (REQUIRE(x0 )) and release it (PROVIDE(x0 )) after having used it. When we will get to the point of requiring to access device 1 (REQUIRE(x1 )), we can be sure that this access gets granted with the same task order which has been applied to device 0. Require: packet arrival indication DECLARE((x3 , x4 ),(x3 , x4 )) REQUIRE(x3 ) // packet available on input channel repeat // search for a free queue entry to load the packet DECLARE((x5 ),(x5 )) REQUIRE(x5 ) if queue entry is locked then PROVIDE(x5 ) select another queue entry end if until unlocked queue entry found lock queue entry PROVIDE(x5 ) transfer from input channel to queue entry PROVIDE(x3 ) ··· process packet ··· REQUIRE(x4 ) forward packet to output channel PROVIDE(x4 ) unlock queue entry Figure 3.

An example of in-order processing around a lock

A more complex example is provided by the algorithm in Figure 3: a packet handler is triggered on packet arrivals and starts concurrently on different processors. It must fetch the packet from an input channel, store it into a queue, process it and forward it to an output channel. To avoid reassembly on the communication peers, the departure order of the packets must be the same as their arrival order. Still, the enqueuing and dequeuing must be carried out out of order to exploit the memory bandwidth. We associate x3 to one input channel, x4 to one output channel and x5 to the memory queue. x3 and x4 are handled as x0 and x1 in the algorithm of Figure 2. The repeat-until loop looks for a free entry in a queue to store the packet and forms an exclusive lock. Nevertheless, parallel instances of

this algorithm will not deadlock while locking both the input channel and the queue because they present mutual exclusion with respect to x5 but also present sequencing with respect to x3 . Furthermore, the packet order will not be changed, despite of different processing times, because the sequencing on x3 also applies to x4 . III. R ELATED W ORK Our hardware algorithm schedules sequences of tasks of the form (pi,1 , · · · , pi,n ) = fi (ri,1 , · · · , ri,m ) with dependencies expressed by equalities rj,x = pi,y , j > i. Our approach merely requires that the fi get annotated with respect to the inputs and outputs which are relevant for the synchronization. The idea of annotating functions and scheduling them on the basis of data dependencies, instead of scheduling threads on the basis of synchronization barriers, has been proposed by Bellens et al. in [3] for extracting parallelism in the compilation of software for the Cell BE architecture. Since our work focuses on a hardware implementation rather than on compilation, we employ an elaboration for multicore systems of the classical hardware algorithm by Tomasulo [4], [5]. In terms of the original algorithm’s formulation, we regard every fi as a large microcoded instruction whose inputs are ri,1 , · · · , ri,m and whose outputs are pi,1 , · · · , pi,n . Interestingly, Duran et al. propose in [6] to extend the tasking model of OpenMP 3.0 to dependent tasks and to detect the dependencies at runtime. For this purpose, Perez et al. present in [7] a bundle of compiler and runtime library, called SMPSs, which employs dependency renaming as provided by Tomasulo’s algorithm. They indicate that for a good performance with their software solution, a granularity of considerably more than 105 cycles execution time is required. While we are aware from own experience that a much smaller granularity is well performing on protocol stack workloads, Stensland et al. provide in [8] a strong indication that, in order to reduce the overhead of the inter-core communication, this much smaller granularity should be the one of choice also for scheduling media applications on multicore architectures. Within the software domain, the handling of both nested tasks and dependent tasks is still a partially open issue: Cilk [9] (now commercially evolved in Cilk++), a task-based programming environment for recursive decomposition, supports nested tasks with task dependencies, but requires barriers to return values across the task recursion levels. OpenMP 3.0 [10] supports nested tasks but no task dependencies, while SMPSs [7] supports task dependencies but replaces nested tasks with conventional function calls. The hardware algorithm that we propose, supports the scheduling of nested tasks along with task dependencies and does not strictly require barriers, although it requires including the remaining of a task after a spawning within a subtask in order to correctly receive values from the spawned task. Our work is also very loosely related to the analysis of Salverda and Zilles [11] about instruction scheduling to multiple cores from typical general purpose workloads: indeed one could regard our work as core fusion at the granularity of

small or medium size functions rather than at the instruction level granularity as in [11]. IV. A LGORITHM A task is described by its functionality (p1 , · · · , pn ) = f (r1 , · · · , rm ), the times tr1 , · · · , trm associated to the reads of its inputs r1 , · · · , rm and the times tp1 , · · · , tpn associated to r) represents writes of its outputs p1 , · · · , pn . The form p¯ = f (¯ a function and we term its input and output variables “events” in accordance with much literature on concurrent computation: we highlight that in this paper we disregard the values of the events and are only concerned with their access times. In the context of this work, we define as declaration of a function its issue to the multicore data plane, as requirement the reading of ry at try and as provision the writing of px at tpx . With this notation we can pose the scheduling problem with the implicit requirement that tasks may not deadlock or livelock. Definition 1 (scheduling problem): For every pair of tasks fi and fj in an ordered sequence f1 , · · · , fk with i < j, for every provision px of fi and requirement ry of fj such that px = ry , a valid schedule must hold fj on its requirement of ry until try ≥ tpx . The scheme in Figure 4 represents the components of the hardware layer for supporting the scheduling. The DECLARE, REQUIRE and PROVIDE operations are issued by the cores and control the M units. The M units interact with each other and decide whether to stall their associated cores until all outstanding requirements have been provided. The components shown in Figure 4 are: • a plurality of (virtual) processing cores, which can be a hardware accelerator, a processor or a virtual processor, intended as thread-reduced version of the underlaying physical processor. • a multicore unit M per processing core, which contains the proper hardware implementation of the scheduling algorithm, based on a very small content-addressed memory, called requirement table R, contained in M and addressed by event. • an event file E, which is a central store area for events to get passed across the network of M units. • a sequencing bus (Q-bus), which is a generic serial bus for serially issuing declarations over the network of M units. • a broadcasting bus (B-bus), which is a generic parallel bus for broadcasting several provisions in any order over the network. Two further abstract agents are necessary to get the system running: • a communication backbone between the cores, which is any communication structure for allowing the cores to pass data and control to each other. • a task dispatcher, which is any software or hardware structure to dispatch tasks to the cores, e.g. one program running on a control processor. It is pretty straightforward to compare this structure with Tomasulo’s one and observe that the event file plays the role of

a lock, but the whole handling would destroy the simplicity of the task-based scheduling which we achieve by the colored events. In the next three sections we provide an abstract description of how the fundamental operations are implemented in the M units. Obviously, the physical implementation requires additional logic for bus access etc.

Figure 4.

Hardware units employed for supporting the scheduling

the register file, the M units the role of the reservation stations and the B-bus the role of the common data bus. The main differences originate from the introduction of the declaration phase, the supporting Q-bus and from the generalization provided by the colored events, which we are going to present. Events are associated to the resources to be employed: in order to employ a given shared resource, a core must require the associated event and provide it on releasing the resource. An event e is identified by a number and bears the following information: • e.provided: indication that the event has been provided • e.src: last declared provider of the event, i.e. last task which has accessed the Q-bus with event e among its provisions. A colored event needs no “.src” field and bears the following information instead: • e.capacity: much like the top of a counting semaphore, it is the maximum capacity of a shared resource to accept concurrent accesses. • e.color: a qualifier which represents how many times this event has been declared for provision. Colored events are associated to resources of corresponding capacity and are called “colored” because we picture that on using them, they change color and they are considered provided when they get back to their initial color. In our implementation we do not explicitly associate one capacity per event. Instead we regard all events belonging to a given range as bearing one capacity and put the “.color” field in place of the “.src” field within the event file. Colored events are a different concept than standard events, because they provide sequencing without dependency renaming. In principle one could employ also multiple standard events to regulate the access to shared resources, but this approach clashes with the need to declare all events in the declaration phase of the task. This could be circumvented again by issuing multiple declarations in a similar way as it has been done in the example of the algorithm in Figure 3 for

A. DECLARE operation The operation DECLARE((p1 , · · · , pn ), (r1 , · · · , rm )) initiates a task by stating that the subsequent code might require events r1 , · · · , rm and shall provide events p1 , · · · , pn . On a DECLARE, M assigns to the task a unique identifier i, e.g. by reading it from a counter and adding a unique prefix, and gains access on the Q-bus to perform the atomic bus transfer described in the algorithm of Figure 5. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:

R(r1 ), · · · , R(rm ) ⇐ E(r1 ), · · · , E(rm ) for all p ∈ p1 , · · · , pn do if p is no colored event then E(p).provided ⇐ False E(p).src ⇐ i else // p is a colored event E(p).color ⇐ E(p).color + 1 if E(p).capacity ≤ E(p).color then E(p).provided ⇐ False end if end if end for Figure 5.

DECLARE Operation

This operation locks the Q-bus for one burst m+n transaction with the event file E: this guarantees that all DECLARE operations are seen serially by E. DECLARE represents one entry point of a task and corresponds to the call of a function p¯ = f (¯ r). In a function, all code paths reachable from the call entry point must belong to the function until they provide valid outputs. In the same sense, all code paths reachable from a DECLARE and not providing all p1 , · · · , pn must belong to the task. In OpenMP terminology this corresponds to a task region [10, p. 8] whose boundary is determined by the end of the structured block of the task generating construct. This observation provides an exact definition of what a task is and it is entirely possible for a task to call and also contain other tasks: it just need to contain additional DECLARE operations. It is also possible for a task to terminate (i.e. provide p1 , · · · , pn ) while called sub-tasks are still being executed. B. REQUIRE operation The operation REQUIRE(ra , · · · , rz ) holds the task until the events ra , · · · , rz get provided. On a REQUIRE, M shall hold the core until the condition shown in the algorithm of Figure 6 is met. REQUIRE consults the local R table and not the global event file E. A task may REQUIRE only events which have

1: 2: 3: 4:

 while e∈{ra ,···,rz } R(e).provided = False do hold core end while release core Figure 6.

REQUIRE Operation

been loaded into the R table by DECLARE, but it is not necessary to do so, e.g. the following code is legal: 1: DECLARE((r1 , r2 ),(r1 , r2 )) 2: REQUIRE(r1 ) 3: use device 1 4: if condition is true then 5: REQUIRE(r2 ) 6: use device 2 7: end if 8: PROVIDE(r1 , r2 ) C. PROVIDE operation The operation PROVIDE(pa , · · · , pz ) broadcasts the notifications that the events pa , · · · , pz are being provided by the task i over the B-bus to all other M units. Furthermore it updates the event file E. On a PROVIDE, all M units snooping on the B-bus update their R tables on receiving an event p according to the algorithm of Figure 7. 1: 2: 3: 4: 5: 6:

7: 8: 9: 10: 11: 12:

if p.src = i then if R(p) exists and p is no colored event then if R(p).src = p.src then R(p).provided ⇐ True end if else if R(p) exists and p is a colored event and R(p).color > R(p).capacity then R(p).color ⇐ R(p).color - 1 if R(p).capacity > R(p).color then R(p).provided ⇐ True end if end if end if Figure 7.

PROVIDE Operation

D. Event File The event file E processes the provision of event p in a similar way as the M units do, as shown in the algorithm of Figure 8.

1: 2: 3: 4: 5: 6: 7: 8: 9: 10:

if p is no colored event then if E(p).src = p.src then E(p).provided ⇐ True end if else // p is a colored event E(p).color = E(p).color - 1 if E(p).capacity > E(p).color then E(p).provided ⇐ True end if end if Figure 8.

Provision to the Event File

we employ the distributed algorithm proposed in this paper to schedule migrations over the processing cores. Assuming that some cores Cm , · · · , Cn are associated to the colored events xm , · · · , xn , the following code implements a migration from the core Ci to the core Cj by first obtaining access to a processor’s context and then transferring the context-specific contents of the M unit. This transfer could have also been accomplished by a dedicated bus structure rather than in software. 1: DECLARE((x1 , · · · , xm−1 , xm , · · · , xn ), (· · · , xm , · · · , xn )) 2: · · · 3: if migration to xj then // note that j ∈ {m, · · · , n} 4: REQUIRE(xj ) 5: Cj .context ⇐ Ci .context 6: for all x ∈ {x1 , · · · , xn } do 7: Cj .M.R(x) ⇐ Ci .M.R(x) 8: end for 9: PROVIDE(xi ) 10: else // we are sure that we will not migrate to xj 11: PROVIDE(xj ) 12: end if To simplify matters, in this code we have omitted three features which we describe here in text: 1) in line 7, the transfer is affected by a race condition because Ci .M.R(x) might get provided after having been read from Ci .M but before being written into Cj .M . This race condition can be avoided by any of several well known techniques. 2) in line 9, on leaving the core Ci , the executing task must issue PROVIDE(xi ) only if the task had migrated onto Ci previously. A new task, which gets initiated on Ci , has not migrated onto it and does not need to release it with a PROVIDE(), in fact the corresponding variable xi would not be in the task’s DECLARE(). 3) on terminating, if the task has migrated at all, it issue a PROVIDE() to release the last core it has migrated onto.

E. Migration In order to exploit the performance acceleration of local coprocessors and increase the reaction times of a task, we need to let the control flow migrate to different processing cores. Since a multithreaded processor is a resource of a task,

V. E XPERIMENTAL S ETUP We have modeled the proposed algorithm for a generic multicore system of multithreaded processor cores as shown in Figure 9. A distributor agent dispatches tasks to a subset

Table I W ORKLOAD C HARACTERISTICS instruction

%

characteristics

execution access synchronization

88% 7% 3%

migration

1%

tasks up to 2000 instructions random latency up to 8 cycles REQUIRE up to 16 events out of 64 PROVIDE up to 32 events out of 64 random migration points

figures for the tasks in isolation average execution time average CPU time average utilization Figure 9.

1026 cycles 826 cycles 76%

Scheme of the generic multicore system employed in simulation 4

3

x 10

• •



makespan: the time required to complete all the tasks divided by the total number of scheduled tasks. sojourn time: the time elapsed between the start and termination of a task. execution time: the time necessary for executing a task, including the peripheral access times but excluding the scheduling delays caused by thread preemption. CPU time: the time in which the task keeps the CPU busy.

These figures have been measured for two topologies which we have modeled: parallel pipelines of processors and pipelines of parallel processors. Our goal has been to investigate how the scheduling of tasks over these processor clusters can be improved. The basic topology consists of four lanes with eight stages each. Every processing core bears four contexts in its basic configuration. In the case of parallel pipelines, tasks are not allowed to move from one lane to the next. In the case of pipelines of parallel processors, they may do so. With respect to Figure 1, in parallel pipelines of processor, every processor Pi,j can communicate only with Pi+1,j . In a pipeline of parallel processors, every processor Pi,j can communicate with any processor Pi+1,k , ∀k ∈ {1, 2, 3, 4}. We have randomized most characteristics to address generality. Both migration points and the destination of the migration are random. The context switch policy is also completely randomized and reflects the generalized processor sharing discipline common in many applications which process streaming data. It has the effect of equalizing the sojourn times of the tasks within the system: if tasks T1 and T2 are started at the same time, instead of executing task T1 as first until time ∆1 and subsequently task T2 until time ∆2 , the execution of both tasks is distributed over the time max(∆1 , ∆2 ), consequently the average sojourn time will be max(∆1 , ∆2 ) instead of (∆1 + ∆2 )/2.

2 1.5 1 0.5 0

32

16

8 4 contexts per processor

2

1

32

16

8 4 contexts per processor

2

1

0.25 0.2 idle percentage



sojourn time

2.5

of “entry” processors and these tasks are then free to migrate through the remaining “data plane” cores. The figures of interest are:

0.15 0.1 0.05 0

Figure 10.

Workload sensibility to multithreading

The synthetic workload presents a stream of tasks with the characteristics shown in table I. The figures for the tasks in isolation, reported in table I, correspond to the case in which 32 simultaneous tasks are executed on 32 parallel processors and show that 24% of the idle time in this workload is caused by dependencies between the tasks. Figure 10 shows how the sojourn time of 32 simultaneous tasks decreases and the processor idle time increases when moving from 32 contexts on a single processor to 32 single processors. It demonstrates that the idle time in the workload can be eliminated by multithreading. VI. R ESULTS Our main results are summarized in table II. The scheduling performance achieved by the colored events is considerably higher than the one achieved by the standard events, i.e. pure dependency-based scheduling. Quadruplicating the width of the pipeline, and hence the number of processors, still does not cope completely with the task congestion. The parallel pipelines deliver a better performance than their equivalent pipelines of parallel processors because there is less traffic. In the case of pipelines of parallel processors, tasks may need to wait longer because their destinations can be occupied

Table II E FFECT OF TASK WORMHOLE topology

makespan

sojourn

utilization

parallel pipelines (colored) parallel pipelines (standard) pipeline of parallels (colored) pipeline of parallels (standard) pipeline of parallels (double size) pipeline of parallels (quad size)

35.87 90.05 40.94 187.32 91.70 55.79

3273.43 1697.96 3689.08 2477.33 2742.70 3250.93

73% 29% 63% 14% 14% 12%

makespan

100

Figure 12.

50

0

1

2

3

4

contexts

5

6

7

8

25 20

4000

makespan

sojourn

6000

2000 0

1

2

3

4

contexts

5

6

7

8

10

0

0.5

parallel pipelines pipeline of parallels (32,2)

(16,4) (8,8) (4,16) pipeline (width,depth), four contexts per core

(2,32)

4000

1

2

3

4

contexts

5

6

7

3000

8 cycles

0

15

5

1 utilization

Deadlock in wormhole routing of tasks

sojourn (parallel pipelines) sojourn (pipeline of parallels) execution (parallel pipelines) execution (pipeline of parallels) cpu (parallel pipelines) cpu (pipeline of parallels)

2000

1000

Figure 11. Effect of increasing the number of contexts on a cluster of 4 parallel pipelines of 8 processors each

by tasks from other lanes. This penalty is not compensated by the fact that some lanes increase their availability due to the tasks which leave them. The reason why the colored events perform better, is that they allow wormhole routing of tasks while retaining deadlock freedom. The problem is shown in Figure 12: task A may overtake task B and fill up the free context in the stage below B. If A depends on B and B shall provide its dependency only after having moved to the subsequent stage, a deadlock happens because B cannot move to the next stage occupied by A and A cannot leave it without B having provided the dependency first. Without carrying out a finer functional partition to solve the problem “manually”, the overtaking of tasks must be disabled to avoid deadlocks. Instead, the colored events sequence only dependent tasks over the available contexts, therefore they provide a less strict policy for a deadlock-free routing than just disabling the overtaking. In Figure 11 we report the effect of increasing the number of contexts in a cluster of parallel pipelines. The makespan can be largely reduced by moving from one context to two, but it does not improve much by adding more than three contexts: further increases in the sojourn time of the tasks do not eliminate further idle time. Subsequently, we have analyzed the effect of increasing the depth of several parallel pipelines and pipelines of parallel

0

Figure 13.

(32,2)

(16,4) (8,8) (4,16) pipeline (width,depth), four contexts per core

(2,32)

Effect of task congestion in a pipeline of parallel processors

processors. Figure 13 represents the outcome of the measurements for a set of 64 processors bearing four contexts each. The processors have been initially organized in 32 parallel groups of two stages each and subsequently in 16, 8, 4 and 2 groups of respectively 2, 4, 8, 16 and 32 stages each. From the data in Figure 13, we can estimate an increase of the makespan by about 5% for every halving of the number of parallel groups and doubling of the groups depth. The additional flexibility of a pipeline of parallel processors costs from 13.5% (narrowest configuration: 2 groups of 32 stages each) to 25% (widest configuration: 32 groups of two stages each) in terms makespan for a random workload. The sojourn time increases about 1% slower than the makespan because of the lower utilization achieved in the last stages of the narrower configurations. The results of Figure 14 show the performance increase achieved by adding stages of four processors each to a four processors wide configuration. Every doubling of the pipeline depth leads to a performance increase of about 80%, with the pipeline of parallel processors delivering between 13.5% and 17.5% less performance than its equivalent parallel pipelines of processors.

150

makespan

parallel pipelines pipeline of parallels 100

50

0

2

4 8 16 pipeline depth, four cores wide, four contexts per core

32

4000

cycles

3000 sojourn (parallel pipelines) sojourn (pipeline of parallels) execution (parallel pipelines) execution (pipeline of parallels) cpu (parallel pipelines) cpu (pipeline of parallels)

2000 1000 0

2

Figure 14.

4 8 16 pipeline depth, four cores wide, four contexts per core

32

Delay caused by deeper parallel pipelines

This algorithm has been validated by intensive simulation. We have also carried out some hardware implementations, but they are not final and shall be a subject for future work. This approach provides a partial sequencing of tasks with regard to selected resources, but it does not clash with other existing scheduling techniques, e.g. for increasing performance. As the number of processing cores per chip keeps increasing, traditional synchronization techniques will not cope with the scaling and we believe that this approach provides a more advanced and distributed sequencing technique, enabling a smooth transition from existing legacy code. ACKNOWLEDGMENT This work has been partially supported by the German Federal Ministry of Education and Research (BMBF) under the project RapidMPSoC, grant number BMBF-01M3085B. R EFERENCES

VII. C ONCLUSIONS We have presented a novel algorithm for scheduling tasks on multicore architectures. Its most striking feature is the hardware support for avoiding deadlocks and livelocks. In comparison to the fundamental algorithm by Tomasulo in [4], [5], we have introduced a separated declaration stage on a dedicated serial bus (Q-bus) and multiple requirement and provision stages. This generalization allows us to employ the algorithm for detecting and renaming data dependencies across multiple concurrent tasks, rather than across single instructions. The approach of employing dependency renaming for scheduling tasks has been proposed in software by Perez et al. in [7], but it requires tasks of coarse granularity (105 cycles or more) to deliver a good performance. Instead, our hardware approach can efficiently schedule tasks of much finer granularity (down to a few tens of cycles), which are much more performing on embedded applications like the ones examined by Stensland et al. in [8]. Within our generalization, we have introduced the colored events for dealing with hardware resources supporting multiple concurrent accesses. We have applied the colored events in the scheduling of tasks over pipelines of processors and we have shown that we can allow a deadlock-free wormhole scheduling of tasks across multithreaded processor networks. We have presented numerical evidence of how this scheduling can deliver more performance than a large increase in the number of processors.

[1] E. A. Lee, “The problem with threads,” Computer, vol. 39, no. 5, pp. 33–42, 2006. [2] E. Ayguad´e, N. Copty, A. Duran, J. Hoeflinger, Y. Lin, F. Massaioli, X. Teruel, P. Unnikrishnan, and G. Zhang, “The design of OpenMP tasks,” IEEE Transactions of Parallel and Distributed Systems, vol. 20, no. 3, pp. 404–418, 2009. [3] P. Bellens, J. M. Perez, R. M. Badia, and J. Labarta, “CellSs: a programming model for the Cell BE architecture,” in SC ’06: Proceedings of the 2006 ACM/IEEE conference on Supercomputing. New York, NY, USA: ACM, 2006. [4] R. M. Tomasulo, “An efficient algorithm for exploiting multiple arithmetic units,” IBM Journal of Research and Development, vol. 11, no. 1, pp. 25–33, 1967. [5] R. M. Tomasulo, D. W. Anderson, and D. M. Powers, “Execution unit with a common operand and resulting bussing system,” United States Patent, August 1969, number US3462744. [6] A. Duran, J. M. P´erez, E. Ayguad´e, R. M. Badia, and J. Labarta, “Extending the OpenMP tasking model to allow dependent tasks,” in International Workshop on OpenMP ’08, 2008, pp. 111–122. [7] J. Perez, R. Badia, and J. Labarta, “A dependency-aware task-based programming environment for multi-core architectures,” in IEEE International Conference on Cluster Computing, October 2008, pp. 142–151. [8] H. K. Stensland, C. Griwodz, and P. Halvorsen, “Evaluation of multicore scheduling mechanisms for heterogeneous processing architectures,” in NOSSDAV ’08: Proceedings of the 18th International Workshop on Network and Operating Systems Support for Digital Audio and Video. New York, NY, USA: ACM, 2008, pp. 33–38. [9] M. Frigo, C. E. Leiserson, and K. H. Randall, “The implementation of the Cilk-5 multithreaded language,” in Proceedings of the ACM SIGPLAN ’98 Conference on Programming Language Design and Implementation, Montreal, Quebec, Canada, Jun. 1998, pp. 212–223, proceedings published ACM SIGPLAN Notices, Vol. 33, No. 5, May, 1998. [10] “OpenMP application program interface – version 3.0,” Standard of the OpenMP Architecture Review Board, May 2008. [Online]. Available: http://www.openmp.org/mp-documents/spec30.pdf [11] P. Salverda and C. Zilles, “Fundamental performance constraints in horizontal fusion of in-order cores,” in 14th International Symposium on High Performance Computer Architecture (HPCA), 2008, pp. 252– 263.

A Distributed Hardware Algorithm for Scheduling ...

This algorithm provides a deadlock-free scheduling over a large class of architectures ..... structure to dispatch tasks to the cores, e.g. one program running on a ...

162KB Sizes 1 Downloads 267 Views

Recommend Documents

A New Scheduling Algorithm for Distributed Streaming ...
Department of Computer Science and Technology, Tsinghua University, Beijing 100084 China. 1 This paper is ... Tel: +86 10 62782530; fax:+86 10 62771138; Email: [email protected]. Abstract ... In patching algorithm, users receive at.

A Scheduling Algorithm for MIMO DoF Allocation in ... - ECE Louisville
R. Zhu is with South-Central University for Nationalities, China. E-mail: [email protected]. Manuscript received August 25, 2014; revised January 19, 2015; ...... theory to practice: An overview of MIMO space-time coded wire- less systems,” IEEE

A Graph-based Algorithm for Scheduling with Sum ...
I. INTRODUCTION. In a wireless ad hoc network, a group of nodes communicate ... In addition to these advantages, by analyzing the algorithm, we have found a ...

A Scheduling Algorithm for MIMO DoF Allocation in ... - ECE Louisville
Index Terms—Scheduling, multi-hop wireless networks, MIMO, degree-of-freedom (DoF), throughput maximization. ♢. 1 INTRODUCTION ...... Engineering (NAE). Rongbo Zhu (M'10) is currently a professor in the College of Computer Science of South-. Cent

A Graph-based Algorithm for Scheduling with Sum ...
in a real wireless networking environment is ignored, 2) It is not obvious how to choose an appropriate disk radius d because there is no clear relation between d ...

A Dynamic Scheduling Algorithm for Divisible Loads in ...
UMR exhibits the best performance among its family of algorithms. The MRRS .... by local applications (e.g. desktop applications) at the worker. The arrival of the local ..... u = (u1, u2, ... un) : the best solution so far, ui. {0,1} в : the value

A Hybrid Hardware-Accelerated Algorithm for High ...
octree data structures [27]. Hardware-accelerated .... nal rendering quality comparison (shown in Figure 4) to ..... Reality modeling and visualization from multiple.

A Fast Distributed Approximation Algorithm for ...
ists graphs where no distributed MST algorithm can do better than Ω(n) time. ... µ(G, w) is the “MST-radius” of the graph [7] (is a function of the graph topology as ...

A distributed algorithm for minimum weight spanning trees ... - GitHub
displayed will be uniform (all nodes run the exact same code) and will require up to .... fragment it belongs to and in state Found at all other times. The algorithm.

A Fast Distributed Approximation Algorithm for ...
We present a fast distributed approximation algorithm for the MST problem. We will first briefly describe the .... One of our motivations for this work is to investigate whether fast distributed algo- rithms that construct .... and ID(u) < ID(v). At

A Distributed Clustering Algorithm for Voronoi Cell-based Large ...
followed by simple introduction to the network initialization. phase in Section II. Then, from a mathematic view of point,. derive stochastic geometry to form the algorithm for. minimizing the energy cost in the network in section III. Section IV sho

A Simple Distributed Power Control Algorithm for ...
the following advantages: 1) the operations of each SU are simple and ... It is proved that, the CR network with this simple algorithm ...... Wireless Commun., vol.

CPU Scheduling Algorithm-Preemptive And Non- Preemptive
IJRIT International Journal of Research in Information Technology, Volume 2, Issue 10, ... The second queue is the device or the I/O queue which contains all the ...

A Cross-Layer Scheduling Algorithm With QoS Support ...
(MAC) layer for multiple connections with diverse QoS require- ments, where ... each connection admitted in the system and update it dynami- cally depending ...

Batch scheduling algorithm for SUCCESS WDM-PON - IEEE Xplore
frames arrived at OLT during a batch period are stored in Virtual. Output Queues (VOQs) and scheduled at the end of the batch period. Through simulation with ...

Batch scheduling algorithm for SUCCESS WDM-PON
K. S. Kim is with the Advanced System Technology, STMicroelectronics. focus on reducing tuning ... and next-generation WDM-PON systems on the same network. The semi-passive ..... Local Computer Networks, pp. 112-122, Sep. 1990.

A Distributed Scheduling with Interference-Aware ...
(BSs) and each BS selects the users having the highest effective channel ... Many wireless tech- ... was shown that IA achieves the optimal degrees-of-freedom.

A Proportional Fairness Scheduling Algorithm with QoS ...
system" VTC 51st Volume 3, 15-18 May 2000. [3] Keunyoung Kim et al "Subcarrier and power allocation in OFDMA systems", VTC2004-Fall. [4] Rhee, W.; Cioffi, J.M., "Increase in capacity of multiuser. OFDM system using dynamic subchannel allocation", VTC

Polynomial-time Optimal Distributed Algorithm for ...
Reassignment of nodes in a wireless LAN amongst access points using cell breathing ... monitor quantities, surveillance etc.) [8]. Authors in [9] have proposed ...

A Distributed Algorithm to Achieve Transparent ... - CNSR@VT
Manuscript received July 9, 2015; revised January 18, 2016; accepted. May 27, 2016. ..... solve the problem of sorting and ranking n processors in a distributed ...

A Distributed Algorithm to Achieve Transparent ... - CNSR@VT
that each active node's degree-of-freedoms (DoFs) allocated for ..... Accounting of DoF resource: In Table II, zi,j(t) represents ...... from the University of Florida.

Design of a Distributed Localization Algorithm to ...
GPS to jamming) by providing a cheap, low-power alternative that can exploit existing, readily ... In the robotic domain, angular sensors (e.g., monocular ...

Polynomial-time Optimal Distributed Algorithm for ...
a reallocation problem is independent of the network size. Remark 2: The ... We now begin the proof of convergence of the proposed algorithm. Proof: Let gi. =.

Coordinate-free Distributed Algorithm for Boundary ...
State Key Laboratory of Industrial Control Technology, Zhejiang University, China. §. INRIA Lille ... Wireless sensor networks (WSNs) have been widely adopted.