Comments on: OpenMP Tutorial – firstprivate and lastprivate http://www.lindonslog.com/programming/openmp/openmp-tutorial-firstprivate-and-lastprivate/ Sun, 27 Nov 2016 15:23:00 +0000 hourly 1 https://wordpress.org/?v=4.6.1 By: Jung http://www.lindonslog.com/programming/openmp/openmp-tutorial-firstprivate-and-lastprivate/#comment-1243 Mon, 28 Mar 2016 18:57:38 +0000 http://www.lindonslog.com/?p=87#comment-1243 I think, if you specify just private(x), the value of x in parallel loop is not initialized. Thus, x will have random floating number. On the other hand, firstprivate(x) will allow x to have a specific value, which is declared before a parallel region.

]]>
By: Keith McDaniel http://www.lindonslog.com/programming/openmp/openmp-tutorial-firstprivate-and-lastprivate/#comment-1038 Mon, 15 Jun 2015 21:16:53 +0000 http://www.lindonslog.com/?p=87#comment-1038 In this case, what is the difference between private and firstprivate? Do they not both start the parallel region with the value of the variable declared outside of the parallel block?
I.E., in your initial example, if you simple declared x private, did not assign i to x, then did a print of x, would you not get 44 throughout the entire parallel region? If so, then what is point of firstprivate?

Alternatively, does the first case just initialize the private instance of x within the parallel regions to 0?

]]>