 loop.

[ll]{} T\_[p\_[Outer]{}]{} = \[equ:tpouter\]

In a similar fashion, when parallelising the inner loop using $inner\_threads$, the execution time of the loops is shown in Equation \[equ:tpinner\].

[ll]{} T\_[p\_[Inner]{}]{} = outer\_iters \* (T\_[outer\_work]{} + ) \[equ:tpinner\]

If we want to have a reduction in the overall execution time by parallelising the inner loop, the constraint $T_{p_{Inner}} < T_{p_{Outer}}$ must be satisfied. Solving this constraint in terms of $T_{outer\_work}$ we can get the maximum allowed threshold of the execution time for the work of the outer loop as shown in Equation \[equ:maxwork\]. It is worth mentioning that this model is an ideal performance model, where the work is evenly distributed to the threads. In reality, the time of $T_{outer\_work}$ might be affected by the presence of parallel overheads.

[ll]{} T\_[outer\_work]{} &lt;\
\[equ:maxwork\]

In order to test our hypothesis, we measured the amount of time which is required by the delay function for various values, with the results shown in Figure \[fig:syntheticbench\]. The graphs in Figure \[fig:syntheticbench\] show the performance of four different parallelisation strategies. $OpenMP\ Outer(1)$ and $OpenMP\ Inner(2)$ are the results from manual, static, parallelisations of the individual loops in the benchmark. $Heuristics$ are the results from our basic decision function using a value of one (i.e. only parallelise the loop if there are more iterations than threads available), and $Heuristic\ \-\ Profiler$ are the results from our system using the profiling functionality where appropriate.

\

From the results it is evident that when the loops are perfectly nested, and regular (i.e. the loop bounds are not changing), then there is no benefit from using the profiling functionality. The basic heuristics will choose the optimal loop to parallelise apart from when we are using 6 threads. The variation in outcomes for 6 threads is is a consequence of the number of loop iterations chosen for the benchmark (8 iterations of the outer loop and 16 iterations of the inner loop). The distribution of 8 iterations to 6 threads results in all of the
loop. 

 [ ll ] { } T\_[p\_[Outer ] { } ] { } = \[equ: tpouter\ ] 

 In a similar fashion, when parallelising the inner loop topology use $ inner\_threads$, the execution time of the loops is prove in Equation \[equ: tpinner\ ]. 

 [ ll ] { } T\_[p\_[Inner ] { } ] { } = outer\_iters \ * (T\_[outer\_work ] { } +) \[equ: tpinner\ ] 

 If we want to have a decrease in the overall execution time by parallelising the inner cringle, the constraint $ T_{p_{Inner } } < T_{p_{Outer}}$ must be satisfied. clear this constraint in terms of $ T_{outer\_work}$ we can beget the maximum allowed threshold of the execution time for the work of the out loop as shown in Equation \[equ: maxwork\ ]. It is worth mention that this model is an ideal performance model, where the employment is evenly distributed to the threads. In reality, the time of $ T_{outer\_work}$ might be affected by the bearing of parallel overheads. 

 [ ll ] { } T\_[outer\_work ] { } & lt;\ 
 \[equ: maxwork\ ] 

 In order to test our hypothesis, we measured the amount of meter which is required by the delay function for various values, with the results shown in Figure \[fig: syntheticbench\ ]. The graphs in Figure \[fig: syntheticbench\ ] show the performance of four different parallelisation scheme. $ OpenMP\ Outer(1)$ and $ OpenMP\ Inner(2)$ are the results from manual, static, parallelisations of the individual loop in the benchmark. $ Heuristics$ are the result from our basic decision function using a value of one (i.e. merely parallelise the loop if there are more iterations than threads available), and $ Heuristic\ \-\ Profiler$ are the result from our system using the profiling functionality where appropriate. 

 \ 

 From the results it is evident that when the loops are perfectly nest, and regular (i.e. the loop bounds are not changing), then there be no benefit from practice the profiling functionality. The basic heuristics will choose the optimal loop to parallelise apart from when we are using 6 screw thread. The variation in outcomes for 6 threads is is a consequence of the number of loop iterations chosen for the benchmark (8 iterations of the out loop and 16 iterations of the inner loop). The distribution of 8 iterations to 6 togs results in all of the
 lolp.

[ll]{} T\_[p\_[Outer]{}]{} = \[equ:tpouter\]

Ln a similar faskuon, whxn paramlelisine the inner loop using $inner\_vhreqds$, tye execution time of tfe loops ps shown un Ewyation \[equ:vlinner\].

[ll]{} T\_[p\_[Inhcr]{}]{} = obtxr\_iters \* (T\_[outer\_eork]{} + ) \[equ:dpinner\]

If we wdng co have a reduction in the overall evecutiom hime by parallglisimd ths inner loop, the constraint $T_{p_{Inned}} < T_{p_{Ouuer}}$ must be satisfoed. Solving this constrainh in terms of $T_{outer\_wogk}$ we can ggf trw maximum aluowed threshold of the execution time for the work of the puter loop aw sjmwn in Equavion \[ezu:maxwork\]. It is wortv mentipning that thix mmdeo is an ideal performence model, where the work is avznly distributed to tye thredds. Hn rdqligy, uhe tjme of $T_{onter\_work}$ mifht be affexted by the presenct os parallel ovedheads.

[jl]{} T\_[outer\_work]{} &lt;\
\[equ:maxwork\]

In order to tesu our hypothesis, we measured the amount of time wjich is rqquired by the delay function for various values, fith vhd rtsmjgw dhown in Figure \[fig:syntheticbench\]. The graphs yh Ginure \[fig:synthetigbench\] show the petflrkwnce of four aifferzht parallelisation shrategigs. $OpebMP\ Outer(1)$ and $OpenMP\ Inner(2)$ are the resulrs from manucl, wtatic, parallelisacions of the indovidusl loops in the benchmaxk. $Heudistics$ are the resumgs from our basiz dvcishon funcukon using a value of one (i.x. onlv paralldlisg the ljop if thege arc more iterations tjan tkreadv availablf), and $Heuristic\ \-\ Profiler$ are tix results frok mur system bsing bhe profiling ftnctionality wkere appxopriage.

\

From the resultv it is eviqent that whet the loops ace perfecely bestwd, and fdgular (i.e. the koop bounbf arw not changing), thek thete is no benefit yxon using the progilkng flncvionajhty. The basiw hejriryics dill choose ghe pptimal loop to paranleljse apart from whem re are uwing 6 thweads. The varoation in outcomes for 6 thceads os ys a consequence of the number of loop ltevations choseg fov thg benchmark (8 iterations of the outer loop and 16 itecations of the inner loip). The distribution pf 8 iteratipns tj 6 threadv results in all of rhe
loop. [ll]{} T\_[p\_[Outer]{}]{} = \[equ:tpouter\] In a when the inner using $inner\_threads$, the is in Equation \[equ:tpinner\]. T\_[p\_[Inner]{}]{} = outer\_iters (T\_[outer\_work]{} + ) \[equ:tpinner\] If we to have a reduction in the overall execution time by parallelising the inner the constraint $T_{p_{Inner}} < T_{p_{Outer}}$ must be satisfied. Solving this constraint in terms $T_{outer\_work}$ can the allowed threshold of the execution time for the work of the outer loop as shown in \[equ:maxwork\]. It is worth mentioning that this model an ideal performance model, the work is evenly distributed the In reality, time $T_{outer\_work}$ be affected by presence of parallel overheads. [ll]{} T\_[outer\_work]{} &lt;\ \[equ:maxwork\] In order to test our hypothesis, we measured the of time required by delay for values, with the in Figure \[fig:syntheticbench\]. The graphs in the performance of four different parallelisation strategies. $OpenMP\ and $OpenMP\ are the results from manual, static, of the individual loops in the benchmark. $Heuristics$ the results from our basic decision function using a value of one (i.e. only parallelise if there are more than threads available), $Heuristic\ Profiler$ the from our using the profiling functionality where appropriate. \ From the results it evident that when the loops are perfectly nested, and regular loop are not changing), there is no benefit using profiling functionality. The basic choose optimal apart when are using 6 threads. variation in outcomes for 6 is is a consequence iterations chosen for the benchmark (8 iterations of outer loop and 16 iterations of the loop). The distribution of 8 iterations to 6 threads results in all the
 loop.

[ll]{} T\_[p\_[Outer]{}]{} = \[equ:tpouter\]

In A similar faShion, WheN paRaLlelIsinG the inner loop uSIng $iNner\_threads$, the executioN time Of THe loOPs Is shoWn in EquATiON \[Equ:TpInNer\].

[Ll]{} t\_[P\_[INner]{}]{} = oUteR\_iters \* (T\_[Outer\_work]{} + ) \[eQu:tPiNner\]

If we want TO hAve a reductIon In the overall ExeCution TiMe bY ParalLelIsing The innER loop, tHe constraInT $t_{p_{InneR}} < t_{p_{Outer}}$ MUSt Be saTisfied. Solving thiS CoNStraint in terms Of $T_{outEr\_WOrK}$ WE caN geT the maximuM aLloweD ThreshoLD oF THE exECution time for The work of thE OutEr loop As ShoWN in EquAtion \[EqU:MaxWork\]. It is worTh meNtioning tHat thiS Model is AN ideal pErformAncE moDel, wHErE tHe wOrK Is eVEnLy dIStrIbuted to ThE tHreadS. In rEALITy, thE tiMe of $t_{outeR\_work}$ might be aFfeCted BY thE presEnce oF parAlLel ovErheadS.

[ll]{} T\_[oUtEr\_work]{} &lt;\
\[equ:maxwOrk\]

IN order to tEst OuR hyPoThesiS, We measUreD thE amount Of time wHIch Is REQUiRed by the delay functIoN FOr Various vAlues, wITh ThE Results sHoWn iN FigURE \[fig:sYnthETiCbench\]. ThE graphS In fiGure \[fig:SyNthetiCbEncH\] shOw the PErfoRmance Of four diFfereNT parallelisatiON strategies. $OpENMp\ oUtER(1)$ and $opeNMP\ Inner(2)$ are The rESultS froM MaNuaL, StatiC, paraLlELiSAtions of the individuAl Loops iN the bEnchmark. $HeuriStics$ are thE RESults froM our BAsIC decision functIon usIng a value oF One (i.e. onlY paraLlelise tHe loop if tHERe are morE itEraTioNs tHAN tHreads availabLE), And $HEuRistic\ \-\ PRofIler$ are The ResUltS frOm Our system Using the PrOfIlInG fuNctioNAlity wheRe AppRoPriAte.

\

FrOM the reSults It is EvIdENt tHat when THe LOOps aRe PeRfecTly NeSted, aNd reGUlaR (i.e. the lOop bounds Are NOt chAnGiNg), then tHere is no benefIt From using tHe ProFiling FUNctionalIty. The basic heuristics wiLL choose The OptimAl loOp to paralLelIse apaRt fROm when We are uSing 6 tHrEadS. tHe varIATiOn iN oUtcomes for 6 THReaDs is iS a ConsEquence Of the number of loop iTEraTions chosen foR thE benCHMaRk (8 iTErATioNs OF thE OUter loop and 16 iterAtions of thE iNNeR loop). The diSTriBuTion of 8 iTeratioNs to 6 tHReads reSults in alL of the
 loop.

[ll]{} T\_[p\_[Out er]{}]{} =  \[eq u:t pou te r\]
Ina similar fash i on,when parallelising the  inne rl oopu si ng $i nner\_t h re a d s$,  t he  ex ec u ti on ti meof theloops is s how nin Equation\ [e qu:tpinner \]. 

[ll]{} T\_ [p\ _[Inne r] {}] { } = o ute r\_it ers \* (T\_[o uter\_wor k] { } + )\ [equ:tp i n ne r\]
If we want to ha v ea  reduction inthe ov er a ll e xec uti on time by  p arall e lisingt he i n ner loop, the con straint $T_ { p_{ Inner} }< T _ {p_{Ou ter}} $m ust  be satisfi ed.Solving t his co n straint in term s of $ T_{ out er\_ w or k} $ w ec ang et  th e  ma ximum al lo we d thr esho l d o f th e e xecu tiontime for thewor k of the  oute r loo p as  s hownin Equ ation  \ [equ:maxwork\].  Itis worthmen ti oni ng  that this m ode l i s an id eal per f orm an c e mo del, where the wor ki s  e venly di stribu t ed  t o  the thr ea ds.  Inr e ality , th e  t ime of $ T_{out e r\ _w ork}$ m ig ht beaf fec ted  by t h e pr esence  of para llelo verheads.

[ll ] {} T\_[outer\ _ wo r k ]{ }  &lt ;\\[equ:maxwo rk\] 
Inorde r  t o t e st ou r hyp ot h es i s, we measured theam ount o f tim e which is re quired byt h e  delay f unct i on for various va lues,  with ther esults s hownin Figur e \[fig:s y n theticbe nch \].  Th e g r a ph s in Figure \ [ f ig:s yn theticb enc h\] sho w t heper for ma nce of fo ur diffe re nt  p ar all elisa t ion stra te gie s.  $O penMP \  Outer (1)$and$O pe n MP\  Inner( 2 )$ a re t he  r esul tsfr om ma nual ,  st atic, p arallelis ati o ns o fth e indiv idual loops i nthe benchm ar k.$Heuri s t ics$ are  the results from our b a sic dec isi on fu ncti on usinga v alue o f o n e (i.e . only  para ll eli s e  thel o op  if  t here are m o r e i terat io ns t han thr eads available), a n d $ Heuristic\ \- \ P rofi l e r$  ar e  t h e r es u lts f rom our systemusing thepr o fi ling funct i ona li ty wher e appro priat e .

\

F rom the r esults it  i s ev i d ent  that when  the loo ps are pe r fectl y  n ested , a nd reg ul ar(i.e.  the l o opbound s areno t chan ging) ,then the re is no benefit from u sing t he pr ofi ling func tio n ali ty. The b asic  heuristic s w ill  choo set he op tima l  l oop to pa rall e lise apar t  f rom w he n we are us i n g  6threa ds. The va riat ion in outcomes f o r 6 threads is  isa con seq u ence  o f the number o f l oo p iteratio ns  chosen for  the ben ch m ark ( 8 iter ations  of the o ut e r loop  and  16  iteratio nsof the inn er  l o op). T he d is tribut ion of 8 it e r ations to 6 thre ads r e s ultsi n a ll of  t he
 loop.

[ll]{}_T\_[p\_[Outer]{}]{} =_\[equ:tpouter\]

In a similar fashion,_when parallelising_the_inner loop_using_$inner\_threads$, the execution_time of the_loops is shown in_Equation \[equ:tpinner\].

[ll]{} T\_[p\_[Inner]{}]{}_=_outer\_iters \* (T\_[outer\_work]{} + ) \[equ:tpinner\]

If we want to have a reduction in the_overall_execution time_by_parallelising_the inner loop, the constraint_$T_{p_{Inner}} < T_{p_{Outer}}$ must be_satisfied. Solving_this constraint in terms of $T_{outer\_work}$ we can_get_the maximum allowed_threshold of the execution time for the work of_the outer loop as shown in_Equation \[equ:maxwork\]. It_is_worth_mentioning that this model_is an ideal performance model, where_the work is evenly distributed to_the threads. In reality, the time of_$T_{outer\_work}$ might be affected by the_presence of parallel overheads.

[ll]{} T\_[outer\_work]{}_&lt;\
\[equ:maxwork\]

In order_to test our hypothesis, we_measured the amount_of time_which is required_by the delay function for various_values, with the_results shown in Figure \[fig:syntheticbench\]. The_graphs_in Figure \[fig:syntheticbench\]_show_the_performance of_four different parallelisation_strategies._$OpenMP\ Outer(1)$_and_$OpenMP\ Inner(2)$ are the results from_manual,_static, parallelisations of the individual loops in_the benchmark. $Heuristics$ are_the_results from our basic_decision function using a value_of one (i.e. only parallelise the_loop if_there are_more iterations than threads available), and $Heuristic\ \-\ Profiler$ are the_results from our system using the_profiling functionality where appropriate.

\

From_the results_it_is evident that_when_the loops_are perfectly nested, and regular (i.e. the_loop bounds_are not changing), then there is_no benefit from using_the_profiling functionality. The basic heuristics will_choose the optimal loop to parallelise_apart from when we are_using_6_threads. The variation in outcomes_for 6 threads is is a_consequence of the_number of loop iterations chosen for the_benchmark_(8 iterations of the outer loop_and_16 iterations of the inner loop)._The_distribution_of 8 iterations to 6_threads results in all of the