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�
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
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.
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.
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
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 essorsP
0
, P
1
, . . . , P
m
, whereP
0
is the master. Ea h pro essorP
k
,1 ≤ k ≤ m
initially holdsL
k
data items. Duringours hedulingpro esswetryto determine whi h pro essorP
i
should send some datatoanotherworkerP
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
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:
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 essorP
0
isthemasterandthem
remainingpro essorsP
i
,1 ≤ i ≤ m
,areworkers. Theinitialdataare distributed on theworkers,soeveryworkerP
i
possessesanumberL
i
of initial tasks. All tasks areindependentandidenti al. Asweassumealinear ostmodel,ea hworkerP
i
hasa(relative) omputingpowerw
i
forthe omputationofonetask: ittakesX.w
i
timeunitstoexe uteX
tasks ontheworkerP
i
. ThemasterP
0
an ommuni atewithea hworkerP
i
viaa ommuni ationlink. AworkerP
i
ansendsometasksviathemastertoanotherworkerP
j
tode rementitsexe ution time. IttakesX.c
i
timeunitsto sendX
units ofloadfromP
i
toP
0
andX.c
j
timeunitstosend theseX
units fromP
0
to aworkerP
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 essorP
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).
Worker w load
P
1
1 1 13P
2
8 1 13P
3
1 9 0P
4
1 10 0Figure 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 essorP
0
alled master" andm
workers. Letn
be the number of identi al tasks distributed to the workers. For ea h workerP
i
, letw
i
be the omputationtimeforonetask. Ea h ommuni ationlink,link
i
,hasanasso iated ommuni ation timec
i
for thetransmissionof onetask. FinallyletT
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: WorkersP
3
andP
4
do notownanytask,andtheyare omputingveryslowly. Soea hofthem an omputeexa tlyone task. WorkerP
1
, whoisafastpro essorand ommuni ator,sends themtheirtasksand re eives lateranothertaskfromworkerP
2
thatit an omputejust intime. Note thatworkerP
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. WorkerP
2
has to send onetaskeithertoworkerP
3
ortoworkerP
4
. Sending andre eivingthistasktakes9timeunits. Consequentlythepro essingofthis task annotnishearlierthantimet = 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 ipatingworkersP
1
, P
2
, . . . P
m
holdtheirinitialuniformtasksL
i
,1 ≤ i ≤ m
. ForaworkerP
i
the hosenalgorithmforthe omputationoftheimbalan ehasde idedthatthenewloadshould beL
i
− δ
i
. Ifδ
i
> 0
,this meansthatP
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.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 reasingc
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 reasingc
i
-valuesandthe re eiversby non-in reasing orderofc
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 transformS
intwostepsintoours heduleS
′
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 weknowtheorderinginS
′
: allsendersareorderedinnon-de reasingorderoftheir
c
i
-values. Leti
0
bethe rst task sent inS
where the senderof taski
0
hasa biggerc
i
-value than the sender of the(i
0
+ 1)
-thtask. Wethen ex hange thesendersof taski
0
andtask(i
0
+ 1)
and allthis new s heduleS
new
. Obviously the re eptiontime for the se ond task is still the same. But asyou 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 ofS
′
and atea h time theavailabilityonthemasterisimproved. Hen eattheendofthetransformationthemakespan of
S
new
issmallerthanorequaltothat ofS
andthesending orderofS
new
andS
′
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
bythersttransformationofS
intoS
new
,westart heredire tlybythetransformationofS
new
. Usingthesameme hanismasforthesenders,we allj
0
therst tasksu h thatthe re eiveroftaskj
0
hasasmallerc
i
-valuethanthe re eiveroftaskj
0
+ 1
. Weex hange there eiversofthe tasksj
0
andj
0
+ 1
and allthe news heduleS
new
(1)
.j
0
issentatthesametimethanpreviously,andthepro essorre eivingit,re eivesitearlierthan itre eivedj
0+1
inS
new
.j
0+1
is sentassoonasitis available onthemaster andassoonasthe ommuni ationof taskj
0
is ompleted. Therstof thesetwo onditionshad alsotobesatised byS
new
. Ifthese ond onditionisdelayingthebeginningofthesendingofthetaskj
0
+ 1
from themaster,thenthis ommuni ationendsattimet
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 eiveroftaskj
0
ins heduleS
new
(S
new
(1)
,respe tively)). Hen ethenishtimeof the ommuni ationof taskj
0
+ 1
in s heduleS
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 eivedafterj
0+1
ex eptthatwealwaysperformthes heduled ommuni ationsas soonas possible. Repeating the transformation for the rest of the s heduleS
new
we redu e all idle times in the re eptions as far as possible. We get for the makespan of ea h s heduleS
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 thec
i
-values, the re eiverorderofS
new
(∞)
isthesameasthere eiverorderofS
′
andhen ewehave
S
new
(∞)
= S
′
. Finallywe on ludethatthemakespanofS
′
issmallerthanorequaltoanyothers hedule
S
and hen eS
′
isoptimal.t
t
idle idlen
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
t
t
idlen
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 of3n
integers su hthatfor ea hi
,S
4
< y
i
<
S
2
.The question ofthe 3-partitionproblem isCanwepartitionthe setof the
y
i
inn
triples su h that thesum of ea htriple isexa tlyS
?".Theorem2. SPMSTSHPisNP- ompleteinthe strongsense.
Proof. We take an instan e of 3-partition. We dene somereal numbers
x
i
,1 ≤ i ≤ 3n
, byx
i
=
1
4
S +
y
8
i
. Ifatripleofy
i
hasthesumS
,the orrespondingtripleofx
i
orrespondstothesum7S
8
and vi eversa. A partitionofy
i
in triplesisthus equivalenttoapartitionofthex
i
in triples of thesum7S
8
. This modi ationallowsus to guaranteethat thex
i
are ontainedin asmaller intervalthantheintervalofthey
i
. Ee tivelythex
i
arestri tlyin ludedbetween9S
32
and5S
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
owns4n
tasks, the other4n
workers do not hold any task. Wework with the deadlineT = E + nS +
S
4
, whereE
is an enormoustime xed toE = (n + 1)S
. The ommuni ationlink betweenP
andthemaster hasac
-valueofS
4
. Soit an sendataskallS
4
timeunits. Its omputationtime isT + 1
,so workerP
hastodistribute allits tasks asit annotnish pro essing asingle taskby the deadline. Ea h of theother workersis abletopro ess onesingletask,asits omputation timeisatleastE
andwehave2E > 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
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 timeS
4
+ nS + E
out of a3-partitionsolution. Tofa ilitate the le ture, the pro essorsP
i
are ordered by theirx
i
-values in the order that orresponds to the solution of 3-partition. So, without loss of generality, we assume that for ea hj ∈ [0, n − 1]
,x
3j+1
+ x
3j+2
+ x
3j+3
=
7S
8
. Thes hedule isofthefollowingform:1. Worker
P
sendsitstasksas soonaspossibletothemaster,i.e.,everyS
4
timeunits. Soitis guaranteedthat the4n
tasksaresentinnS
timeunits.2. Themastersendsthetasksassoonaspossibleinin omingordertotheworkers.There eiver order isthefollowing(forall
j ∈ [0, n − 1]
): Task
4j + 1
,overlink of ostx
3j+1
,topro essorP
3j+1
. Task4j + 2
,overlink of ostx
3j+2
,topro essorP
3j+2
. Task4j + 3
,overlink of ostx
3j+3
,topro essorP
3j+3
. Task4j + 4
,overlink of ostS
8
,topro essorQ
n−1−j
.Thedistributionof thefour tasks,
4j + 1
,4j + 2
,4j + 3
,4j + 4
, takesexa tlyS
time units andthemasterneedsalsoS
timeunitstore eivefourtasksfrompro essorP
. Furthermore,ea hx
i
islargerthanS
4
. Therefore,after thersttaskissent,themasteralwaysnishesto re eivea newtask beforeits outgoingport is available to sendit. Therst taskarrivesat timeS
4
at the master, whi h isresponsibleforthe shortidletime atthebeginning. Thelasttask arrivesat its workerattimeS
4
+ nS
andhen eitrestsexa tlyE
timeunitsforthepro essingofthistask. For theworkersP
i
,1 ≤ i ≤ 3n
, weknow that they annish topro esstheir tasksin time asthey allhavea omputation powerofE
. The omputationpoweroftheworkersQ
i
,0 ≤ i ≤ n − 1
,isE + i × S
andas theyre eivetheirtask attimeS
4
+ (n − i − 1) × S +
7S
8
,theyhaveexa tlythe timetonishtheirtask.Gettinga solutionfor 3-partition outof as hedule. Nowweprovethat ea hs heduleof
4n
tasksin timeT
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 hedulewouldtakelongerthantimeT
.Wealsoknowthat worker
P
istheonlysendingworker: Lemma1. Noworkerbesides workerP
sendsany task.Proof. Due to theplatform ongurationand thetotal numberoftasks, worker
P
hasto send allitstasks. This takesatleastnS
timeunits. Thetotalemissiontimeforthemasteris alsonS
time units: asea h workermustpro ess atask,ea hof them mustre eiveone. Sothe emission timeforthemaster islargerthanorequaltoP
n
i=1
x
i
+ n ×
S
8
= nS
. Asthemaster annotstart sending the rst task before timeS
4
and asthe minimum omputation power isE
, then if the mastersendsexa tlyonetasktoea hslave,themakespanisgreaterthanorequaltoT
andifone workerbesidesP
sendsatask,themasterwillatleastsendoneadditionaltaskandthemakespan willbestri tlygreaterthanT
.Nowwearegoingtoexaminetheworker
Q
n−1
andthetaskheisasso iatedto.Proof. The omputation time of worker
Q
n−1
isE + (n − 1)S
, hen eits task hasto arriveno laterthan timeS +
S
4
. The fthtask arrivesat thesoonest at time5S
4
+
S
8
asworkerP
hasto sendvetasksastheshortest ommuni ationtimeisS
8
. Thefollowingtasksarrivelaterthanthe5
-thtask,sothetaskforworkerQ
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
,workerP
hasthetimetosend thenexttasktothemaster. But,ifatleastoneoftherstthreetasksissenttoaworkerQ
i
,the sending time of therst three tasks isstri tly inferior toS
8
+
5
16
S +
5
16
S =
3
4
S
. Hen e there is obligatoryanidletime intheemissionofthemaster. This pausemakesthes heduleof4n
tasks intimeT
infeasible.Adire t on lusionofthetwopre edentlemmasisthatthe
4
-thtaskissenttoworkerQ
n−1
. Lemma 4. The rst three taskssent by workerP
have atotal ommuni ation timeof7
8
S
time units.Proof. Worker
Q
n−1
hasa omputationtime ofE + (n − 1)S
,ithastore eiveits tasknolater thantime5
4
S
. Thisimpliesthattherstthreetasksaresentin atimenolongerthan7
8
S
. Ontheotherside,the5
-thtaskarrivesatthemasternosoonerthantime5
4
S
. Asthemasterhas tosendwithoutidletime,theemissionto workerQ
n−1
hastopersistuntilthisdate. Ne essarily therstthreeemissionsofthemastertakeatminimumatime7
8
S
.Lemma5. S heduling
4n
tasksinatimeT =
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 ursivelyonj
forthe triple4j + 1, 4j + 2
and4j + 3
, we show that wemust send the tasks4j + 4
to the workerQ
n−1−j
. With this method we onstru tapartition of the set ofx
i
in triplesof sum7
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 wehavew
i
= w
foralli
,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.
3.3.1 Notationsusedin BBA
BBA s hedules onetask per iteration
i
. LetL
(i)
k
denote thenumber of tasks of workerk
after iterationi
,i.e.,afteri
taskswereredistributed. Thedateatwhi hthemasterhasnishedre eiving thei
-thtaskisdenotedbymaster
_in
(i)
. Inthesamewaywe all
master
_out
(i)
thedateatwhi h themasterhasnishedsendingthe
i
-thtask. Letend
(i)
k
bethedateatwhi hworkerk
wouldnish to pro esstheloaditwould holdifexa tlyi
tasksare redistributed. Theworkerk
initerationi
withthebiggestnishtimeend
(i)
k
, whois hosento sendonetaskinthenextiteration,is alledsender
. We allreceiver
theworkerk
withsmallestnishtimeend
(i)
k
initerationi
whois hosen tore eiveonetaskinthenextiteration.In iteration
i = 0
we are in the initial onguration: All workers own their initial tasksL
(0)
k
= L
k
and the makespan of ea h workerk
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: Computethetimeend
(i−1)
k
itwouldtakeworkerk
topro essL
(i−1)
k
tasks. A workerwith thebiggest nish timeend
(i−1)
k
is arbitrarily hosenas sender, heis alledsender
. Compute thetemporarynish times
end
g
(i)
k
of ea h workerif it would re eive fromsender
thei
-thtask. Aworkerwiththesmallesttemporarynishtime
end
g
(i)
k
willbethere eiver, alledreceiver
. Iftherearemultipleworkerswiththesametemporarynishtimeend
g
(i)
k
,wetaketheworker withthesmallestnishtimeend
(i−1)
k
. If the nish time of
sender
is stri tly larger than the temporary nish timeend
g
(i)
sender
ofsender
,sender
sendsonetasktoreceiver
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 iterationi − 1
.Proof. Astheplatformis homogeneous,all ommuni ationstakethesametimeandall ompu-tationstakethesametime. InAlgorithm1themaster hoosesasre eiveriniteration
i
theworkerk
thatwouldendtheearliestthepro essingofthei
-thtasksent. Toprovethat workerk
isalso theworkerwhi hnishespro essinginiterationi − 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 essingtaski
rst,aswehavehomogeneous onditions. SeeFigure9(a)foranexample: themaster hoosesworkerk
as initerationi − 1
itnishesbefore workerj
andit anthus start omputingtaski + 1
earlierthanworkerj
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 taski
at thesame time. Asouralgorithm hoosesinthis aseaworkerwhi hnishedpro essingrst(seeline 13in Algorithm1),themaster hoosesworkerk
intheexample.P
j
P
k
g
end
(i)
j
end
(i−1)
k
end
(i)
k
g
end
(i−1)
j
omputation ommuni ationi
+ 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 eiveroftaski
.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 makespanM
,then therealso existsas heduleS
′
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 essorP
j
andsendsittopro essorP
k
,wesaythatP
k
re eivesthistaskfrompro essorP
j
.Whateverthes hedule,ifasenderre eivesataskwehavethesituationofasending hain(see Figure10): atsomestepofthes heduleasender
s
i
sendstoasenders
k
,whilein anotherstepof thes hedulethesenders
k
sendstoare eiverr
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
. Letr
j
be a re eiverthatre eivesataskfromsenders
k
. Therearetwopossiblesituations:1. Sender
s
i
sendstosenders
k
andlatersenders
k
sendstore eiverr
j
,seeFigure11(a). This aseissimple: Asthe ommuni ationfroms
i
tos
k
takespla erstandwehavehomogeneous ommuni ationlinks,we anrepla ethis ommuni ationbyanemission from senders
i
to re eiverr
j
andjust deletethese ond ommuni ation.2. Sender
s
k
sendstore eiverr
j
andlatersenders
i
sendstosenders
k
,seeFigure11(b). Inthis asethe re eptionon re eiverr
j
happens earlierthanthe emissionof senders
i
, so we an notuseexa tlythesameme hanismasintheprevious ase. Butwe anuseourhypothesis thatsenders
k
istherstsenderthatre eivesatask. Therefore,senders
i
didnotre eiveany taskuntils
k
re eives. Soatthemomentwhens
k
sendstor
j
,weknowthatsenders
i
already ownsthetaskthatitwillsendlatertosenders
k
. Asweusehomogeneous ommuni ations, we an s hedule the ommuni ations
i
→ r
j
when the ommuni ations
k
→ r
j
originally tookpla e anddeletethesendingfroms
i
tos
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 heduleS
′
withoutsending hainswhilenotin reasingthemakespan.
r
j
s
i
s
k
time time
(a)Sender
s
i
sendstore eivingsenders
k
and thensenders
k
sendstore eiverr
j
.r
j
s
i
s
k
time time
(b) Sender
s
k
sendsrst to re eiverr
j
and thenre eivesfromsenders
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 heduleS
opt
. (Be auseofLemma 7we anassumethatin thes heduleS
opt
noworkerbothsends andre eivestasks.) Weare going to transformby indu tion this optimal s heduleinto ours heduleS
algo
.Asweuseahomogeneousplatform,allworkershavethesame ommuni ationtime
c
. Without lossof generality,we an assumethatbothalgorithmsdoall ommuni ationsassoonaspossible (see Figure 12). So we an divide our s heduleS
algo
ins
a
steps andS
opt
ins
o
steps. A step orrespondstotheemissionofonetask,andwenumberinthisorderthetaskssent. A ordingly thes
-th task is the task sent during steps
and the a tual s hedule orresponds to the load distributionafterthes
rsttasks. Westartours hedule attimeT = 0
.Let
S(i)
denote theworkerre eiving thei
-th task under s heduleS
. Leti
0
betherst step whereS
opt
diersfromS
algo
,i.e.,S
algo
(i
0
) 6= S
opt
(i
0
)
and∀i < i
0
,S
algo
(i) = S
opt
(i)
. Welookfor astepj > i
0
,ifitexists,su h thatS
opt
(j) = S
algo
(i
0
)
andj
isminimal.Weare inthe followingsituation: s hedule
S
opt
and s heduleS
algo
arethesameforall tasks[1..(i
0
− 1)]
. As workerS
algo
(i
0
)
is hosen at stepi
0
, then, by denition of Algorithm 1, this meansthatthisworkernishesrstitspro essingafterthere eptionofthe(i
0
− 1)
-thtasks( f.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: whiletruedo9:
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 treceiver
su hthatend
g
(i+1)
receiver
= min
k
end
g
(i+1)
k
andifthereareseveralpro essorswith thesameminimumend
g
(i+1)
k
, hooseonewiththesmallestend
(i)
k
14: ifend
(i)
sender
≤ g
end
(k+1)
receiver
then15: /*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
andj 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: endwhileT
= 0
1
2
3
n
1
2
n
− 1
n
re eptionsbythemaster:
sendingsfromthemaster:
Figure 12: O upationofthemaster.
Lemma 6). As
S
opt
andS
algo
dier in stepi
0
, weknowthatS
opt
hoosesworkerS
opt
(i
0
)
that nishesthes hedule ofitsloadafterstep(i
0
− 1)
nosoonerthanworkerS
algo
(i
0
)
.Case 1:Letusrst onsiderthe asewherethere existssu hastep
j
. SoS
algo
(i
0
) = S
opt
(j)
andj > i
0
. Weknowthat workerS
opt
(j)
under s heduleS
opt
doesnotre eiveanytaskbetween stepi
0
and stepj
asj
is hosenminimal.Weusethefollowingnotationsforthes hedule
S
opt
,depi tedonFigures13,14,and15:T
j
: thedateatwhi hthere eptionoftaskj
isnishedonworkerS
opt
(j)
,i.e.,T
j
= j × c + c
(the timeittakesthemastertore eivethersttaskplusthetimeittakeshimtosendj
tasks).T
i
0
: thedateatwhi hthere eptionoftaski
0
isnishedonworkerS
opt
(i
0
)
,i.e.,T
i
0
= i
0
× c + c
.F
pred(j)
: timewhen omputationoftaskpred(j)
isnished,wheretaskpred(j)
denotesthelast taskwhi his omputedonworkerS
opt
(j)
beforetaskj
is omputed.F
pred(i
0
)
: time when omputation of taskpred(i
0
)
is nished, where taskpred(i
0
)
denotes the last taskwhi his omputedonworkerS
opt
(i
0
)
beforetaski
0
is omputed.Wehaveto onsidertwosub- ases:
T
j
≤ F
pred(i
0
)
(Figure13(a)).Thismeansthatweareinthefollowingsituation: there eptionoftask
j
onworkerS
opt
(j)
hasalreadynishedwhenworkerS
opt
(i
0
)
nishestheworkithasbeens heduleduntilstepi
0
− 1
.In this ase we ex hange the tasks
i
0
andj
of s heduleS
opt
and we reate the following s heduleS
′
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.Nowweprovethatthiskindofex hangeispossible.
We knowthat worker
S
opt
(j)
is not s heduled any task later than stepi
0
− 1
and before stepj
, by denition ofj
. Sowe know that this worker an start pro essing taskj
when taskj
has arrivedand when it hasnished pro essing itsamountof work s heduleduntil stepi
0
− 1
. Wealready know that workerS
opt
(j) = S
algo
(i
0
)
nishespro essing its tasks s heduled until stepi
0
− 1
at a time earlier than orequal to that of workerS
opt
(i
0
)
( f. Lemma 6). Aswearein homogeneous onditions, ommuni ationsandpro essingofatask takesthesametimeonallpro essors. Sowe anex hangethedestinationsofstepsi
0
andj
andkeepthesamemomentsofexe ution,asbothtaskswillarriveintimetobepro essed ontheotherworker: taski
0
will arriveat workerS
opt
(j)
whenitisstill pro essingandthe samefortaskj
onworkerS
opt
(i
0
)
. Hen etaski
0
will besentto workerS
opt
(j) = S
algo
(i
0
)
andworkerS
opt
(i
0
)
willre eivetaskj
. Sos heduleS
opt
ands heduleS
algo
arethesamefor alltasks[1..i
0
]
now. As bothtasksarrivein timeand anbeexe utedinsteadoftheother task, wedo not hangeanythingin themakespanM
. AndasS
opt
is optimal,wekeepthe optimalmakespan.
T
j
≥ F
pred(i
0
)
(Figure14(a)).Inthis asewehavethefollowingsituation: task
j
arrivesonworkerS
opt
(j)
, whenworkerS
opt
(i
0
)
hasalreadynishedpro essingitstaskss heduleduntilstepi
0
− 1
.In this ase weex hange the s hedule destinations
i
0
andj
of s heduleS
opt
beginning at tasksi
0
andj
(seeFigure14). Inother wordswe reateas heduleS
′
opt
:∀i ≥ i
0
su hthatS
opt
(i) = S
opt
(i
0
)
:S
′
opt
(i) = S
opt
(j) = S
algo
(i
0
)
∀i ≥ j
su hthatS
opt
(i) = S
opt
(j)
:S
′
opt
(i) = S
opt
(i
0
)
and
∀i ≤ i
0
S
′
opt
(i) = S
opt
(i)
. Thes heduleS
opt
oftheotherworkersiskeptun hanged. We re ompute thenishtimesF
(s)
S
opt
(j)
ofworkers
S
opt
(j)
andS
opt
(i
0
)
forallstepss > 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 hangeoflinesi
0
andj
.Nowweprovethatthiskindofex hangeispossible. Firstofallweknowthatworker
S
algo
(i
0
)
is thesame asthe worker hosenin stepj
under s heduleS
opt
andsoS
algo
(i
0
) = S
opt
(j)
. WealsoknowthatworkerS
opt
(j)
isnots heduledanytaskslaterthanstepi
0
− 1
andbefore stepj
, bydenition ofj
. Be ause of the hoi e ofworkerS
algo
(i
0
) = S
opt
(j)
inS
algo
, we knowthatworkerS
opt
(j)
hasnishedworkingwhentaskj
arrives:atstepi
0
workerS
opt
(j)
nishesearlierthanorat thesametimeasworkerS
opt
(i
0
)
(Lemma6)andaswearein the asewhereT
j
≥ F
pred(i
0
)
,S
opt
(j)
hasalsonishedwhenj
arrives. Sowe anex hangethe destinationsoftheworkersS
opt
(i
0
)
andS
opt
(j)
inthes hedulestepsequalto,orlaterthan, stepi
0
andpro essthematthesametimeaswewoulddoontheotherworker.Aswehave shown that we anstart pro essingtaskj
on workerS
opt
(i
0
)
at the sametime as we did on workerS
opt
(j)
, and the samefor taski
0
, wekeepthe samemakespan. And asS
opt
is optimal,wekeeptheoptimalmakespan.Case 2: Iftheredoesnotexista
j
, i.e.,we annotndas hedule stepj > i
0
su hthat workeronworker
S
algo
(i
0
)
under thes heduleS
opt
. As ouralgorithm hoosesin steps
theworkerthat nishestasks + 1
therst,weknowthatworkerS
algo
(i
0
)
nishesatatimeearlierorequaltothat ofS
opt
. WorkerS
algo
(i
0
)
willbeidleinthes heduleS
opt
fortherestofthealgorithm,be ause oth-erwisewewouldhavefoundastepj
. Asweareinhomogeneous onditions,we ansimplydispla e taski
0
fromworkerS
opt
(i
0
)
to workerS
algo
(i
0
)
(seeFigure 15). As wehaveS
opt
(i
0
) 6= S
algo
(i
0
)
andwithLemma6weknowthatworkerS
algo
(i
0
)
nishespro essingitstasksuntilstepi
0
− 1
at atimeearlierthanorequaltoS
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 ingFigure15: S hedule
S
opt
before andafterdispla ingtaski
0
.On e wehavedonetheex hangeof task
i
0
, thes hedulesS
opt
andS
algo
are thesamefor all tasks[1..i
0
]
. Werestartthetransformation untilS
opt
= S
algo
foralltasks[1.. min(s
a
, s
o
)]
s hed-uledbyS
algo
.Nowwewillproveby ontradi tionthatthenumberoftaskss heduledby
S
algo
,s
a
,andS
opt
,s
o
,arethesame. Aftermin(s
a
, s
o
)
transformationstepsS
opt
= S
algo
foralltasks[1.. min(s
a
, s
o
)]
s heduledbyS
algo
. SoifafterthesestepsS
opt
= S
algo
foralln
tasks,bothalgorithmsredistributed thesamenumberoftasksand wehavenished.Wenow onsiderthe ase
s
a
6= s
o
. Inthe aseofs
a
> s
o
,S
algo
s hedulesmoretasksthanS
opt
. Atea hstepofouralgorithmwedonotin reasethemakespan. SoifwedomorestepsthanS
opt
, this meansthat wes heduledsometasks without hangingtheglobalmakespan. Hen eS
algo
is optimal.If
s
a
< s
o
, this means thatS
opt
s hedules moretasks thanS
algo
does. In this ase,afters
a
transformationsteps,S
opt
stills hedulestasks. Ifwetakealookatthes heduleofthe(s
a
+ 1)
-th task inS
opt
: regardless whi h re eiverS
opt
hooses, it will in rease the makespan as we prove now. In the following we will alls
algo
the workerour algorithm would have hosen to be the sender,r
algo
the workerour algorithm would have hosento be there eiver.s
opt
andr
opt
are thesenderandre eiver hosenbytheoptimals hedule. Indeed,in ouralgorithmwewouldhave hosens
algo
assendersu hthatitisaworkerwhi hnisheslast. Sothetimeworkers
algo
nishes pro essing isF
s
algo
= M (S
algo
)
.S
algo
hoosesthe re eiverr
algo
su h that itnishes pro essing there eivedtask theearliestofallpossiblere eiversandsu hthat italsonishespro essingthe re eivingtask at thesametime orearlierthan thesenderwoulddo. AsS
algo
did notde ideto sendthe(s
a
+1)
-thtask,thismeans,thatit ouldnotndare eiverwhi htted. Hen eweknow, regardlesswhi hre eiverS
opt
hooses,thatthemakespanwillstri tlyin rease(asS
algo
= S
opt
for all[1..s
a
]
). WetakealookatthemakespanofS
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 omeM (S
algo
) = F
r
algo
≥ F
s
algo
. AndF
r
algo
≤ F
r
opt
,be auseofthedenitionofre eiverr
algo
. AsM (s
opt
) ≥ F
r
M (S
algo
)
is smaller before the s hedule of the(s
a
+ 1)
-th task than afterwards. Hen e we get thatM (S
algo
) < M (S
opt
)
. Sothe only possibility whyS
opt
sends the(s
a
+ 1)
-th task andstill beoptimalis that,lateron,r
opt
sends ataskto someotherpro essorr
k
. (Notethat evenifwe hooseS
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 tor
k
insteadof sendingtor
opt
. With the sameargumentation, wedo thisby indu tion for alltasksk
,(s
a
+ 1) ≤ k ≤ s
o
, until s heduleS
opt
andS
algo
have the same numbers
o
= s
a
and soS
opt
= S
algo
and hen eM (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 maximumn
times, aswe annot redistributemore thanthen
tasksof thesystem. Ea hiterationisin theorderofO(m)
, whi h leadsus toatotal runtimeofO(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,amongn
tasks,hastobepro essed intimeonasinglema hine. Ea htaskk
,1 ≤ k ≤ n
,hasapro essingtimew
k
andadeadlined
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 taskj
in thea tualsolution withthe largestpro essing timew
j
isdeleted fromthesolution.Algorithm2[6,18℄solvesin
O(n log n)
the1||
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
ton
do 4:σ ← σ ∪ {i}
5:t ← t + w
i
6: ift > d
i
then7: Find job
j
inσ
with largestw
j
value8:
σ ← σ\{j}
9: