Intel® Cilk™ Plus

A strange behavior in array operations


When I played with array operations in Cilk Plus, I found the same assignment might return different results with gcc and g++.  For example, in array[0:5] = array[10:5], we expect that five elements 10 to 14 are copied to elements 0 to 4 in order.  There is no overlap in the example.  It works when it is compiled with g++.  However, it goes awry when it is compiled with gcc.  Actually, another five elements 10 to 6 are copied.

Is it an error or a bug?  Thanks.


why spawn helper cannot be inlined

I am reading the ABI doc and also made fib working using cilk_fake.h using runtime only. One question I have is the requirement for a helper function for spawn since a cilkplus spawn is to call a function, basically, why we cannot inline the helper function. Is this for dealing with stack/frame pointer management or stack memory management (e.g. we cannot surround a spawn with a for/while loop if each spawn needs its own dedicated stack space)? any insightful comments on this for helping my curiosity ;-)



pretty weird behaviour on using cilk_for and built-in function of arrays

I was trying to use built-in functions for arrays in cilkplus. Consider the following code as example:


int main()
int a[10] = {10,3,14,7,9,5,65,12,6,52};

int t;

t = __sec_reduce_max(a[0:3]);

cilk_for(int i=0;i<11;i++)

return 0;


On compiling the above program i got "internal compiler error: Segmentation fault"

Race conditions in cilk_for

Hi everyone,

I'm trying to run a code using cilkplus. The idea is to initiallize an array in parallel, using cilk_for, and then read it, in parallel again, to compute some results. However, I have race conditions between instruction on the two consecutive cilk_for. Above you can find an example code that reproduces that error:

Why does Cilk Plus __sec_reduce_add differ from a sequential addition?

I'm finding a significant error for certain input values when I use a particular offset to add values. Due to the nature of the algorithm I'm considering (not relevant to the question), I need to start a sum value with the first element of an array. I was able to extract a minimal working example, which is appended below.

Even though there are less than 50 floating point additions involved, I'm seeing error far beyond that order of magnitude of ulps, and I don't understand what I am doing wrong. See the following code snippet, along with the invocation and what my results are:

_Cilk_spawn is undefined

Hello, I have installed Visual Studio 2013 and Intel Parallel Studio and when i write a cilk plus program (fibonacci to be accurate) it compiles it just fine, but it doesn't recognize the commands cilk_spawn and cilk_sync (if i move the cusror to these commands it says "_Cilk_spawn is undefined","_Cilk_sync is undefined" ). Also when i run the fibonacci program the serial version executes in almost the same amount of time as the parallel version (weird ah?). 

I researched on the internet for this problem but no-one seems to give a solution. 

Any help would be appreciated

Subscribe to Intel® Cilk™ Plus