Software Archive
Read-only legacy content
17061 Discussions

general questions

newport_j
Beginner
257 Views
Is there a way to get the serial elision of the Cilk c program? This was a nice option in Cilk Arts.

When and why do you underscore precedingcilk_spawn and cilk_for in Intel Cilk ? It seems that it is rare but at times the statements listed above must be precded by an underscore.


Any help appreciated.

Newport_j
0 Kudos
4 Replies
BradleyKuszmaul
Beginner
257 Views
The icc command line option
-cilk-serialize
may do what you want.
I agree that the extra underscore and the capitialization as in
_Cilk_sync
are an annoyance.
0 Kudos
Jim_S_Intel
Employee
257 Views
The keywords in Cilk Plusare _Cilk_spawn, _Cilk_sync, and _Cilk_for.

If you have included the followingfile:

#include

then you can write "cilk_spawn" instead of "_Cilk_spawn" (and similarly "cilk_sync" and "cilk_for").

This includefile contains preprocessor macros to make this work. If "cilk_spawn" (without the underscore)_ works in your code, then this file has probably already been included.
Cheers,

Jim




0 Kudos
Georg_Z_Intel
Employee
257 Views
Hello,

in addition:

Setting $CILK_NWORKERS (environment variable) to "1" makes Intel Cilk Plus applications execute in a serialized way.
Alternatively you can set this variable to any (meaningful) amount of max. workers running in parallel.

Since this environment variable is evaluated during run-time you never need to recompile your application. By simply setting it before running the same binary it'll use the amount of workers specified.

Best regards,

Georg Zitzlsberger
0 Kudos
Barry_T_Intel
Employee
257 Views

The Intel Cilk Plus keywordnames follow C++ standards. Since Intel Cilk Plus is not part of the standard language, the keywords must have a leading "_" to prevent them from polluting the user namespace.

As others have pointed out, including cilk/cilk.h will define macros for the keywords to make them easier to type.

- Barry

0 Kudos
Reply