[Cplex] Cplex: suggested topics for discussion on the next teleconf.

Nelson, Clark clark.nelson at intel.com
Tue Jun 18 18:20:52 CEST 2013


> Are we defining compiler instructions or hints?: The proposal points out
> that Cilk uses keywords, whilst OpenMP is based on pragmas, so presumably
> OpenMP is providing 'hints' to the compiler that it is free or accept, or
> not. If one of our objectives is to support both approaches, does this
> mean that the Cilk-like keywords also have to be treated as 'optional',
> at least in the sense of having an agreed semantics expressible in the
> language without the parallelism extensions?

That's a very good question. The answer is kind of subtle; it depends on
*exactly* what is considered "optional".

The semantics of Cilk are defined such that actual parallel execution is
never guaranteed/mandatory, so all parallelism could be considered optional;
in that sense even the Cilk keywords could be considered to be hints.

But from a different perspective, the keywords are interpreted as a
guarantee by the programmer that it is safe to do certain things in parallel;
in other words, that the compiler is free to transform things in a way that
might otherwise cause undefined behavior. In that sense, the keywords are
semantically significant: putting one in the wrong place causes a program
to be broken.

The fact that OpenMP constructs are expressed as pragmas does not mean that
any OpenMP pragma can be taken as hint when a program is interpreted as an
OpenMP program. The intention is that it is OK to ignore all of them, but if
any of them are honored, they should all be. So it can also be misleading to
call OpenMP pragmas hints.

But it's very important to keep in mind the exact sense in which any given
construct is or is not a hint.

Clark


More information about the Cplex mailing list