• Aucun résultat trouvé

Scheduling and data redistribution strategies on star platforms

N/A
N/A
Protected

Academic year: 2021

Partager "Scheduling and data redistribution strategies on star platforms"

Copied!
43
0
0

Texte intégral

(1)

HAL Id: inria-00108518

https://hal.inria.fr/inria-00108518v2

Submitted on 26 Oct 2006

HAL is a multi-disciplinary open access

archive for the deposit and dissemination of

sci-entific research documents, whether they are

pub-lished or not. The documents may come from

teaching and research institutions in France or

abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, est

destinée au dépôt et à la diffusion de documents

scientifiques de niveau recherche, publiés ou non,

émanant des établissements d’enseignement et de

recherche français ou étrangers, des laboratoires

publics ou privés.

platforms

Loris Marchal, Veronika Rehn, Yves Robert, Frédéric Vivien

To cite this version:

Loris Marchal, Veronika Rehn, Yves Robert, Frédéric Vivien. Scheduling and data redistribution

strategies on star platforms. [Research Report] RR-6005, LIP RR-2006-23, INRIA, LIP. 2006, pp.42.

�inria-00108518v2�

(2)

inria-00108518, version 2 - 26 Oct 2006

a p p o r t

d e r e c h e r c h e

S

N

0

2

4

9

-6

3

9

9

IS

R

N

IN

R

IA

/R

R

--6

0

0

5

--F

R

+

E

N

G

Thème NUM

Scheduling and data redistribution strategies on star

platforms

Loris Marchal — Veronika Rehn — Yves Robert — Frédéric Vivien

N° 6005

(3)
(4)

Unité de recherche INRIA Rhône-Alpes

655, avenue de l’Europe, 38334 Montbonnot Saint Ismier (France)

Téléphone : +33 4 76 61 52 00 — Télécopie +33 4 76 61 52 52

LorisMar hal, Veronika Rehn, Yves Robert, Frédéri Vivien ThèmeNUMSystèmesnumériques

ProjetGRAAL

Rapportdere her he n°6005O tober200639pages

Abstra t: Inthis work weare interestedin theproblemof s hedulingandredistributing data on master-slaveplatforms. We onsider the asewere theworkerspossess initial loads,someof whi hhavingtoberedistributed inordertobalan etheir ompletiontimes.

Weexaminetwodierent s enarios. Therst model assumesthat the data onsistsof inde-pendent and identi al tasks. Weprovethe NP- ompleteness in the strongsense forthe general ase,andwepresenttwooptimalalgorithms forspe ialplatform types. Furthermorewepropose threeheuristi sforthegeneral ase. Simulations onsolidatethetheoreti alresults.

The se ond data model is based on Divisible Load Theory. This problem an be solved in polynomialtimebya ombinationof linearprogrammingandsimpleanalyti almanipulations. Key-words: Master-slaveplatform, s heduling, data redistribution, one-port model, indepen-denttasks,divisibleloadtheory.

(5)

Résumé : Dans e travail on s'interesseau problème d'ordonnan ement et de redistribution de données sur plates-formes maître-es laves. On onsidèrele as où les es lavespossèdent des donnéesinitiales,dontquelques-unesdoiventêtreredistribuéespouréquilibrerleurdatesden.

On examine deux s énarios diérents. Le premier modèle suppose que les donnéessont des tâ hes indépendantes identiques. On prouve la NP- omplétude dans le sens fort pour le as général,etonprésentedeuxalgorithmespourdesplates-formesspé iales. Deplusonproposetrois heuristiquespourle asgénéral. Desrésultatsexpérimentauxobtenusparsimulationviennentà l'appuidesrésultatsthéoriques.

Mots- lés: Plate-formemaître-es lave,ordonnan ement,équilibragede harge,modèleun-port, tâ hesindépendantes,tâ hesdivisibles.

(6)

Contents

1 Introdu tion 4

2 Related work 5

3 Loadbalan ing ofindependenttasks using the one-portbidire tional model 6

3.1 Framework . . . 6

3.2 Generalplatforms . . . 6

3.2.1 Polynomialitywhen omputationsarenegle ted. . . 7

3.2.2 NP- ompletenessoftheoriginalproblem. . . 9

3.3 An algorithm fors hedulingonhomogeneous starplatforms: thebest-balan e al-gorithm . . . 12

3.3.1 Notationsusedin BBA . . . 13

3.3.2 TheBestBalan eAlgorithm-BBA . . . 13

3.4 S hedulingonplatformswithhomogeneous ommuni ationlinksandheterogeneous omputation apa ities . . . 20

3.4.1 Moore'salgorithm . . . 20

3.4.2 FrameworkandnotationsforMBBSA . . . 21

3.4.3 Moorebasedbinarysear halgorithm-MBBSA. . . 21

3.5 Heuristi sforheterogeneousplatforms . . . 26

4 Simulations 26 4.1 Thesimulations. . . 26

4.2 Tra etests . . . 28

4.3 Distan efromthebest . . . 29

4.4 Meandistan eandstandarddeviation . . . 34

5 Loadbalan ing ofdivisible loads using the multiportswit h-model 34 5.1 Framework . . . 34

5.2 Redistributionstrategy. . . 35

(7)

1 Introdu tion

In this work we onsider the problem of s heduling and redistributing data on master-slave ar- hite tures in startopologies. Be ause ofvariations in theresour eperforman e (CPUspeedor ommuni ationbandwidth), or be auseof unbalan ed amounts of urrentload on the workers, datamustberedistributedbetweentheparti ipatingpro essors,sothattheupdatedloadisbetter balan edin termsthat theoverallpro essingnishesearlier.

Weadoptthefollowingabstra tviewofourproblem. Thereare

m + 1

parti ipatingpro essors

P

0

, P

1

, . . . , P

m

, where

P

0

is the master. Ea h pro essor

P

k

,

1 ≤ k ≤ m

initially holds

L

k

data items. Duringours hedulingpro esswetryto determine whi h pro essor

P

i

should send some datatoanotherworker

P

j

toequilibratetheirnishingtimes. Thegoalistominimizetheglobal makespan, that is the time until ea h pro essor has nished to pro ess its data. Furthermore we suppose that ea h ommuni ation link is fully bidire tional, with the same bandwidth for re eptionsand sendings. This assumption isquite realisti in pra ti e, anddoes not hange the omplexityofthes hedulingproblem, whi hweproveNP- ompletein thestrongsense.

Weexaminetwodierents enariosfor thedata itemsthat are situatedat the workers. The rst model supposes that these data items onsist in independent and uniform tasks, while the othermodel usestheDivisibleLoadTheoryparadigm(DLT)[4℄.

The oreof DLT isthe following: DLT assumesthat ommuni ationand omputation loads an be fragmented into parts of arbitrary size and then distributed arbitrarily among dierent pro essorstobepro essedthere. This orrespondstoperfe tparalleljobs: They anbesplitinto arbitrarysubtaskswhi h anbepro essedinparallelin anyorderonanynumberofpro essors.

Beaumont,Mar hal,andRobert[2℄treattheproblemofdivisibleloadswithreturnmessages onheterogeneousmaster-workerplatforms(starnetworks). Intheirframework,alltheinitialload issituatedatthemasterandthenhastobedistributedtotheworkers.Theworkers omputetheir amountofloadandreturntheirresultsto themaster. Thedi ultyoftheproblem isto de ide aboutthesendingorderfromthemasterand,atthesametime,aboutthere eivingorder.Inthis paperproblemsareformulatedintermsoflinearprograms. Usingthisapproa htheauthorswere ableto hara terizeoptimalLIFO

1

and FIFO 2

strategies,whereas thegeneral aseis stillopen. Ourproblemisdierent,asin our asetheinitialloadisalreadysituatedat theworkers. Tothe bestofourknowledge,wearethersttota klethiskindofproblem.

Having dis ussed the reasons and ba kground of DLT, we dwell on the interest of the data model with uniformand independent tasks. Contrary tothe DLT model, wherethe size ofload anbediversied, the size ofthe tasks hasto bexed at thebeginning. This leadsto the rst pointof interest: Whentaskshavedierentsizes, theproblemisNP ompletebe auseofan ob-viousredu tionto2-partition[12℄. Theotherpointisapositiveone: thereexistslotsofpra ti al appli ations who use xed identi al and independent tasks. A famous example is BOINC [5℄, theBerkeley Open Infrastru tureforNetwork Computing, anopen-sour e softwareplatform for volunteer omputing. It worksasa entralized s heduler that distributes tasksfor parti ipating appli ations. Theseproje ts onsistsinthetreatmentof omputationextensiveandexpensive s i-enti problemsofmultipledomains,su hasbiology, hemistryormathemati s. SETIhome[22℄ forexampleusesthea umulated omputationpowerforthesear hofextraterrestrialintelligen e. Inthe astrophysi al domain, Einsteinhome[11℄ sear hesfor spinning neutronstars using data fromtheLIGOandGEO gravitationalwavedete tors. Togetanideaofthetaskdimensions,in thisproje tataskisabout12MBandrequiresbetween5and24hoursofdedi ated omputation. As alreadymentioned, wesuppose that all data are initially situated on the workers, whi h leadsus to akind ofredistribution problem. Existing redistributionalgorithms havea dierent obje tive. Neitherdo they arehowthedegreeof imbalan e isdetermined, nordo theyin lude the omputation phasein theiroptimizations. Theyexpe t that aload-balan ingalgorithm has alreadytakenpla e. Withhelpoftheseresults,aredistributionalgorithmdeterminestherequired ommuni ationsand organizesthem inminimal time. Renard,Robert, andVivien presentsome

1

LastInFirstOut 2

(8)

optimal redistribution algorithms for heterogeneous pro essorrings in [20℄. We ould use this approa handredistributethedatarstandthenenterina omputationphase. Butourproblem ismore ompli atedaswesuppose that ommuni ationand omputation anoverlap,i.e.,every worker anstart omputingitsinitial datawhiletheredistributionpro esstakespla e.

Tosummarizeour problem: astheparti ipating workersare notequally harged and/or be- ause of dierent resour eperforman e, they might notnish their omputation pro ess at the sametime. Soweare lookingfor me hanismsonhowto redistributetheloads inorder to nish theglobal omputation pro ess in minimal time under thehypothesis that harged workers an omputeatthesametimeasthey ommuni ate.

The rest of this report is organized as follows: Se tion 2 presents somerelated work. The data model ofindependent andidenti al tasks istreatedin Se tion 3: InSe tion 3.2 wedis uss the ase of general platforms. We are able to prove the NP- ompleteness for the general ase of ourproblem, and thepolynomiality forarestri ted problem. Thefollowingse tions onsider someparti ular platforms: an optimalalgorithm for homogeneousstar networks ispresentedin Se tion 3.3, Se tion 3.4 treats platforms with homogenous ommuni ation links and heteroge-neous workers. The presentation of some heuristi s for heterogeneous platforms is the subje t in Se tion 3.5. Simulativetest resultsare shown in Se tion 4. Se tion 5is devoted to theDLT model. We propose alinear program to solvethe s heduling problem and propose formulas for theredistributionpro ess.

2 Related work

Ourwork is prin ipally related with threekeytopi s. Sin e theearly nineties Divisible Load Theory (DLT) has been assessed to be an interesting method of distributing load in parallel omputer systems. The out ome of DLT is a huge variety of s heduling strategies on how to distributetheindependentpartstoa hievemaximalresults. AstheDLTmodel anbeusedona vastvarietyofinter onne tiontopologiesliketrees,buses,hyper ubesandsoon,intheliterature theoreti alandappli ativeelementsarewidelydis ussed. Inhisarti leRobertazzigivesTen Rea-sons to Use Divisible Load Theory [21℄, likes alability orextendingrealism. Probing strategies [13℄wereshowntobeabletohandleunknownplatformparameters. In[8℄evaluationsofe ien y of DLT are ondu ted. The authors analyzed the relation between the valuesof parti ular pa-rametersandthee ien yofparallel omputations. Theydemonstratedthatseveralparameters in parallel systemsare mutually related, i.e., the hange of one of these parameters should be a ompaniedbythe hangesoftheotherparameterstokeepe ien y. Theplatformusedinthis arti le is astar network and the results are for appli ations with no returnmessages. Optimal s heduling algorithms in luding return messages are presented in [1℄. Theauthors are treating theproblemofpro essingdigitalvideosequen esfordigitalTVandintera tivemultimedia. Asa result,theyproposetwooptimalalgorithms forrealtime frame-by-framepro essing. S heduling problemswithmultiple sour esareexamined[17℄. Theauthorspropose losedformsolutionsfor treenetworkswithtwoloadoriginatingpro essors.

Redistribution algorithms have also been well studied in the literature. Unfortunately alreadysimpleredistributionproblemsareNP omplete[15℄. Forthisreason,optimalalgorithms an be designed only for parti ular ases, as it is done in [20℄. In their resear h, the authors restri ttheplatformar hite turetoringtopologies,bothuni-dire tionalandbidire tional. Inthe homogeneous ase,theywereabletoproveoptimality,but theheterogenous aseisstillanopen problem. Inspiteofthis, othere ientalgorithmshavebeenproposed. Fortopologiesliketrees orhyper ubessomeresultsarepresentedin [25℄.

The load balan ing problem is not dire tly dealt with in this paper. Anyway we want to quote some key referen esto this subje t, asthe results of these algorithms are the starting point for the redistribution pro ess. Generally load balan ing te hniques an be lassied into two ategories.Dynami loadbalan ingstrategiesandstati loadbalan ing. Dynami te hniques mightusethepastforthepredi tionofthefutureasitisthe asein[7℄ortheysupposethatthe loadvariespermanently[14℄. Thatiswhyforourproblemstati algorithmsaremoreinteresting:

(9)

we are only treating star-platforms and as the amount of loadto be treated is known a priory wedonotneedpredi tion. Forhomogeneousplatforms,thepapersin[23℄surveyexistingresults. Heterogeneous solutions are presented in [19℄ or [3℄. This last paper is about a dynami load balan ing method for data parallel appli ations, alled the working-manager method: the manageris supposed to useits idle timeto pro ess dataitself. So theheuristi is simple: when themanagerdoesnotperformany ontrol taskithasto work,otherwiseits hedules.

3 Load balan ing of independent tasks using the one-port bidire tional model

3.1 Framework

Inthispartwewillworkwithastarnetwork

S = P

0

, P

1

, . . . , P

m

showninFigure1. Thepro essor

P

0

isthemasterandthe

m

remainingpro essors

P

i

,

1 ≤ i ≤ m

,areworkers. Theinitialdataare distributed on theworkers,soeveryworker

P

i

possessesanumber

L

i

of initial tasks. All tasks areindependentandidenti al. Asweassumealinear ostmodel,ea hworker

P

i

hasa(relative) omputingpower

w

i

forthe omputationofonetask: ittakes

X.w

i

timeunitstoexe ute

X

tasks ontheworker

P

i

. Themaster

P

0

an ommuni atewithea hworker

P

i

viaa ommuni ationlink. Aworker

P

i

ansendsometasksviathemastertoanotherworker

P

j

tode rementitsexe ution time. Ittakes

X.c

i

timeunitsto send

X

units ofloadfrom

P

i

to

P

0

and

X.c

j

timeunitstosend these

X

units from

P

0

to aworker

P

j

. Withoutlossof generality weassumethat the masteris not omputing,andonly ommuni ating.

P

1

P

0

P

i

P

2

P

m

w

1

w

m

c

m

c

1

w

i

c

i

c

2

w

2

Figure1: Exampleofastarnetwork.

The platforms dealt with in se tions 3.3 and 3.4 are a spe ial ase of a star network: all ommuni ationlinks havethesame hara teristi s, i.e.,

c

i

= c

for ea h pro essor

P

i

,

1 ≤ i ≤ k

. Su haplatformis alledabus networkasithashomogeneous ommuni ationlinks.

We use the bidire tional one-port model for ommuni ation. This means, that the master anonly send data to, and re eivedata from, a singleworkerat a given time-step. But it an simultaneouslyre eiveadataand send one. A givenworker annot startan exe utionbefore it has terminated the re eptionof the messagefrom the master; similarly, it annot startsending theresultsba ktothemasterbeforenishingthe omputation.

Theobje tivefun tion is tominimize themakespan, thatis thetimeat whi hallloads have beenpro essed. Sowelookforas hedule

σ

thata omplishesourobje tive.

3.2 General platforms

Usingthenotationsandtheplatformtopologyintrodu edinSe tion3.1,wenowformallypresent theS hedulingProblemforMaster-Slave Tasks onaStar of Heterogeneous Pro- essors(SPMSTSHP).

(10)

Worker w load

P

1

1 1 13

P

2

8 1 13

P

3

1 9 0

P

4

1 10 0

Figure 2: Platformparameters.

P

4

t

= 0

t

= M

P

2

P

3

P

1

Figure 3: Example of an optimal s hedule on a heterogeneousplatform, whereasending worker alsore eivesatask.

Denition1(SPMSTSHP).

Let

N

be a star-network with one spe ial pro essor

P

0

alled master" and

m

workers. Let

n

be the number of identi al tasks distributed to the workers. For ea h worker

P

i

, let

w

i

be the omputationtimeforonetask. Ea h ommuni ationlink,

link

i

,hasanasso iated ommuni ation time

c

i

for thetransmissionof onetask. Finallylet

T

be adeadline.

Thequestionasso iatedtothede isionproblemofSPMSTSHPis: Isitpossibletoredistribute the tasksandtopro essthemin time

T

?.

Oneofthemaindi ulties seemstobethefa tthatwe annotpartitiontheworkersinto dis-jointsetsofsendersandre eivers.Thereexistssituationswhere,tominimizetheglobalmakespan, itisuseful,that sendingworkersalsore eivetasks. (Youwillsee laterin thisreportthatwe an supposethisdistin tionwhen ommuni ationsarehomogeneous.)

We onsider thefollowingexample. Wehavefour workers(seeFigure 2fortheirparameters) andamakespanxedto

M = 12

. AnoptimalsolutionisshowninFigure3: Workers

P

3

and

P

4

do notownanytask,andtheyare omputingveryslowly. Soea hofthem an omputeexa tlyone task. Worker

P

1

, whoisafastpro essorand ommuni ator,sends themtheirtasksand re eives lateranothertaskfromworker

P

2

thatit an omputejust intime. Note thatworker

P

1

isboth sending and re eiving tasks. Trying to solvethe problem under the onstraint that no worker also sends and re eives, it is not feasible to a hievea makespan of 12. Worker

P

2

has to send onetaskeithertoworker

P

3

ortoworker

P

4

. Sending andre eivingthistasktakes9timeunits. Consequentlythepro essingofthis task annotnishearlierthantime

t = 18

.

Anotherdi ultyoftheproblemistheoverlapof omputationandtheredistributionpro ess. Subsequently weexamine our problem negle ting the omputations. Weare going to prove an optimalpolynomialalgorithmforthisproblem.

3.2.1 Polynomialitywhen omputations are negle ted

Examining ouroriginal problem under the supposition that omputations are negligible, we get a lassi aldata redistribution problem. Hen e weeliminate theoriginal di ultyof the overlap of omputation with the data redistribution pro ess. We suppose that we already know the imbalan e of the system. So weadopt the following abstra t viewof our new problem: the

m

parti ipatingworkers

P

1

, P

2

, . . . P

m

holdtheirinitialuniformtasks

L

i

,

1 ≤ i ≤ m

. Foraworker

P

i

the hosenalgorithmforthe omputationoftheimbalan ehasde idedthatthenewloadshould be

L

i

− δ

i

. If

δ

i

> 0

,this meansthat

P

i

isoverloadedand ithasto send

δ

i

tasks tosomeother pro essors. If

δ

i

< 0

,

P

i

is underloadedand ithas to re eive

−δ

i

tasks from other workers. We haveheterogeneous ommuni ationlinksand allsenttaskspassbythemaster. Sothegoalisto determinetheorderofsendersandre eiverstoredistributethetasksin minimaltime.

(11)

As all ommuni ations pass by the master, workers an notstart re eiving until tasks have arrivedonthemaster. Sotominimizetheredistributiontime,itisimportantto hargethemaster asfastaspossible.Orderingthesendersbynon-de reasing

c

i

-valuesmakesthetasksattheearliest possibletimeavailable.

Supposewewouldorderthere eiversinthesamemannerasthesenders,i.e.,bynon-de reasing

c

i

-values. In this ase we ould start ea h re eption as soon as possible, but always with the restri tionthatea htaskhastoarriverstatthemaster(seeFigure4(b)). Soit anhappenthat therearemanyidletimesbetweenthere eptionsifthetasksdonotarrivein timeonthemaster. Thatiswhywe hoosetoorderthere eiverinreversedorder,i.e.,bynon-in reasing

c

i

-values( f. Figure4( )),toletthetasksmoretimetoarrive.Inthefollowinglemmaweevenproveoptimality ofthisordering.

P

1

P

2

P

4

P

0

P

3

δ

1

= 3

δ

4

= −2

c

4

= 3

δ

2

= 1

c

2

= 5

c

3

= 1

c

1

= 2

δ

3

= −2

(a) Exampleof load imbalan e on a heterogeneous platform with4workers.

T

= 14





P

1

P

2

P

3

P

4

senders

receivers

(b) The re eivers are ordered by non-de reasingorderoftheir

c

i

-values.



T

= 12



P

1

P

2

P

3

P

4

receivers

senders

( ) The re eivers are ordered by non-in reasingorderoftheir

c

i

-values.

Figure4: Comparisonoftheorderingofthere eivers.

Theorem 1. Knowing the imbalan e

δ

i

of ea h pro essor, an optimal solution for hetero ge-neousstar-platformsistoorderthe sendersby non-de reasing

c

i

-valuesandthe re eiversby non-in reasing orderof

c

i

-values.

Proof. Toprovethat thes heme des ribedbyTheorem 1returnsanoptimal s hedule, wetake as hedule

S

omputed by this s heme. Then we takeany other s hedule

S

. We are going to transform

S

intwostepsintoours hedule

S

andprovethatthemakespansoftheboths hedules holdthefollowinginequality:

M (S

) ≤ M (S)

.

In the rst step wetake alook at thesenders. The sending from the master an not start before tasksare available onthe master. We donot know theordering of the sendersin

S

but weknowtheorderingin

S

: allsendersareorderedinnon-de reasingorderoftheir

c

i

-values. Let

i

0

bethe rst task sent in

S

where the senderof task

i

0

hasa bigger

c

i

-value than the sender of the

(i

0

+ 1)

-thtask. Wethen ex hange thesendersof task

i

0

andtask

(i

0

+ 1)

and allthis new s hedule

S

new

. Obviously the re eptiontime for the se ond task is still the same. But as

(12)

you anseeinFigure5,thetimewhenthersttaskisavailableonthemasterhas hanged: after theex hange,thersttaskisavailableearlieranddittoreadyforre eption. Hen e thisex hange improvestheavailabilityonthemaster(andredu espossibleidletimesforthere eivers). Weuse this me hanismto transformthesendingorder of

S

in thesendingorder of

S

and atea h time theavailabilityonthemasterisimproved. Hen eattheendofthetransformationthemakespan of

S

new

issmallerthanorequaltothat of

S

andthesending orderof

S

new

and

S

isthesame.

t

t

P

i

0

P

i

0

+1

P

i

0

P

i

0

+1

Figure 5: Ex hangeofthesendingordermakestasksavailableearlieronthemaster. In these ond step ofthe transformationwetake are ofthe re eivers( f. Figures 6and 7). Havingalready hangedthesendingorderof

S

bythersttransformationof

S

into

S

new

,westart heredire tlybythetransformationof

S

new

. Usingthesameme hanismasforthesenders,we all

j

0

therst tasksu h thatthe re eiveroftask

j

0

hasasmaller

c

i

-valuethanthe re eiveroftask

j

0

+ 1

. Weex hange there eiversofthe tasks

j

0

and

j

0

+ 1

and allthe news hedule

S

new

(1)

.

j

0

issentatthesametimethanpreviously,andthepro essorre eivingit,re eivesitearlierthan itre eived

j

0+1

in

S

new

.

j

0+1

is sentassoonasitis available onthemaster andassoonasthe ommuni ationof task

j

0

is ompleted. Therstof thesetwo onditionshad alsotobesatised by

S

new

. Ifthese ond onditionisdelayingthebeginningofthesendingofthetask

j

0

+ 1

from themaster,thenthis ommuni ationendsattime

t

in

+ c

π

(j

0

)

+ c

π

(j

0

+1)

= t

in

+ c

π(j

0

+1)

+ c

π(j

0

)

andthis ommuni ationendsatthesametimethanunderthes hedule

S

new

(here

π(j

0

)

(

π

(j

0

)

) denotesthere eiveroftask

j

0

ins hedule

S

new

(

S

new

(1)

,respe tively)). Hen ethenishtimeof the ommuni ationof task

j

0

+ 1

in s hedule

S

new

(1)

is lessthan or equalto the nish time in thepreviouss hedule. In all ases,

M (S

new

(1)

) ≤ M (S

new

)

. Note that thistransformation does not hangeanythingforthetasksre eivedafter

j

0+1

ex eptthatwealwaysperformthes heduled ommuni ationsas soonas possible. Repeating the transformation for the rest of the s hedule

S

new

we redu e all idle times in the re eptions as far as possible. We get for the makespan of ea h s hedule

S

new

(k)

:

M (S

new

(k)

) ≤ M (S

new

) ≤ M (S)

. As after these (nite number of) transformations the order of the re eivers will be in non-de reasing order of the

c

i

-values, the re eiverorderof

S

new

(∞)

isthesameasthere eiverorderof

S

andhen ewehave

S

new

(∞)

= S

. Finallywe on ludethatthemakespanof

S

issmallerthanorequaltoanyothers hedule

S

and hen e

S

isoptimal.

t

t

idle idle

n

n

t

in

t

in

P

π(j

0

)

P

π(j

0

+1)

P

π(j

0

)

P

π(j

0

+1)

Figure6: Ex hangeofthere eivingordersuitsbetterwiththeavailabletasksonthemaster.

3.2.2 NP- ompletenessof the originalproblem

Nowwearegoingto provetheNP- ompleteness in thestrongsense ofthegeneralproblem. For this wewere stronglyinspiredby theproofof Dutot[10, 9℄ fortheS heduling Problem for Master-SlaveTasksonaTreeofHeterogeneousPro essors(SPMSTTHP).Thisproof

(13)

t

t

idle

n

t

in

t

in

P

π(j

0

)

P

π(j

0

+1)

P

π(j

0

)

P

π(j

0

+1)

Figure7: Deletionofidletimedue totheex hangeofthere eivingorder.

usesatwoleveltreeasplatformtopologyandweareabletoasso iatethestru tureonour star-platform. Wearegoingtore allthe3-partitionproblemwhi hisNP- ompleteinthestrongsense [12℄.

Denition2(3-Partition).

LetS andn betwointegers,andlet

(y

i

)

i∈1..3n

be asequen e of

3n

integers su hthatfor ea h

i

,

S

4

< y

i

<

S

2

.

The question ofthe 3-partitionproblem isCanwepartitionthe setof the

y

i

in

n

triples su h that thesum of ea htriple isexa tly

S

?".

Theorem2. SPMSTSHPisNP- ompleteinthe strongsense.

Proof. We take an instan e of 3-partition. We dene somereal numbers

x

i

,

1 ≤ i ≤ 3n

, by

x

i

=

1

4

S +

y

8

i

. Ifatripleof

y

i

hasthesum

S

,the orrespondingtripleof

x

i

orrespondstothesum

7S

8

and vi eversa. A partitionof

y

i

in triplesisthus equivalenttoapartitionofthe

x

i

in triples of thesum

7S

8

. This modi ationallowsus to guaranteethat the

x

i

are ontainedin asmaller intervalthantheintervalofthe

y

i

. Ee tivelythe

x

i

arestri tlyin ludedbetween

9S

32

and

5S

16

.

Redu tion. For our redu tion we use the star-network shown in Figure 8. We onsider the following instan e of SPMTSHP: Worker

P

owns

4n

tasks, the other

4n

workers do not hold any task. Wework with the deadline

T = E + nS +

S

4

, where

E

is an enormoustime xed to

E = (n + 1)S

. The ommuni ationlink between

P

andthemaster hasa

c

-valueof

S

4

. Soit an sendataskall

S

4

timeunits. Its omputationtime is

T + 1

,so worker

P

hastodistribute allits tasks asit annotnish pro essing asingle taskby the deadline. Ea h of theother workersis abletopro ess onesingletask,asits omputation timeisatleast

E

andwehave

2E > T

,what makesitimpossibletopro essase ond taskbythedeadline.

P

0

P

T+1

E

Q

0

Q

1

E+S

E+(n−1)S

Q

n−

1

S

8

S

8

S

4

E

E

E

E

P

2

E

P

1

P

i

x

1

x

2

x

3n−1

x

3n

S

8

P

3n−1

P

3n

x

i

(14)

This stru ture of the star-network is parti ularly onstru ted to reprodu e the 3-partition problem in the s ope of a s heduling problem. We are going to use the bidire tional 1-port onstraintto reateourtriplets.

Creation of a s hedule out of a solution to 3-partition. Firstweshowhowto onstru t avalid s hedule of

4n

tasks in time

S

4

+ nS + E

out of a3-partitionsolution. Tofa ilitate the le ture, the pro essors

P

i

are ordered by their

x

i

-values in the order that orresponds to the solution of 3-partition. So, without loss of generality, we assume that for ea h

j ∈ [0, n − 1]

,

x

3j+1

+ x

3j+2

+ x

3j+3

=

7S

8

. Thes hedule isofthefollowingform:

1. Worker

P

sendsitstasksas soonaspossibletothemaster,i.e.,every

S

4

timeunits. Soitis guaranteedthat the

4n

tasksaresentin

nS

timeunits.

2. Themastersendsthetasksassoonaspossibleinin omingordertotheworkers.There eiver order isthefollowing(forall

j ∈ [0, n − 1]

):

ˆ Task

4j + 1

,overlink of ost

x

3j+1

,topro essor

P

3j+1

. ˆ Task

4j + 2

,overlink of ost

x

3j+2

,topro essor

P

3j+2

. ˆ Task

4j + 3

,overlink of ost

x

3j+3

,topro essor

P

3j+3

. ˆ Task

4j + 4

,overlink of ost

S

8

,topro essor

Q

n−1−j

.

Thedistributionof thefour tasks,

4j + 1

,

4j + 2

,

4j + 3

,

4j + 4

, takesexa tly

S

time units andthemasterneedsalso

S

timeunitstore eivefourtasksfrompro essor

P

. Furthermore,ea h

x

i

islargerthan

S

4

. Therefore,after thersttaskissent,themasteralwaysnishesto re eivea newtask beforeits outgoingport is available to sendit. Therst taskarrivesat time

S

4

at the master, whi h isresponsibleforthe shortidletime atthebeginning. Thelasttask arrivesat its workerattime

S

4

+ nS

andhen eitrestsexa tly

E

timeunitsforthepro essingofthistask. For theworkers

P

i

,

1 ≤ i ≤ 3n

, weknow that they annish topro esstheir tasksin time asthey allhavea omputation powerof

E

. The omputationpoweroftheworkers

Q

i

,

0 ≤ i ≤ n − 1

,is

E + i × S

andas theyre eivetheirtask attime

S

4

+ (n − i − 1) × S +

7S

8

,theyhaveexa tlythe timetonishtheirtask.

Gettinga solutionfor 3-partition outof as hedule. Nowweprovethat ea hs heduleof

4n

tasksin time

T

reatesasolutiontothe3-partitionproblem.

Asalreadymentioned,ea hworkerbesidesworker

P

anpro essatmostonetask. Hen edue tothenumberof tasksinthesystem,everyworkerhasto pro essexa tlyonetask. Furthermore theminimaltimeneededtodistributealltasksfromthemasterandtheminimalpro essingtime on the workersindu es that there is no idle time in theemissions of themaster, otherwise the s hedulewouldtakelongerthantime

T

.

Wealsoknowthat worker

P

istheonlysendingworker: Lemma1. Noworkerbesides worker

P

sendsany task.

Proof. Due to theplatform ongurationand thetotal numberoftasks, worker

P

hasto send allitstasks. This takesatleast

nS

timeunits. Thetotalemissiontimeforthemasteris also

nS

time units: asea h workermustpro ess atask,ea hof them mustre eiveone. Sothe emission timeforthemaster islargerthanorequalto

P

n

i=1

x

i

+ n ×

S

8

= nS

. Asthemaster annotstart sending the rst task before time

S

4

and asthe minimum omputation power is

E

, then if the mastersendsexa tlyonetasktoea hslave,themakespanisgreaterthanorequalto

T

andifone workerbesides

P

sendsatask,themasterwillatleastsendoneadditionaltaskandthemakespan willbestri tlygreaterthan

T

.

Nowwearegoingtoexaminetheworker

Q

n−1

andthetaskheisasso iatedto.

(15)

Proof. The omputation time of worker

Q

n−1

is

E + (n − 1)S

, hen eits task hasto arriveno laterthan time

S +

S

4

. The fthtask arrivesat thesoonest at time

5S

4

+

S

8

asworker

P

hasto sendvetasksastheshortest ommuni ationtimeis

S

8

. Thefollowingtasksarrivelaterthanthe

5

-thtask,sothetaskforworker

Q

n−1

hastobeoneoftherstfourtasks.

Lemma3. Therstthreetasksaresent tosomeworker

P

i

,

1 ≤ i ≤ 3n

.

Proof. As already mentioned, themaster has to send without any idle time besides theinitial one. Hen e we haveto pay attentionthat themaster alwayspossessesa task to send when he nishestosendatask. Whilethemasterissendingtoaworker

P

i

,worker

P

hasthetimetosend thenexttasktothemaster. But,ifatleastoneoftherstthreetasksissenttoaworker

Q

i

,the sending time of therst three tasks isstri tly inferior to

S

8

+

5

16

S +

5

16

S =

3

4

S

. Hen e there is obligatoryanidletime intheemissionofthemaster. This pausemakesthes heduleof

4n

tasks intime

T

infeasible.

Adire t on lusionofthetwopre edentlemmasisthatthe

4

-thtaskissenttoworker

Q

n−1

. Lemma 4. The rst three taskssent by worker

P

have atotal ommuni ation timeof

7

8

S

time units.

Proof. Worker

Q

n−1

hasa omputationtime of

E + (n − 1)S

,ithastore eiveits tasknolater thantime

5

4

S

. Thisimpliesthattherstthreetasksaresentin atimenolongerthan

7

8

S

. Ontheotherside,the

5

-thtaskarrivesatthemasternosoonerthantime

5

4

S

. Asthemasterhas tosendwithoutidletime,theemissionto worker

Q

n−1

hastopersistuntilthisdate. Ne essarily therstthreeemissionsofthemastertakeatminimumatime

7

8

S

.

Lemma5. S heduling

4n

tasksinatime

T =

S

4

+ nS + E

unitsof timeallows tore onstru tan instan eof the asso iated 3-partition problem.

Proof. Inwhat pre edes,weprovedthatthe rstthreetasks sentby themaster reate atriple whose sum is exa tly

7

8

. Using this property re ursivelyon

j

forthe triple

4j + 1, 4j + 2

and

4j + 3

, we show that wemust send the tasks

4j + 4

to the worker

Q

n−1−j

. With this method we onstru tapartition of the set of

x

i

in triplesof sum

7

8

. These triples areasolution to the asso iated3-partitionproblem.

Havingproventhat we an reate as hedule outof asolutionof3-partitionandalsothatwe angetasolutionfor3-partitionoutofas hedule,theproofisnow omplete.

3.3 An algorithm for s heduling on homogeneous star platforms: the best-balan e algorithm

Inthisse tion wepresenttheBest-Balan e Algorithm(BBA), analgorithmto s hedule on homogeneousstar platforms. As alreadymentioned, weusea busnetwork with ommuni ation speed

c

, but additionallywesuppose that the omputation powersarehomogeneousaswell. So wehave

w

i

= w

forall

i

,

1 ≤ i ≤ m

.

TheideaofBBAissimple: inea hiteration,welookifwe ouldnishearlierifweredistribute atask. Ifso,wes hedule thetask, ifnot,westopredistributing. Thealgorithmhaspolynomial run-time. ItisanaturalintuitionthatBBAisoptimalonhomogeneousplatforms,buttheformal proofisrather ompli ated,as anbeseeninSe tion3.3.2.

(16)

3.3.1 Notationsusedin BBA

BBA s hedules onetask per iteration

i

. Let

L

(i)

k

denote thenumber of tasks of worker

k

after iteration

i

,i.e.,after

i

taskswereredistributed. Thedateatwhi hthemasterhasnishedre eiving the

i

-thtaskisdenotedby

master

_

in

(i)

. Inthesamewaywe all

master

_

out

(i)

thedateatwhi h themasterhasnishedsendingthe

i

-thtask. Let

end

(i)

k

bethedateatwhi hworker

k

wouldnish to pro esstheloaditwould holdifexa tly

i

tasksare redistributed. Theworker

k

initeration

i

withthebiggestnishtime

end

(i)

k

, whois hosento sendonetaskinthenextiteration,is alled

sender

. We all

receiver

theworker

k

withsmallestnishtime

end

(i)

k

initeration

i

whois hosen tore eiveonetaskinthenextiteration.

In iteration

i = 0

we are in the initial onguration: All workers own their initial tasks

L

(0)

k

= L

k

and the makespan of ea h worker

k

is the time it needs to ompute all its tasks:

end

(0)

k

= L

(0)

k

× w

.

master

_

in

(0)

= master

_

out

(0)

= 0

.

3.3.2 The BestBalan eAlgorithm -BBA Werstsket hBBA:

Inea hiteration

i

do: ˆ Computethetime

end

(i−1)

k

itwouldtakeworker

k

topro ess

L

(i−1)

k

tasks. ˆ A workerwith thebiggest nish time

end

(i−1)

k

is arbitrarily hosenas sender, heis alled

sender

.

ˆ Compute thetemporarynish times

end

g

(i)

k

of ea h workerif it would re eive from

sender

the

i

-thtask.

ˆ Aworkerwiththesmallesttemporarynishtime

end

g

(i)

k

willbethere eiver, alled

receiver

. Iftherearemultipleworkerswiththesametemporarynishtime

end

g

(i)

k

,wetaketheworker withthesmallestnishtime

end

(i−1)

k

.

ˆ If the nish time of

sender

is stri tly larger than the temporary nish time

end

g

(i)

sender

of

sender

,

sender

sendsonetaskto

receiver

anditerate. Otherwisestop.

Lemma6. Onhomogeneousstar-platforms,initeration

i

the Best-Balan e Algorithm (Al-gorithm 1) always hooses as re eiver a worker whi h nishes pro essing the rst in iteration

i − 1

.

Proof. Astheplatformis homogeneous,all ommuni ationstakethesametimeandall ompu-tationstakethesametime. InAlgorithm1themaster hoosesasre eiveriniteration

i

theworker

k

thatwouldendtheearliestthepro essingofthe

i

-thtasksent. Toprovethat worker

k

isalso theworkerwhi hnishespro essinginiteration

i − 1

rst,wehaveto onsidertwo ases:

ˆ Task iarrives when allworkers are stillworking.

As allworkersarestillworkingwhenthemasternishesto sendtask

i

,themaster hooses asre eiveraworkerwhi hnishes pro essingthe rst,be ausethis workerwill also nish pro essingtask

i

rst,aswehavehomogeneous onditions. SeeFigure9(a)foranexample: themaster hoosesworker

k

as initeration

i − 1

itnishesbefore worker

j

andit anthus start omputingtask

i + 1

earlierthanworker

j

oulddo.

ˆ Task iarrives when someworkers have nished working.

If some workershavenished working when the master annish to send task

i

, we are in thesituation ofFigure 9(b): Allthese workers ouldstartpro essing task

i

at thesame time. Asouralgorithm hoosesinthis aseaworkerwhi hnishedpro essingrst(seeline 13in Algorithm1),themaster hoosesworker

k

intheexample.

(17)

P

j

P

k

g

end

(i)

j

end

(i−1)

k

end

(i)

k

g

end

(i−1)

j

omputation ommuni ation

i

+ 1

i

+ 1

i+ 1

i

+ 1

(a)Allworkersarestillpro essing

P

j

P

k

end

(i−1)

k

end

(i−1)

j

g

end

(i)

j

= g

end

(i)

k

i

+ 1

i

+ 1

i

+ 1

i

+ 1

(b)Someworkershavealready nishedpro essing

Figure9: Initeration

i

: Themaster hooseswhi hworkerwillbethere eiveroftask

i

.

Theaim ofthese s hedules isalwaysto minimizethemakespan. So workerswhotakealong time to pro ess their tasksare interested in sending sometasks to other workerswhi h are less harged inorder to de reasetheirpro essing time. Ifaweakly hargedworkersends sometasks to another workerthis will not de rease theglobal makespan,asa strongly hargedworkerhas stillitslongpro essingtimeoritspro essingtimemightevenhavein reasedifitwasthere eiver. Soit mighthappenthat theweakly harged workerwhosent ataskwill re eiveanothertask in another s hedulingstep. Inthe followinglemma wewill show that this kindof s hedule, where sending workersalso re eive tasks, anbetransformed in as hedule where this ee t does not appear.

Lemma 7. On a platform with homogeneous ommuni ations, if there existsa s hedule

S

with makespan

M

,then therealso existsas hedule

S

with amakespan

M

≤ M

su hthat no worker both sendsandre eives tasks.

Proof. Wewill provethat we an transform as hedule where sendersmight re eive tasks in a s hedulewithequalorsmallermakespanwheresendersdonotre eiveanytasks.

s

k

r

j

s

k

r

j

s

i

s

i

Figure 10: S hemeonhowtobreakupsending hains.

Ifthemasterre eivesits

i

-thtaskfrompro essor

P

j

andsendsittopro essor

P

k

,wesaythat

P

k

re eivesthistaskfrompro essor

P

j

.

Whateverthes hedule,ifasenderre eivesataskwehavethesituationofasending hain(see Figure10): atsomestepofthes heduleasender

s

i

sendstoasender

s

k

,whilein anotherstepof thes hedulethesender

s

k

sendstoare eiver

r

j

. Sothemasteriso upiedtwi e. Asallre eivers re eivein fa t theirtasks from themaster, it doesnot makea dieren efor them whi h sender sentthetasktothemaster. Sowe anbreakupthesending hainin thefollowingway: Welook for the earliesttime, when a sending worker,

s

k

, re eivesa task from asender,

s

i

. Let

r

j

be a re eiverthatre eivesataskfromsender

s

k

. Therearetwopossiblesituations:

(18)

1. Sender

s

i

sendstosender

s

k

andlatersender

s

k

sendstore eiver

r

j

,seeFigure11(a). This aseissimple: Asthe ommuni ationfrom

s

i

to

s

k

takespla erstandwehavehomogeneous ommuni ationlinks,we anrepla ethis ommuni ationbyanemission from sender

s

i

to re eiver

r

j

andjust deletethese ond ommuni ation.

2. Sender

s

k

sendstore eiver

r

j

andlatersender

s

i

sendstosender

s

k

,seeFigure11(b). Inthis asethe re eptionon re eiver

r

j

happens earlierthanthe emissionof sender

s

i

, so we an notuseexa tlythesameme hanismasintheprevious ase. Butwe anuseourhypothesis thatsender

s

k

istherstsenderthatre eivesatask. Therefore,sender

s

i

didnotre eiveany taskuntil

s

k

re eives. Soatthemomentwhen

s

k

sendsto

r

j

,weknowthatsender

s

i

already ownsthetaskthatitwillsendlatertosender

s

k

. Asweusehomogeneous ommuni ations, we an s hedule the ommuni ation

s

i

→ r

j

when the ommuni ation

s

k

→ r

j

originally tookpla e anddeletethesendingfrom

s

i

to

s

k

.

As in both ases we gain in ommuni ation time, but we keep the same omputation time, we donotin reasethe makespanof thes hedule, but wetransformedit in as hedule withoneless sending hain. Byrepeatingthispro edureforallsending hains,wetransformthes hedule

S

in as hedule

S

withoutsending hainswhilenotin reasingthemakespan.

r

j

s

i

s

k

time time

(a)Sender

s

i

sendstore eivingsender

s

k

and thensender

s

k

sendstore eiver

r

j

.

r

j

s

i

s

k

time time

(b) Sender

s

k

sendsrst to re eiver

r

j

and thenre eivesfromsender

s

i

.

Figure 11: How to break up sending hains, dark olored ommuni ations are emissions, light olored ommuni ationsrepresentre eptions.

Proposition1. Best-Balan eAlgorithm(Algorithm1) al ulatesanoptimals hedule

S

on ahomogeneousstarnetwork,wherealltasksareinitiallylo atedontheworkersand ommuni ation apabilitiesaswell as omputation apabilities arehomogeneousandalltaskshave the samesize.

Proof. ToprovethatBBAisoptimal,wetakeas hedule

S

algo

al ulatedbyAlgorithm1. Then wetakeanoptimals hedule

S

opt

. (Be auseofLemma 7we anassumethatin thes hedule

S

opt

noworkerbothsends andre eivestasks.) Weare going to transformby indu tion this optimal s heduleinto ours hedule

S

algo

.

Asweuseahomogeneousplatform,allworkershavethesame ommuni ationtime

c

. Without lossof generality,we an assumethatbothalgorithmsdoall ommuni ationsassoonaspossible (see Figure 12). So we an divide our s hedule

S

algo

in

s

a

steps and

S

opt

in

s

o

steps. A step orrespondstotheemissionofonetask,andwenumberinthisorderthetaskssent. A ordingly the

s

-th task is the task sent during step

s

and the a tual s hedule orresponds to the load distributionafterthe

s

rsttasks. Westartours hedule attime

T = 0

.

Let

S(i)

denote theworkerre eiving the

i

-th task under s hedule

S

. Let

i

0

betherst step where

S

opt

diersfrom

S

algo

,i.e.,

S

algo

(i

0

) 6= S

opt

(i

0

)

and

∀i < i

0

,

S

algo

(i) = S

opt

(i)

. Welookfor astep

j > i

0

,ifitexists,su h that

S

opt

(j) = S

algo

(i

0

)

and

j

isminimal.

Weare inthe followingsituation: s hedule

S

opt

and s hedule

S

algo

arethesameforall tasks

[1..(i

0

− 1)]

. As worker

S

algo

(i

0

)

is hosen at step

i

0

, then, by denition of Algorithm 1, this meansthatthisworkernishesrstitspro essingafterthere eptionofthe

(i

0

− 1)

-thtasks( f.

(19)

Algorithm1Best-Balan eAlgorithm 1: /*initialization*/ 2:

i ← 0

3:

master

_

in

(i)

← 0

4:

master

_

out

(i)

← 0

5:

∀k L

(0)

k

← L

k

6:

end

(0)

k

← L

(0)

k

× w

7: /*thes heduling*/ 8: whiletruedo

9:

sender ← max

k

end

(i)

k

10:

master

_

in

(i+1)

← master

_

in

(i)

+ c

11:

task

_

arrival

_

worker = max(master

_

in

(i+1)

, master

_

out

(i)

) + c

12:

∀k g

end

(i+1)

k

← max(end

(i+1)

k

, task

_

arrival

_

worker) + w

13: sele t

receiver

su hthat

end

g

(i+1)

receiver

= min

k

end

g

(i+1)

k

andifthereareseveralpro essorswith thesameminimum

end

g

(i+1)

k

, hooseonewiththesmallest

end

(i)

k

14: if

end

(i)

sender

≤ g

end

(k+1)

receiver

then

15: /*we annotimprovethemakespananymore*/ 16: break

17: else

18: /*weimprovethemakespanbysendingthetasktothe

receiver

*/ 19:

master

_

out

(i+1)

← task

_

arrival

_

worker

20:

end

(i+1)

sender

← end

(i)

sender

− w

21:

L

(i+1)

sender

← L

(i)

sender

− 1

22:

end

(i+1)

receiver

← g

end

(i+1)

receiver

23:

L

(i+1)

receiver

← L

(i)

receiver

+ 1

24: for all

j 6= receiver

and

j 6= sender

do 25:

end

(i+1)

j

← end

(i)

j

26:

L

(i+1)

j

← L

(i)

j

27: endfor 28:

i ← i + 1

29: endif 30: endwhile

(20)

T

= 0

1

2

3

n

1

2

n

− 1

n

re eptionsbythemaster:

sendingsfromthemaster:

Figure 12: O upationofthemaster.

Lemma 6). As

S

opt

and

S

algo

dier in step

i

0

, weknowthat

S

opt

hoosesworker

S

opt

(i

0

)

that nishesthes hedule ofitsloadafterstep

(i

0

− 1)

nosoonerthanworker

S

algo

(i

0

)

.

Case 1:Letusrst onsiderthe asewherethere existssu hastep

j

. So

S

algo

(i

0

) = S

opt

(j)

and

j > i

0

. Weknowthat worker

S

opt

(j)

under s hedule

S

opt

doesnotre eiveanytaskbetween step

i

0

and step

j

as

j

is hosenminimal.

Weusethefollowingnotationsforthes hedule

S

opt

,depi tedonFigures13,14,and15:

T

j

: thedateatwhi hthere eptionoftask

j

isnishedonworker

S

opt

(j)

,i.e.,

T

j

= j × c + c

(the timeittakesthemastertore eivethersttaskplusthetimeittakeshimtosend

j

tasks).

T

i

0

: thedateatwhi hthere eptionoftask

i

0

isnishedonworker

S

opt

(i

0

)

,i.e.,

T

i

0

= i

0

× c + c

.

F

pred(j)

: timewhen omputationoftask

pred(j)

isnished,wheretask

pred(j)

denotesthelast taskwhi his omputedonworker

S

opt

(j)

beforetask

j

is omputed.

F

pred(i

0

)

: time when omputation of task

pred(i

0

)

is nished, where task

pred(i

0

)

denotes the last taskwhi his omputedonworker

S

opt

(i

0

)

beforetask

i

0

is omputed.

Wehaveto onsidertwosub- ases: ˆ

T

j

≤ F

pred(i

0

)

(Figure13(a)).

Thismeansthatweareinthefollowingsituation: there eptionoftask

j

onworker

S

opt

(j)

hasalreadynishedwhenworker

S

opt

(i

0

)

nishestheworkithasbeens heduleduntilstep

i

0

− 1

.

In this ase we ex hange the tasks

i

0

and

j

of s hedule

S

opt

and we reate the following s hedule

S

opt

:

S

opt

(i

0

) = S

opt

(j) = S

algo

(i

0

)

,

S

opt

(j) = S

opt

(i

0

)

and

∀i 6= i

0

, j, S

opt

(i) = S

opt

(i)

. The s heduleof theotherworkersiskeptun hanged. All tasksareexe utedatthesamedatethanpreviously(butmaybenotonthesamepro essor).

S

opt

(i

0

)

S

algo

(i

0

) = S

opt

(j)

T

i

0

F

pred(j)

T

j

F

pred(i

0

)

j

+ 1

i

0

i

0

j

+ 1

i

0

+ k

j

j

i

0

+ k

i

0

(a)Beforetheex hange.

F

pred(i

0

)

S

opt

(i

0

)

S

algo

(i

0

) = S

opt

(j)

T

i

0

T

j

T

pred(j)

j

j

+ 1

i

0

i

0

j

i

0

+ k

i

0

+ k

j

+ 1

i

0

(b)Afterex hange.

(21)

Nowweprovethatthiskindofex hangeispossible.

We knowthat worker

S

opt

(j)

is not s heduled any task later than step

i

0

− 1

and before step

j

, by denition of

j

. Sowe know that this worker an start pro essing task

j

when task

j

has arrivedand when it hasnished pro essing itsamountof work s heduleduntil step

i

0

− 1

. Wealready know that worker

S

opt

(j) = S

algo

(i

0

)

nishespro essing its tasks s heduled until step

i

0

− 1

at a time earlier than orequal to that of worker

S

opt

(i

0

)

( f. Lemma 6). Aswearein homogeneous onditions, ommuni ationsandpro essingofatask takesthesametimeonallpro essors. Sowe anex hangethedestinationsofsteps

i

0

and

j

andkeepthesamemomentsofexe ution,asbothtaskswillarriveintimetobepro essed ontheotherworker: task

i

0

will arriveat worker

S

opt

(j)

whenitisstill pro essingandthe samefortask

j

onworker

S

opt

(i

0

)

. Hen etask

i

0

will besentto worker

S

opt

(j) = S

algo

(i

0

)

andworker

S

opt

(i

0

)

willre eivetask

j

. Sos hedule

S

opt

ands hedule

S

algo

arethesamefor alltasks

[1..i

0

]

now. As bothtasksarrivein timeand anbeexe utedinsteadoftheother task, wedo not hangeanythingin themakespan

M

. Andas

S

opt

is optimal,wekeepthe optimalmakespan.

ˆ

T

j

≥ F

pred(i

0

)

(Figure14(a)).

Inthis asewehavethefollowingsituation: task

j

arrivesonworker

S

opt

(j)

, whenworker

S

opt

(i

0

)

hasalreadynishedpro essingitstaskss heduleduntilstep

i

0

− 1

.

In this ase weex hange the s hedule destinations

i

0

and

j

of s hedule

S

opt

beginning at tasks

i

0

and

j

(seeFigure14). Inother wordswe reateas hedule

S

opt

:

∀i ≥ i

0

su hthat

S

opt

(i) = S

opt

(i

0

)

:

S

opt

(i) = S

opt

(j) = S

algo

(i

0

)

∀i ≥ j

su hthat

S

opt

(i) = S

opt

(j)

:

S

opt

(i) = S

opt

(i

0

)

and

∀i ≤ i

0

S

opt

(i) = S

opt

(i)

. Thes hedule

S

opt

oftheotherworkersiskeptun hanged. We re ompute thenishtimes

F

(s)

S

opt

(j)

ofworkers

S

opt

(j)

and

S

opt

(i

0

)

forallsteps

s > i

0

.

T

i

0

F

pred(j)

T

j

F

pred(i

0

)

S

algo

(i

0

) = S

opt

(j)

S

opt

(i

0

)

i

0

i

0

+ k

i

0

i

0

+ k

j

j

+ 1

j

j

+ 1

(a)Beforeex hange.

T

j

F

pred(i

0

)

F

pred(j)

T

i

0

S

opt

(i

0

)

S

algo

(i

0

) = S

opt

(j)

i

0

j

+ 1

i

0

+ k

j

i

0

j

j

+ 1

i

0

+ k

i

0

(b)Afterex hange.

Figure 14: S hedule

S

opt

before andafterex hangeoflines

i

0

and

j

.

Nowweprovethatthiskindofex hangeispossible. Firstofallweknowthatworker

S

algo

(i

0

)

is thesame asthe worker hosenin step

j

under s hedule

S

opt

andso

S

algo

(i

0

) = S

opt

(j)

. Wealsoknowthatworker

S

opt

(j)

isnots heduledanytaskslaterthanstep

i

0

− 1

andbefore step

j

, bydenition of

j

. Be ause of the hoi e ofworker

S

algo

(i

0

) = S

opt

(j)

in

S

algo

, we knowthatworker

S

opt

(j)

hasnishedworkingwhentask

j

arrives:atstep

i

0

worker

S

opt

(j)

nishesearlierthanorat thesametimeasworker

S

opt

(i

0

)

(Lemma6)andaswearein the asewhere

T

j

≥ F

pred(i

0

)

,

S

opt

(j)

hasalsonishedwhen

j

arrives. Sowe anex hangethe destinationsoftheworkers

S

opt

(i

0

)

and

S

opt

(j)

inthes hedulestepsequalto,orlaterthan, step

i

0

andpro essthematthesametimeaswewoulddoontheotherworker.Aswehave shown that we anstart pro essingtask

j

on worker

S

opt

(i

0

)

at the sametime as we did on worker

S

opt

(j)

, and the samefor task

i

0

, wekeepthe samemakespan. And as

S

opt

is optimal,wekeeptheoptimalmakespan.

Case 2: Iftheredoesnotexista

j

, i.e.,we annotndas hedule step

j > i

0

su hthat worker

(22)

onworker

S

algo

(i

0

)

under thes hedule

S

opt

. As ouralgorithm hoosesin step

s

theworkerthat nishestask

s + 1

therst,weknowthatworker

S

algo

(i

0

)

nishesatatimeearlierorequaltothat of

S

opt

. Worker

S

algo

(i

0

)

willbeidleinthes hedule

S

opt

fortherestofthealgorithm,be ause oth-erwisewewouldhavefoundastep

j

. Asweareinhomogeneous onditions,we ansimplydispla e task

i

0

fromworker

S

opt

(i

0

)

to worker

S

algo

(i

0

)

(seeFigure 15). As wehave

S

opt

(i

0

) 6= S

algo

(i

0

)

andwithLemma6weknowthatworker

S

algo

(i

0

)

nishespro essingitstasksuntilstep

i

0

− 1

at atimeearlierthanorequalto

S

opt

(i

0

)

,andwedonotdowngradetheexe utiontimebe ausewe areinhomogeneous onditions.

T

i

0

F

(pred(i

0

))

S

algo

(S

algo

(i

0

))

F

pred((i

0

))

S

opt

(S

opt

(i

0

))

S

opt

(i

0

)

S

algo

(i

0

)

i

0

i

0

+ k

i

0

i

0

+ k

i

0

(a)Beforedispla ing

T

i

0

F

(pred(i

0

))

S

opt

(S

opt

(i

0

))

S

opt

(i

0

)

S

algo

(i

0

)

F

(pred(i

0

))

S

algo

(S

algo

(i

0

))

i

0

i

0

+ k

i

0

+ k

i

0

i

0

(b)Afterdispla ing

Figure15: S hedule

S

opt

before andafterdispla ingtask

i

0

.

On e wehavedonetheex hangeof task

i

0

, thes hedules

S

opt

and

S

algo

are thesamefor all tasks

[1..i

0

]

. Werestartthetransformation until

S

opt

= S

algo

foralltasks

[1.. min(s

a

, s

o

)]

s hed-uledby

S

algo

.

Nowwewillproveby ontradi tionthatthenumberoftaskss heduledby

S

algo

,

s

a

,and

S

opt

,

s

o

,arethesame. After

min(s

a

, s

o

)

transformationsteps

S

opt

= S

algo

foralltasks

[1.. min(s

a

, s

o

)]

s heduledby

S

algo

. Soifafterthesesteps

S

opt

= S

algo

forall

n

tasks,bothalgorithmsredistributed thesamenumberoftasksand wehavenished.

Wenow onsiderthe ase

s

a

6= s

o

. Inthe aseof

s

a

> s

o

,

S

algo

s hedulesmoretasksthan

S

opt

. Atea hstepofouralgorithmwedonotin reasethemakespan. Soifwedomorestepsthan

S

opt

, this meansthat wes heduledsometasks without hangingtheglobalmakespan. Hen e

S

algo

is optimal.

If

s

a

< s

o

, this means that

S

opt

s hedules moretasks than

S

algo

does. In this ase,after

s

a

transformationsteps,

S

opt

stills hedulestasks. Ifwetakealookatthes heduleofthe

(s

a

+ 1)

-th task in

S

opt

: regardless whi h re eiver

S

opt

hooses, it will in rease the makespan as we prove now. In the following we will all

s

algo

the workerour algorithm would have hosen to be the sender,

r

algo

the workerour algorithm would have hosento be there eiver.

s

opt

and

r

opt

are thesenderandre eiver hosenbytheoptimals hedule. Indeed,in ouralgorithmwewouldhave hosen

s

algo

assendersu hthatitisaworkerwhi hnisheslast. Sothetimeworker

s

algo

nishes pro essing is

F

s

algo

= M (S

algo

)

.

S

algo

hoosesthe re eiver

r

algo

su h that itnishes pro essing there eivedtask theearliestofallpossiblere eiversandsu hthat italsonishespro essingthe re eivingtask at thesametime orearlierthan thesenderwoulddo. As

S

algo

did notde ideto sendthe

(s

a

+1)

-thtask,thismeans,thatit ouldnotndare eiverwhi htted. Hen eweknow, regardlesswhi hre eiver

S

opt

hooses,thatthemakespanwillstri tlyin rease(as

S

algo

= S

opt

for all

[1..s

a

]

). Wetakealookatthemakespanof

S

algo

ifwewouldhaves heduledthe

(s

a

+1)

-thtask. Weknowthat we an notde reasethemakespananymore,be ausein ouralgorithmwede ided tokeepthes heduleun hanged. Soaftertheemissionofthe

(s

a

+ 1)

-thtask,themakespanwould be ome

M (S

algo

) = F

r

algo

≥ F

s

algo

. And

F

r

algo

≤ F

r

opt

,be auseofthedenitionofre eiver

r

algo

. As

M (s

opt

) ≥ F

r

(23)

M (S

algo

)

is smaller before the s hedule of the

(s

a

+ 1)

-th task than afterwards. Hen e we get that

M (S

algo

) < M (S

opt

)

. Sothe only possibility why

S

opt

sends the

(s

a

+ 1)

-th task andstill beoptimalis that,lateron,

r

opt

sends ataskto someotherpro essor

r

k

. (Notethat evenifwe hoose

S

opt

to haveno su h hains in thebeginning, some mighthave appeared be ause of our previoustransformations). Inthe samemanner aswe transformedsending hains in Lemma 7, we ansuppress thissending hain, bysendingtask

(s

a

+ 1)

dire tly to

r

k

insteadof sendingto

r

opt

. With the sameargumentation, wedo thisby indu tion for alltasks

k

,

(s

a

+ 1) ≤ k ≤ s

o

, until s hedule

S

opt

and

S

algo

have the same number

s

o

= s

a

and so

S

opt

= S

algo

and hen e

M (S

opt

) = M (S

algo

)

.

Complexity: The initialization phase is in

O(m)

, aswehaveto omputethe nish times for ea hworker. The while loop anbe runat maximum

n

times, aswe annot redistributemore thanthe

n

tasksof thesystem. Ea hiterationisin theorderof

O(m)

, whi h leadsus toatotal runtimeof

O(m × n)

.

3.4 S heduling on platforms with homogeneous ommuni ation links and heterogeneous omputation apa ities

Inthisse tionwepresentanalgorithmforstar-platformswithhomogeneous ommuni ationsand heterogeneousworkers,theMoore BasedBinary-Sear hAlgorithm(MBBSA).Foragiven makespan,we omputeifthereexistsapossibles heduletonishallworkintime. Ifthereisone, weoptimizethemakespanbyabinarysear h. Theplanofthese tionisasfollows:InSe tion3.4.1 we presentanexisting algorithm whi h willbethe basisofour work. Theframeworkand some usefull notations are introdu ed in Se tion 3.4.2, whereas the real algorithm is the subje t of Se tion3.4.3.

3.4.1 Moore's algorithm

In this se tionwepresentMoore's algorithm [6, 18℄, whose aim is to maximize thenumber oftasks tobepro essed in-time,i.e.,before tasksex eedtheirdeadlines. Thisalgorithm givesa solutiontothe

1||

P

U

j

problemwhenthemaximumnumber,among

n

tasks,hastobepro essed intimeonasinglema hine. Ea htask

k

,

1 ≤ k ≤ n

,hasapro essingtime

w

k

andadeadline

d

k

, beforewhi h ithastobepro essed.

Moore'salgorithm worksas follows: All tasksareorderedin non-de reasingorder oftheir deadlines. Tasks areaddedtothesolutiononebyoneinthisorderaslongastheirdeadlinesare satised. Ifa task

k

is outoftime, the task

j

in thea tualsolution withthe largestpro essing time

w

j

isdeleted fromthesolution.

Algorithm2[6,18℄solvesin

O(n log n)

the

1||

P

U

j

problem: it onstru tsamaximalset

σ

of earlyjobs.

Algorithm2Moore'salgorithm

1: Orderthejobs bynon-de reasingdeadlines:

d

1

≤ d

2

≤ · · · ≤ d

d

2:

σ ← ∅

;

t ← 0

3: for

i := 1

to

n

do 4:

σ ← σ ∪ {i}

5:

t ← t + w

i

6: if

t > d

i

then

7: Find job

j

in

σ

with largest

w

j

value

8:

σ ← σ\{j}

9:

t ← t − w

j

10: endif 11: endfor

Références

Documents relatifs

Whenever there is no waiting limit (setting W large enough), the authors of [11] decompose optimal paths- with-waits into alternating sequences of waits and paths by expanding

A branch-and-cut algorithm for the generalized traveling salesman problem with time windows.. Yuan Yuan, Diego Cattaruzza, Maxime Ogier,

Although one should only expect to have good chances to solve instances of size up to around 80 moves within a four hours limit, our experiments still suggest that, when the

This note studies the bicriteria problem of scheduling n jobs on a series- batching machine to minimize maximum cost and makespan simultaneously.. A series-batching machine is a

Although one should only expect to have good chances to solve instances of size up to around 80 moves within a four hours limit, our experiments still suggest that, when the

Endocrinologie et Maladies Métaboliques Dermatologie Gastro-Entérologie Anatomie Pathologique Psychiatrie Chirurgie Générale Pédiatrie Chirurgie Pédiatrique Dermatologie

En outre, le laboratoire s’est équipé des technologies récentes de type NGS (Next Generation Sequencing) ou « Séquençage Haut Débit » qui ont permis de