Comment for example for #pragma omp task (untied)

The public comment period closed January 31, 2008. This forum is now locked (read only).

Comment for example for #pragma omp task (untied)

Postby Leo » Thu Mar 13, 2008 11:38 am

In page 181, the draft says: "The following example(A.13.6c) is the same as the previous one (A.13.5c), except that the tasks are generated in an untied task. "

The example is VERY,VERY, VERY confusing to dumb people like me.

Do you want to say that there are three levels of tasks?
1. an implicit task of "#pragma omp single " with a default tied property
2. an explicit tasks for "#pragma omp task \n process()", and
3. a new level of explicit, untied task added in between, a trick to make a untied task within a tied task.

If my understanding is right, I would expect a more elegant way to express the same idea, allowing "untied" clause to be used with "omp single".

It is not reasonable to only allow the "untied" clause to be used with explicit tasks, and ban its use with implicit tasks like, omp section, omp single, even omp master etc.

----------page 181 : example A.13.5c-------
#pragma omp parallel
{
#pragma omp single
{
int i;
for (i=0; i<LARGE_NUMBER; i++)
#pragma omp task // i is firstprivate, item is shared
process(item[i]);
}
}
}
----------example A.13.6c-------
#pragma omp parallel
{
#pragma omp single
{
int i;
#pragma omp task untied // i is firstprivate, item is shared
{
for (i=0; i<LARGE_NUMBER; i++)
#pragma omp task
process(item[i]);
}
}
}
Leo
 
Posts: 4
Joined: Tue Mar 11, 2008 5:25 pm

Re: Comment for example for #pragma omp task (untied)

Postby jolivier » Fri Mar 14, 2008 12:25 pm

Leo,

I think some of your confusion may be due to a misunderstanding of implicit tasks. See the definition for task in the glossary. An explict task can only be generated by the task construct and an implicit task can only be generated by a parallel construct. Worksharing constructs such as omp single, omp section, etc and synchronization constructs such as omp master, omp atomic, omp critical, etc do not generate new tasks and therefore can't be untied.

There are only tied and untied tasks. Implicit tasks are always tied which fits nicely with the existing parallel construct semantics. Explicit tasks may be either tied or untied.

Does that help answer your question?

Regards,
Jeff
Last edited by jolivier on Fri Mar 14, 2008 12:57 pm, edited 1 time in total.
jolivier
 
Posts: 1
Joined: Fri Mar 14, 2008 12:17 pm

Re: Comment for example for #pragma omp task (untied)

Postby Leo » Fri Mar 14, 2008 12:57 pm

Yes. I did misunderstand the implicit tasks. Thanks for your help!
Leo
 
Posts: 4
Joined: Tue Mar 11, 2008 5:25 pm


Return to Draft 3.0 Public Comment

Who is online

Users browsing this forum: No registered users and 3 guests