[Omp] Private or shared
Patricia Bittencourt Sampaio
patricourt at yahoo.com.br
Tue Mar 29 10:31:28 PST 2005
Hi to all,
I'm new to openmp and I've already take a look at
the openmp oficial site a couple of times.
I've found a presentation where at the end of it
there is an example of a program that compute PI's
value. But I couldn't understand some points of this
example.
At the first slide of this example, it's defined a
parallel region where a loop exists. However the for
directive has not been used for this loop. For my
surprise the variables "id" and "x" (which all threads
write on) is not defined as private. Actually, nothing
is defined for these variables . So it's assumed that
they're shared for default.
They're declared, however, inside the parallel
region. Is this suggests something?
Going to slide that focus on work sharing, it has
been used a for directive. Unexpectually, the variable
"i" (iteration) starts with the corresponding id of
the thread. Shouldn't it starts with 1 as the for
directive distributes the iterations among the threads
uniformily?
I'd appreciate your help.
[]'s
Patricia B. Sampaio
------------------------------------
Federal University of Rio de Janeiro
__________________________________________________
Converse com seus amigos em tempo real com o Yahoo! Messenger
http://br.download.yahoo.com/messenger/
More information about the Omp
mailing list