Open main menu

CDOT Wiki β

Changes

GPU621/The Chapel Programming Language

No change in size, 16:16, 1 December 2020
Parallel Iterators
'''Standalone parallel iterators:''' implement non-zippered forall loops.
 
===== Leader-follower iterator =====
 
forall (a, b, c) in zip(A, B, C) do
//in here, A is the leader; and A, B, C is followers
 
'''leader iterator''' will create the parallel tasks for its forall loop and set iterations to each parallel task.
 
'''follower iterator''' will take input and iterate over it; create opposite results in order.
An example code:
for (i,idVar) in zip(0..n, fibonacci(n)) do
writeln("#", i, " - ", idVar);
 
===== Leader-follower iterator =====
 
forall (a, b, c) in zip(A, B, C) do
//in here, A is the leader; and A, B, C is followers
 
'''leader iterator''' will create the parallel tasks for its forall loop and set iterations to each parallel task.
 
'''follower iterator''' will take input and iterate over it; create opposite results in order.
=== Task Parallelism ===
25
edits