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.

Newport_j

5 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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:

#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

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

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

发表评论

登录添加评论。还不是成员?立即加入