[Omp] data scope clause

Meadows, Lawrence F lawrence.f.meadows at intel.com
Wed Apr 27 10:22:14 PDT 2005


In C, all arguments are passed by value, thus are always
private. So the dummy arguments corresponding to the
actual arguments x,y,z will be private inside of k_routine,
regardless of how they are declared externally -- exactly
as if they had been declared as local variables inside
of k_routine. Their initial value will be whatever was
passed to k_routine.

Pointers are a different matter -- the pointer might
be private while the pointed-to might not be. 

>-----Original Message-----
>From: Omp-bounces at openmp.org [mailto:Omp-bounces at openmp.org] 
>On Behalf Of Patricia Bittencourt Sampaio
>Sent: Wednesday, April 27, 2005 10:14 AM
>To: Omp at openmp.org
>Subject: [Omp] data scope clause
>
>
>  Hi,
>
>    I'm a lit bit confused about the properties of
>data scope clauses. If I have something like this:
>
>#pragma omp parallel private(x, y, z)
>{
>    int id;
>    
>    id = omp_get_thread_num();
>    x = 2+id;
>     
>    k_routine(x, y, z);
>}
>
>    In this example, will the variables(x, y and z)
>become shared at k_routine() or the clause make them
>persist as private even inside k_routine?
>
>Best regards,
>
>
>Patricia Bittencourt Sampaio
>====================================
>Federal University of Rio de Janeiro
> 
>
>
>	
>	
>		
>Yahoo! Acesso Grátis - Internet rápida e grátis. 
>Instale o discador agora! http://br.acesso.yahoo.com/
>
>_______________________________________________
>Omp mailing list
>Omp at openmp.org
>http://openmp.org/mailman/listinfo/omp_openmp.org
>




More information about the Omp mailing list