Where do openmp private variables get allocated? On each thread stack, dynamically or through some shared array or something?
Where do openmp private variables get allocated? On each thread stack, dynamically or through
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The OpenMP specification doesn’t specify if those variables are to be allocated on the stack or on the heap (and if they are on the heap if it is in a shared array or if there is one object allocated for each thread). Generally I would assume that private variables are allocated on the stack (there is no reason not to and it’s generally more efficient). According to the manual that is the behaviour used in libgomp (the implemention used by gcc) at least, no clue about other implemantations though (although I see little reason why those shouldn’t do the same thing).