Open main menu

CDOT Wiki β

Changes

Midnight Tiger

383 bytes added, 10:26, 5 April 2016
Task vs Thread
= Chapel Cray =
== Team Information ==
== Introduction to Chapel ==
Chapel(Cascade High-Productivity Language) is an alternative parallel programming language that focuses on the '''productivity ''' of high-end computing systems.
The concept of "Productivity" is somewhat more special that we might think.
'''Chapel:''' Chapel is the language that is easy to implement the parallel computation that and similar to other languages with granting full control to the users.
== Advantages of Chapel Cray ==
From [http://www.cray.com/blog/chapel-productive-parallel-programming/ one of Cray articles]
<pre>>cd $CHPL_HOME/examples</pre>
== How to parallelize your code using Chapel Cray ===== Task vs Thread ===* '''Task''': A unit of computation * '''Thread''': A hardware resource where a task can be mapped to.
Iterations in a loop will be executed in parallel.
=== forall === * '''forall''': At the beginning of When the first iteration all starts the threads tasks will be createdon each available thread. It's recommended to use when the iteration size is bigger than the number of threads. It might not run in parallel, when there is not enough thread available.
* Sample Parallel Code using '''forall'''
[[Image:Chpl_output.PNG|Output Example]]
=== coforall === * '''coforall''': A thread task will be created at each iteration. It's recommended to use coforall when the inside of loop computation is big and the iteration size is equal to the total number of logical cores(thread). Parllel is mandatory here.
* Sample Parallel Code using '''coforall'''
[[Image:coforall.PNG|Output Example]]
=== begin === * '''begin''': Each begin statement will create a different threadtask.
* Sample Parallel Code using '''begin'''
[[Image:begin.PNG|Output Example]]
 
=== cobegin ===
* '''cobegin''': the each statement in cobegin block will be parallelized.