1
edit
Changes
→How to parallelize your code using Chapel Cray
Iterations in a loop will be executed in parallel.
* '''forall''': At the beginning of the first iteration all the threads will be created.
* Sample Parallel Code using '''forall'''
[[Image:Chpl_output.PNG|Output Example]]
* '''coforall''': A thread will be created at each iteration. It's recommended to use coforall when the inside of loop is big and the iteration size is equal to the total number of logical cores.
* Sample Parallel Code using '''forallcoforall'''
<pre>
writeln("Thread #", i,"of ", n);
</pre>
* Sample Parallel Code Output using '''coforall'''
== Demonstration of Sample Code ==
== Useful Links ==