gomp-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gomp-discuss] Start of an OpenMP Implementation Spec


From: Ross Towle
Subject: Re: [Gomp-discuss] Start of an OpenMP Implementation Spec
Date: Tue, 26 Oct 2004 11:06:28 -0700

The purpose of  _OMP_Params is to hold the parameters to the outlined
parallel region.  The most common parameters will be the shared
variables.  Since the runtime support routines have no idea of the
number of shared variables to the outlined routine, they need to be
passed with a vararg type of mechanism.

When the user routine calls the _OMP_MasterFunction, the user routine
knows what variables are shared and thus need to be put into
_OMP_Params. _OMP_MasterFunction does it work and eventually the
outlined parallel region is called.  Up to this point the _OMP_Params
is passed but nothing is done with it.  When the parallel region is
called _OMP_Params is treated like a vararg entity and passed to the
outlined region.

The key being the OMP support routines should NEVER need to know the
number of parameters to an outlined parallel region and never need to
look in _OMP_Params

Other information about the parallel region is in the
_OMP_ParRegion_Info.  The contents of this structure will be examined,
used, and modified by the OMP support routines.

-Ross


> 2) I am not sure that I understand your intentions with the
> _OMP_Params array completely. I assume that your sample_region_i
> functions eventually will be used in a pthread creation but maybe I got
> it wrong (maybe you don't assume the pthread API). If not, sample_region_i
> must be on the form
> 
>         void *sample_region_i (void *arg)
> 
> and you will consequently have to pass your arguments via a pointer to a
> structure. Moreover I would suspect that we would need other information
> (e.g. thread_id) accessible from within each thread too.  That is, I assume
> that we would need something like:
> 
> struct _thread_args {
>     int thread_id;
>         ...
>         void *func_args;
> };
> 
> where func_args would be a struct tailored to the region
> in question, e.g. your sample2 would be something like:
> 
> struct _sample2_args {
>         float *a;
>         float *b;
>         float *c;
>         long n;
> };
> 
> Am I totally off the track here ??? Please give us further details
> about your intentions with _OMP_Params.
> 

> Cheers, Jacob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]