-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcilk-faq.bfnn
275 lines (210 loc) · 9.46 KB
/
cilk-faq.bfnn
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
\comment -*- Text -*-
\comment This is the source for the Cilk FAQ list, in
\comment the Bizarre Format With No Name. It is turned into Lout
\comment input, HTML, plain ASCII and an Info document by a Perl script.
\comment
\comment The format and scripts come from the Linux FAQ, by
\comment Ian Jackson.
\set brieftitle Cilk FAQ
\set author Bradley C. Kuszmaul / <A href="mailto:[email protected]">[email protected]</A>
\set authormail [email protected]
\set title Cilk Frequently Asked Questions with Answers
\set copyholder Bradley C. Kuszmaul
\call-html startup html.refs
\copyto ASCII
CILK FREQUENTLY ASKED QUESTIONS WITH ANSWERS
`date '+%d %h %Y'`
Matteo Frigo
Bradley C. Kuszmaul
\endcopy
\copyto INFO
START-INFO-DIR-ENTRY
* Cilk FAQ: (cilk-faq). Cilk Frequently Asked Questions with Answers.
END-INFO-DIR-ENTRY
File: $prefix.info, Node: Top, Next: Question 1.1, Up: (dir)
CILK FREQUENTLY ASKED QUESTIONS WITH ANSWERS
`date '+%d %h %Y'`
Matteo Frigo
Bradley C. Kuszmaul
\endcopy
This is the list of Frequently Asked Questions about Cilk, a
language for multithreaded parallel programming based on ANSI C.
\section Index
\index
\comment ######################################################################
\section Introduction and General Information
\question 06may:whatiscilk What is Cilk?
Cilk is a language for multithreaded parallel programming based on
ANSI C. Cilk is designed for general-purpose parallel programming,
but it is especially effective for exploiting dynamic, highly
asynchronous parallelism, which can be difficult to write in
data-parallel or message-passing style. Cilk has been developed since
1994 by the Supercomputing Technologies Group at the MIT Laboratory
for Computer Science. Cilk has been used for research, teaching, and
for coding applications such as a virus shell assembly simulator and
three chess programs.
\question 06may:whereiscilk How do I obtain Cilk?
Official versions of Cilk can be found at \docref{the Cilk web page\}
We briefly used SourceForge, but they don't know how to stop SPAM, and eventually gave up.
\question 06may:whereiscilk Are there Cilk-related mailing lists?
Yes. Look for Cilk at \docref{SourceForge (www.sourceforge.net)\}.
Three mailing lists exist:
\call startlist
\call item
\email{[email protected]\} is an open discussion list
for Cilk users.
However, the Cilk users mailing list is not monitored by the current
Cilk developers because of spam. The list is probably useless now.
\call item
\email{[email protected]\} is a read-only,
low-traffic mailing list where we announce new releases of
Cilk.
\call item
Use the \email{[email protected]\} mail alias
to send mail to a restricted set of Cilk developers.
\call endlist
\question 06aug:iscilkfree Is Cilk free software?
Starting with version 5.3, Cilk is Free Software in the technical
sense defined by the Free Software Foundation (see \docref{Categories
of Free and Non-Free Software\}), and is distributed under the terms
of the GNU General Public License. Previous versions of Cilk were
distributed without fee for noncommercial use, but were not
technically ``free.''
\question 06may:systems Which systems does Cilk run on?
The current Cilk-5.3 system runs on systems that support
POSIX threads. In particular, Cilk has been installed
successfully on GNU/Linux, Solaris, IRIX, Digital Unix, and MacOS X.
Cilk requires certain system software in order to run. In particular,
it requires a recent gcc, GNU make, and preferably the GNU linker.
GNU/Linux systems are usually distributed with all these tools. Cilk
should also work on other systems (*BSD etc.) whenever the appropriate
tools are installed. If you successfully compile Cilk on these
systems, please contact me \email{[email protected]\} so that I can
update this FAQ.
Cilk-5.3 supports IA-32 (x86), IA-64 (Itanium), AMD64 (x86-64)
PowerPC, SPARC, MIPS, and Alpha processors. Porting to other
processors is not difficult. Please contact
\email{[email protected]\} if you are interested in
running Cilk on other machines.
\question 06may:runOnNOW Does Cilk run on networks of workstations?
Cilk-5.3 does not run on distributed-memory machines. Keith Randall
wrote a distributed-memory variant of Cilk-5.1 as part of his
Ph. D. thesis. See \docref{the Cilk web page\} for a copy of the
thesis and for downloading the distributed-memory Cilk version. Be
warned that this version is experimental and it has not been updated
in a long time.
\question 06may:runOnDOS Does Cilk run on Windows NT?
Please do not send questions about Windows NT to the cilk-support
mailing list, because the Cilk maintainer does not know anything about
this system.
\question 06may:cilkchess What is Cilkchess?
Cilkchess is a chess program written in Cilk. Cilkchess and Cilk are
two distinct things. Cilkchess has never been released, and it is not
part of the Cilk distribution. For more information about Cilkchess,
contact its author Don Dailey \email{[email protected]\}.
\comment ######################################################################
\section Installing Cilk
\question 06may:install How do I install Cilk?
Cilk uses the standard GNU installation tools. To install Cilk, type
\verbatim
$ ./configure
$ make
$ make check # run test programs
# make install
\endverbatim
\question 06may:install How do I install Cilk in a directory different from \courier{/usr/local\}?
Type
\verbatim
$ ./configure --prefix=<installation directory>
$ make
# make install
\endverbatim
The following commands *do not* work:
\verbatim
$ ./configure
$ make
# make install prefix=<installation directory> # DOES NOT WORK
\endverbatim
\question 06may:cilkCrashes The example programs compile, but they do not run.
If the example programs do not run, and they complain about
\courier{libcilk.so\} not being found, then Cilk does not know how to
hardcode the path to the Cilk shared library into Cilk programs. Try
one of the following suggestions:
\call startlist
\call item
Try to set the environment variable \courier{LD_LIBRARY_PATH\}
to \courier{<cilk-dir>/runtime/.libs\}, where
\courier{<cilk-dir>\} is the top-level Cilk-5.3 directory.
\call item
Try installing Cilk in a standard directory, such as
\courier{/usr\} or \courier{/usr/local\}.
\call item
Install the GNU linker. Cilk knows how to set the correct shared-libraries
path if the GNU linker is used.
\call item
Disable shared libraries completely, using the command
\verbatim
$ ./configure --disable-shared
\endverbatim
\call endlist
\question 19may:clockskew `make' says: ``Warning: Clock skew detected. Your build may be incomplete''.
This warning occurs on a NFS client whose time is not synchronized
with the NFS server. The build should be correct nevertheless, but
it is a good idea to adjust the system clock anyway.
\comment ######################################################################
\section Using Cilk
\question 06may:compile How do I compile a Cilk program?
Use the \courier{cilkc\} command in the same way you would use
\courier{gcc\}. For example, \courier{cilkc -O2 program.cilk -o
program -lm\}.
\courier{cilkc\} should accept all \courier{gcc\} options,
and in addition it accepts the following three options.
\call startlist
\call item
\courier{-cilk-debug\}: Enable consistency checks in the Cilk runtime
system.
\call item
\courier{-cilk-profile\}: Enable collection of profile information
within the Cilk runtime system. You can print this information by
invoking a Cilk program with the \courier{--stats} flag.
\call item
\courier{-cilk-critical-path\}: Enable fine-grain collection of
the program critical path. See the Cilk manual for a definition
of the critical path and an explanation of why you may want
to know it.
\call endlist
All files that comprise an executable must be compiled and linked with
the same set of \courier{-cilk-*\} flags. If not, the linker prints
an error message and fails.
Additional \courier{cilkc\} arguments are documented in the
programming manual.
\question 06may:slow Cilk seems really slow.
Normally, a \courier{spawn\} is 2--6 times slower than a function
call, but Cilk becomes much slower when the critical-path measurements
are enabled. This problem occurs because Cilk reads the system clock
at every thread boundary (i.e. at every \courier{spawn\},
\courier{sync\}, \courier{return\}). Some systems, such as Solaris,
have fast user-level clock routines, but other systems, such as Linux,
require a system call. If Cilk programs are still unacceptably slow
(when compared to the C version), please contact
\email{[email protected]\}.
\question 06may:otherlanguages Can I call Cilk from C/C++/FORTRAN?
Not with Cilk-5.3. We have an experimental ``library version'' of
Cilk-5.2 which can be called by C, but it was not incorporated into
Cilk-5.3.
\question 28may:wrongflags The linker says \courier{Cilk_flags_are_wrong_*_please_recompile\}.
All Cilk files that comprise your program must be compiled and linked
with the same Cilk flags. (See \qref compile for a description of the
Cilk flags.) If the flags differ, the linker issues and error message
like the following:
\verbatim
undefined reference to `Cilk_flags_are_wrong_NODEBUG_NOTIMING_NOSTATS_please_recompile'
\endverbatim
\comment ######################################################################
\comment \section Known bugs
\comment Here it ends!