Changes

Jump to: navigation, search

GPU621/The Chapel Programming Language

9 bytes added, 12:12, 3 December 2020
Data Parallelism
const n = 1000000;
 
var iterations: [1..n] real;
Each task will be responsible for a single iteration. Significant performance hit caused by creating, scheduling, and destroying each individual task which will outweigh the benefits of each task handling little computation.
coforall it in iterations do{
it += 1.0;
}
Automatically creates an appropriate number of tasks specific to each system and assigns an equal amount of loop iterations to each task. The number of tasks created is generally based on the number of cores that the system’s processor has. For example: a quad-core processor running this program with 1,000,000 iterations would cause 4 tasks to be created and assign 250,000 iterations to each individual task.
forall it in iterations do{
it += 1.0;
}
[[File:Chapel_loops.png]]
19
edits

Navigation menu