[Omp] isn't work sharing inside SINGLE a restriction?

Patricia Bittencourt Sampaio patricourt at yahoo.com.br
Mon Apr 24 12:45:40 PDT 2006


 Hi,

   Don't CONSTRUCT_1 and CONSTRUCT_2 (showed below)
have the same effect, I mean, aren't they similar?  

----------------------CONSTRUCT_1--------------------
void routine_B()
{
#pragma omp for
  for(...){
    .
    .
    . 
  }
}

void routine_A()
{
   routine_B();
}

int main()
{
    #pragma omp parallel 
    {
             .
             .
             .
         #pragma omp single
         {
             routine_A();
         }
    }
}

----------------------CONSTRUCT_2-----------------------------

int main()
{

    #pragma omp parallel 
    {
             .
             .
             .
         #pragma omp single
         {
             #pragma omp for
             for(...) 
         }

    }
}
-----------------------------------------------------


  I Expected that CONSTRUCT_1 was violating the
restrictions on the use of "single" directive as it
happens when someone write a code like CONSTRUCT_2.

  However, when trying to compile a code in the form
of CONSTRUCT_1 it passes through the compiler. 

  Does anybody know how "for" directive presented on
routine_B() is executed? By wich group of threads can
it be executed if the one created on the occurence of
"parallel" directive remains on the implicit barrier
after "single"?

I appreciate some help,

regards,


Patricia B. Sampaio
====================================
Federal University of Rio de Janeiro


		
_______________________________________________________ 
Abra sua conta no Yahoo! Mail: 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz. 
http://br.info.mail.yahoo.com/


More information about the Omp mailing list