[fpc-pascal] Common OpenMP syntax?
Vinzent Hoefler
JeLlyFish.software at gmx.net
Thu Jul 27 15:27:53 CEST 2006
On Thursday 27 July 2006 12:53, Alexandre Leclerc wrote:
> Then we could very simply have:
> parallel procedure ParallelBlock;
> parallel function ParallelFunction; //if this can happen...
Yes. I thought of something like that, because it could quite easily
match with a "parallel for" construct. That's why I don't like the idea
of a function modifier.
But pleeeaaase, people. This was only one single and little example and
it's not nearly close to what the spec says. It just scratched the
surface of it. So it's a bit early to hang on this only parallel
keyword in that particular example. In the end, *all* constructs should
nicely match together.
What about those "parallel section" and "parallel workshare" constructs?
The latter bothers me a lot (section might prove to be quite easy) plus
all the /parameters/ those stuff can have:
You don't want to write
|parallel (Num_Threads := 3, ...)
|function
or something similar, do you?
Or think of this "reduction" keyword...
> Also, I read that in example 1: "Variables declared here should have
> shared context."
Yes, if they're declared outside of the parallel block, they can be seen
by every single one, so "shared" would IMO be a more natural visibility
rule here. This could remove the need for another keyword.
> In fact by default they have private context and to
> me it looks like more normal.
What do you mean "by default"? The OpenMP spec? Well, I wasn't trying to
copy the idiocies mainly caused by the chosen base language(s). :->
Thread private variables don't make sense outside of the parallel block,
especially *after* it, so why should the default be "private" here?
> Maybe we should have a way to do the
> contrary: specify that a variable has shared context... What others
> think?
The approach allowed both in a (I think, logical way, because of the
implied scoping rules). The problems begin with the "firstprivate" and
such directives.
Vinzent.
More information about the fpc-pascal
mailing list