# 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?

# An official example of user-defined reducer which gives a weird result

I'm new comer in cilk.

# 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.

# spawn depth

Dear all, is the 1024 limit to spawn depth still valid? If so, is there any way we can run a sanity check to see whether we have reached that level while using a cilk_for? Thanks.

# why cilk_for slower that for ?

Hello,

I'm trying to use cilk_for to parallel the following function :

# __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>

# gcc cilk plus git repository corrupted?

Hi,

I have cloned the gcc Cilk Plus git repo awhile back.  Today, when I tried to pull from the repo, it failed with the following error:

\$ git pull
error: Unable to find 43269d882367dc4f0e4c2651d6625e1b7de78764 under http://gcc.gnu.org/git/gcc.git
Cannot obtain needed object 43269d882367dc4f0e4c2651d6625e1b7de78764
while processing commit d612d6bc401c95be8e7740ffea26a77845edd113.
error: Fetch failed.