Some doubts about library interface

Some doubts about library interface

I already read document many times, but cannot get answer of some questions

1. What's the interface for "copyin" clause. In threadprivate section I found only copyprivate interface (__kmpc_copyprivate).

2. What does want to pass as microtask's (kmpc_micro) arguments. The document said that we must pass "pointers to shared variables accessed by the function." but in exactly what want to pass (e.g. shared variable, reduction variable right? Are there anything else?) 

Thank you

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

1. What's the interface for "copyin" clause?
There is no special interface for copyin clause. It is implemented as a simple copy plus a barrier.  That is when all worker threads copy the value of the master thread value to their own threadprivate location, the copyin is complete.  The barrier is the simplest way to implement this.

2. Agruments to microtask are pointers to all variables the microtask needs and cannot access directly. These are as you already mentioned shared variables, reduction variables, and also copyin and firstprivate variables. Some special internal variables not visible in the code may also be passed to microtask.


Leave a Comment

Please sign in to add a comment. Not a member? Join today