I am just starting playing around with OpenMp and got very confused about this problem. Say if I declare an array int a[10] and use it inside some loop. What is the difference between #pragma omp parallel for private(a) and #pragma omp parallel for shared(a)? To me a is just a pointer to the first element of the array and according to what I have read the private construct will make a copy of the variable for each thread, and also very strangely initialize it with a random value if I do not use firstprivate construct. So my question is if I use private construct, what will happen semantically? Will it make a set of pointers and assign them to every thread created or will it make a set of copies of the whole array and let each thread to use them separately?
Thanks a lot.