[Omp] A question about OpenMP 2.5

Greg Bronevetsky greg at bronevetsky.com
Tue Mar 20 12:03:03 PDT 2007


Yeah, I'm now fully confused.

In section 1.4.1. "memory" is described as: "All OpenMP threads have
access to a place to store and retrieve variables, called the memory."

However, as Brad pointed out, section 1.2.3 defines variables as "A named
data object, whose value can be defined and redefined during the
execution of a program."

As such, a malloc-ed buffer can't be in memory.

However, sections 2.8.1.1 and 2.8.1.2 both say "Variables with heap
allocated storage are shared."(this is for C/C++) So what is a variable
with heap allocated storage? How can it have a name?

I think that the intuition behind "variables" was that those were the
memory locations that could be directly referenced and described in
directives. However, the word variables also ended up being used for other
things like heap memory and they were also referenced in the memory model,
which shouldn't care about what memory locations can be directly
referenced in directives. This seems to be a mistake and the appropriate
word for the latter meaning is "memory location". However, with this
terminology we get a new question: what is the official size of a "memory
location"? It matters for Brad's loop.

                             Greg Bronevetsky


On Tue, 20 Mar 2007, Shah, Sanjiv wrote:

> They're memory!
> 
> --
> Sanjiv
>  
> 217/403-4244 office
> 217/419-4390 mobile
> 
> -----Original Message-----
> From: omp-bounces at openmp.org [mailto:omp-bounces at openmp.org] On Behalf
> Of Greg Bronevetsky
> Sent: Tuesday, March 20, 2007 1:36 PM
> To: omp at openmp.org; Brad Bell
> Subject: Re: [Omp] A question about OpenMP 2.5
> 
> On Tue, 20 Mar 2007, Shah, Sanjiv wrote:
> 
> > Folks,
> > 
> > a and b are pointers in C, they are not arrays.  The pointers are
> never
> > written in this loop.
> > 
>    In that case our "variable" is a malloc-ed buffer. I have no idea
> what
> status malloc-ed buffers have in OpenMP. They're not named so they
> shouldn't be variables. So what are they?
> 
>                              Greg Bronevetsky
> 
> _______________________________________________
> Omp mailing list
> Omp at openmp.org
> http://openmp.org/mailman/listinfo/omp
> 
> 



More information about the Omp mailing list