Clarification: THREADS and MYTHREAD values are invariant

Issue #97 new
Former user created an issue

Originally reported on Google Code with ID 97

Re: the recently ratified Issue 32:
THREADS/MYTHREAD have "integral value" rather than "type int"

The current language states that THREADS is:

     a value of type int}; it specifies the number of
     threads and has the same value on every
     thread.   Under the static THREADS translation environment, {\tt THREADS}
     is an integer constant suitable for use in
     {\tt \#if} preprocessing directives.

Although "has the same value on every thread" might indicate that the value is constant
during the course of program execution, it does not state this directly.

The definition of MYTHREAD is:

     a value of type int}; it specifies the
     unique thread index.

Similarly, this definition does not explicitly state the value of MYTHREAD is invariant
when evaluated by each UPC thread.

At issue: is the specification sufficiently clear that both the THREADS and MYTHREAD
expression values are constant when evaluated (1) across all threads (for THREADS)
and (2) on each thread (for MYTHREAD)?

Reported by gary.funck on 2012-10-14 15:52:20

Comments (4)

  1. Former user Account Deleted
    It's true the spec does not explicitly state that MYTHREAD is invariant for a given
    thread and THREADS is invariant for the program execution, but this also seems fairly
    obvious from a general understanding of the static SPMD model. I have trouble believing
    any implementer would consider this ambiguous, but I suppose it doesn't hurt to be
    explicit.
    
    We already prohibit user assignments that might change the value of these expressions,
    but we need to avoid the terms "const" and "integer constant", since these don't technically
    apply to MYTHREAD or THREADS under dynamic THREADS environment.
    
    How about this:
    
    --- upc-language.tex    (revision 170)
    +++ upc-language.tex    (working copy)
    @@ -78,13 +78,20 @@
          threads and has the same value on every
          thread.   Under the static THREADS translation environment, {\tt THREADS}
          is an integer constant suitable for use in {\tt \#if} preprocessing directives.
    +     \xadded[id=DB]{97}{
    +     Under the dynamic THREADS translation environment, the value of {\tt THREADS}
    +     is invariant throughout program execution.
    +     }
    
     \subsubsection{{\tt MYTHREAD}}
     \index{MYTHREAD}
     \npf{\tt MYTHREAD} is an expression with %
          \xreplaced[id=DB]{32}{integral value}{a value of type int}; %
          it specifies the
    -     unique thread index.%
    +     unique thread index,
    +     \xadded[id=DB]{97}{
    +     which is invariant for each thread throughout program execution.
    +     }
          \xadded[id=DB]{33}{%
            \truefootnote{The definition of MYTHREAD and THREADS as expressions, not objects
    or
                    l-values, means one cannot assign to them or take their address.}%
    

    Reported by danbonachea on 2012-10-16 03:44:41 - Status changed: Accepted

  2. Former user Account Deleted
    I think the proposed text is "harmless", but is also "pointless".
    So, my vote is for No Change.
    

    Reported by phhargrove@lbl.gov on 2012-10-16 03:55:21

  3. Former user Account Deleted
    Gary agreed on the 11/29 telecon that this clarification is unnecessary.
    

    Reported by danbonachea on 2012-11-29 19:50:06 - Status changed: Rejected

  4. Log in to comment