Intel® Cilk™ Plus

gcc compiler bug - cilk_for loops in templatized code incorrectly scope index variable.

I think I've encountered a compiler bug that causes the index variable in cilk_for loops to be declared in their parent's scope. I've observed it for gcc 4.8 and 4.9. I've only been able to reproduce the bug when the cilk_for loops appear in templatized code. I've attached a minimal working example which you can compile to reproduce the bug. The relevant portion of code demonstrating the bug is also at the end of this post.

Cheers,

Tim

Reduction operation can reduce on multiple ranks?

Theoretically, 

sum = __sec_reduce_add(a[:][:]); //sum across the whole array 'a'

sum_of_column[:]=__sec_reduce_add(a[:][:]); //sum across the column of 'a'

Actually, when I tested the second statement, the sum_of_column got always the sum across the whole array of a, no matter the rank of sum_of_column. 

For a given execution context of rank m and a reduction array section argument with rank n, where n>m, it is the last n-m ranks of the array section argument who should be reduced, right? What went wrong? 

Thank you for your help!

how to use cilk efficiently within shared variables

Hello,

I have the problem with using cilk plus. could you help me, please ?

G class contains the matrix (as a vector) GenoMatrix[nIndividuals * nMarkers], where nInidividuals = 5000 and nMarkers = 50000

there is also the int * Criteria::solution[nIndividuals] variable of the Criteria class

I try to use cilk plus to accelerate the code but I have a data race problem with shared vectors (solution, GenoMatrix) and I don't know how to solve it correctly.

Thank you for your aid !

Cilk_for division of work

Hello everybody,

 While working with CilkPlus on a project, the following question came up: How cilk_for divides the work?

 I thought that cilk_for divided the work equally on all available threads,
 but, when I run the following code, the situation is different:

 #include<stdio.h
 #include<stdlib.h
 int main() {
     int i = 0;
     int* cnt = (int*)calloc(__cilkrts_get_nworkers(), sizeof(int));

     cilk_for(i = 0; i < 200000; i++)
         cnt[__cilkrts_get_worker_number()]++;

cilkplus tools and workflow discussion

Dear all,

We (i.e., my students and I, that is) are now using the GCC CilkPlus branch quite heavily, and we believe we're making progress in certain kinds of algorithms we're investigating. The purpose of this message is to find out if anyone else lurking in this forum has a CilkPlus "workflow" to share. For example debugging tools, profilers, etc. We do the following:

Cilk worker size deque

I understand that each worker in Cilk has its own deque from which it pops frames to work on and to which it pushes frames.

Is there any way I could somehow display/print/get/obtain the number of frames in a worker’s deque at any point i.e. the size of a worker’s deque?

I have dug into Cilk runtime code (scheduler.c, global_state.cpp, stacks.c, local_state.h … just to name few) and could not recognize anything that would give me such information. Push and pop functions only work on next_frame that is just a pointer to a struct of full_frame type.

Thank you.

__cilkrts_cilk_for_64 undifined

Dear all, I seem to be having a bit of an issue with some code using cilk_for on my machine. It's a 64-bit machine.

The code 

cilk_for(int i=0; i< x; i++) {}

where x is a signed int, gives me 

undefined reference to _cilkrts_cilk_for_64

Looks like a linker issue (maybe), but I cant figure it out, my includes are as follows:

#include <cilk/cilk.h>
#include <cilk/cilk_api.h>
#include <cilk/common.h>

Pages

Subscribe to Intel® Cilk™ Plus