-
Notifications
You must be signed in to change notification settings - Fork 2
/
hellopar.chpl
37 lines (26 loc) · 1.09 KB
/
hellopar.chpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// hellopar.chpl
/*
This is a shorter version of hello6-taskpar-dist.chpl. It has fewer comments and uses fewer
string operations.
usage on puma/ocelote:
chpl hellopar.chpl
./hellopar -nl 2
# something else to try
./hellopar -nl 4 --tasksPerLocale=3
usage on laptop with docker:
docker pull docker.io/chapel/chapel-gasnet // only do this once, but it takes a few minutes
docker run --rm -v "$PWD":/myapp -w /myapp chapel/chapel-gasnet chpl hellopar.chpl
docker run --rm -v "$PWD":/myapp -w /myapp chapel/chapel-gasnet ./hellopar -nl 4
# something else to try
docker run --rm -v "$PWD":/myapp -w /myapp chapel/chapel-gasnet ./hellopar -nl 4 --tasksPerLocale=3
*/
// The number of tasks to use per locale. Specify on command line with --tasksPerLocal=n,
// where n is some number.
config const tasksPerLocale = 1;
// Creates a task per locale
coforall loc in Locales on loc {
coforall tid in 0..#tasksPerLocale {
writeln("Hello world! (from task ", tid, " of ", tasksPerLocale,
" on locale ", here.id, " of ", numLocales, ")");
}
}