general questions

general questions

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.


5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The icc command line option -cilk-serializemay do what you want.I agree that the extra underscore and the capitialization as in_Cilk_syncare an annoyance.

The keywords in Cilk Plusare _Cilk_spawn, _Cilk_sync, and _Cilk_for.

If you have included the followingfile:


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.



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

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today