Software Archive
Read-only legacy content
17061 Discussions

parameter for cilk_leave_begin ZCA

I-Ting_L_
Beginner
629 Views

Hi,

I am looking into building a Pin tool that uses the ZCA generated for Cilk Plus, and I have a question that is not answer by the document "Intrisics for Low Overhead Annotations."

In particular, I am wondering what is the parameter passed to the cilk_leave_begin annotation (the document says some stable stack pointer, but it doesn't say what). According to the document, cilk_enter_begin takes the pointer to cilkrts_stack_frame corresponding of the executing Cilk function, so I wondered if the cilk_leave_begin takes either the same cilkrts_stack_frame as cilk_enter_begin, or the cilkrts_stack_frame of its immediate Cilk ancestor frame.  It turns out that, it's neither.  (This is confirmed by writing a simple Pin tool that intercepts cilk_enter_begin and cilk_leave_begin and print out the parameters.)  Out of curiousity, what exactly does cilk_leave_frame take for parameter?

Thanks,
Angelina 

0 Kudos
3 Replies
I-Ting_L_
Beginner
629 Views

Actually, upon second reading, it sounds like the parameter is not just "some" stack pointer, but rather, literally, it's "the" stack pointer, i.e., the lower-address end of the stack frame, corresponding to the currently executing function (whether that's a spawning function or a spawn helper function).  Is my reading correct?

Thanks,
Angelina 

0 Kudos
Barry_T_Intel
Employee
629 Views

Hi Angelina.

Yes.  That's exactly what it is. The stack pointer for the function, after all locals have been allocated.  I trust you're using zcalib instead of starting from scratch and parsing the ZCA data yourself.

    - Barry

0 Kudos
I-Ting_L_
Beginner
629 Views

Yes.  I am using libzca.  Now it makes sense to me why I am seeing the values I am seeing.

Thanks!
Angelina 

0 Kudos
Reply