Consider the example program in Figure 1(a) that computes array A. The corresponding recursive version (Figure 1(a)) divides the work into four quadrants and computes
them recursively. The spawn and sync keywords in the recursive program represent the concurrency and synchronization annotations in a Cilk program. The dependences (a.k.a.
the spawn and sync annotations) in the recursive program
are induced by dependences in the loop program. The quadrant A00 begins execution of a given task. A01 and A10
depend on A00 and are separated from the processing of
A00 by a sync. A01 and A10 can themselves be processed
concurrently and are invoked with a spawn keyword without
any intervening synchronization. A11 depends on both A01
and A10 and is ordered appropriately.
Recursive programs exhibit many desirable properties. The
recursive structure often mirrors the dependence structure
in the element-level program specification, simplifying programming. Besides the ease of programming, such a structure accesses recursively smaller portions of the array. As
a result, recursive structure is often employed in designing
cache-oblivious algorithms [3].
While recursive programs alleviate the burden on the programmer, their structures can prevent them from achieving
good speedups on large multi-core systems. On occasion, recursive programming can incur the cost of increased critical
path length. For example, the optimal critical path length
for the example in Figure 1(a) is Θ(n), whereas the critical
path length of the recursive version is Θ(nlog2 3) for a nxn
matrix. The cause for this suboptimal critical path length is
the inherently coarser dependencies required by the recursive expression. In Figure 1(a), not all of the quadrant A01
(or A10) must wait for all of quadrant A00 to be computed.
In Figures 1(b) and 2(a), the dependence-induced dags and
corresponding critical paths are illustrated for a problem
size of 4 (ihi-ilo=jhi-jlo=4). For example, given a problem
size of 4, the dependence-induced dag for the loop version
in Figure 1(a) has a critical path length of 7, compared to 9
for the recursive Cilk version.
In general, mapping a computation dag onto a Cilk-like
recursive parallel model can increase the critical path length
and result in reduced scalability due to decreased available parallelism. Decreased available parallelism caused by
coarser dependencies, together with large core counts, can
lead to poor scalability. We aim to preserve the simplicity
of recursive programming by recovering the lost concurrency
in such overly constrained recursive programs.
พิจารณาตัวอย่างโปรแกรมในรูป 1(a) ที่คำนวณอ.เรย์ รุ่นซ้ำที่สอดคล้องกัน (รูป 1(a)) แบ่งงานออกเป็นสี่ส่วน และคำนวณพวกเขา recursively คำสำคัญที่วางไข่และซิงค์ในโปรแกรมซ้ำแสดงคำอธิบายการเกิดพร้อมกันและซิงโครไนส์ในโปรแกรมซิลก์ ซีสตาร์ ที่ dependences (หรือวางไข่และซิงค์ข้อมูลกำกับ) ในโปรแกรมซ้ำเป็นการเหนี่ยวนำ โดย dependences ในโปรแกรมวนรอบ Quadrant A00 เริ่มดำเนินการของงานกำหนดให้ A01 และ A10พึ่ง A00 และจะแยกออกจากการประมวลผลA00 โดยการซิงค์ A01 และ A10 สามารถตัวประมวลผลพร้อม และถูกเรียก ด้วยคำสำคัญวางไข่โดยไม่ซิงโครไนส์ใด ๆ แทรกแซง A11 ตามทั้ง A01และ A10 และสั่งอย่างเหมาะสมซ้ำโปรแกรมมีคุณสมบัติมากมาย การโครงสร้างซ้ำมักจะแสดงโครงสร้างพึ่งพาในองค์ประกอบระดับโปรแกรมข้อมูลจำเพาะ โปรแกรมลดความซับซ้อน นอกจากความง่ายในการเขียนโปรแกรม โครงสร้างเข้าถึง recursively ส่วนเล็กของอาร์เรย์ เป็นผล โครงสร้างซ้ำมักใช้ในการออกแบบแคลบเลือนอัลกอริธึม [3]ในขณะที่โปรแกรมซ้ำบรรเทาภาระที่โปรแกรมเมอร์ โครงสร้างของพวกเขาสามารถป้องกันไม่ให้บรรลุspeedups ดีในระบบขนาดใหญ่แบบมัลติคอร์ บางครั้ง การเขียนโปรแกรมแบบเรียกใช้ซ้ำสามารถต้องเสียต้นทุนเพิ่มขึ้นที่สำคัญความยาวเส้นทาง ตัวอย่างเช่น ความยาวสูงสุดเส้นทางที่สำคัญfor the example in Figure 1(a) is Θ(n), whereas the criticalpath length of the recursive version is Θ(nlog2 3) for a nxnmatrix. The cause for this suboptimal critical path length isthe inherently coarser dependencies required by the recursive expression. In Figure 1(a), not all of the quadrant A01(or A10) must wait for all of quadrant A00 to be computed.In Figures 1(b) and 2(a), the dependence-induced dags andcorresponding critical paths are illustrated for a problemsize of 4 (ihi-ilo=jhi-jlo=4). For example, given a problemsize of 4, the dependence-induced dag for the loop versionin Figure 1(a) has a critical path length of 7, compared to 9for the recursive Cilk version.In general, mapping a computation dag onto a Cilk-likerecursive parallel model can increase the critical path lengthand result in reduced scalability due to decreased available parallelism. Decreased available parallelism caused bycoarser dependencies, together with large core counts, canlead to poor scalability. We aim to preserve the simplicityof recursive programming by recovering the lost concurrencyin such overly constrained recursive programs.
การแปล กรุณารอสักครู่..
