This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: Issue with _Cilk_for
- From: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 31 Jan 2014 16:39:03 +0000
- Subject: RE: Issue with _Cilk_for
- Authentication-results: sourceware.org; auth=none
- References: <BF230D13CA30DD48930C31D4099330003A4CA5AD at FMSMSX101 dot amr dot corp dot intel dot com> <20140131154257 dot GU892 at tucnak dot redhat dot com> <20140131160418 dot GV892 at tucnak dot redhat dot com> <BF230D13CA30DD48930C31D4099330003A4CAE95 at FMSMSX101 dot amr dot corp dot intel dot com> <20140131162543 dot GW892 at tucnak dot redhat dot com>
> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Jakub Jelinek
> Sent: Friday, January 31, 2014 11:26 AM
> To: Iyer, Balaji V
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: Issue with _Cilk_for
>
> On Fri, Jan 31, 2014 at 04:18:28PM +0000, Iyer, Balaji V wrote:
> > I tried to do this. The thing is, you had me model like this:
> >
> > #pragma omp parallel for
> > _Cilk_for (...)
> > {
> > Body
> > }
> >
> > Now, the compiler will do something like this:
> >
> > #pragma OMP parallel
> > {
> > #pragma Omp for
> > {
> > _Cilk_for (...)
> > Body
> > }
> > }
> >
> > Now, if by the time it starts to look at evaluating/breaking up the
> > _Cilk-for's parts, we are already at the scope inside #pragma omp
> > parallel. If I try to pop here, it has some scope issues with #pragma
> > omp parallel. This requires a lot of rewrite of existing OMP code to
> > port it for _Cilk_for. This can be done but will take significant
> > time which I don't think I have since we are close to end of stage3.
>
> It really doesn't require lots of rewriting, after all, OpenMP handles the C++
> iterators very similarly.
>
> > We can look into what you want, but in the meantime, can you accept
> > this patch with the way I have modelled so that the feature can make
> > it into 4.9?
>
> No. In GCC we do not rush in bad changes just because there is time
> pressure. As Cilk+ is new in GCC 4.9, if you adjust things properly in say 2-3
> weeks frame, we might still make an exception and allow it in during stage4,
> otherwise it will have to wait for 5.0.
Hi Jakub,
I am not asking to rush anything. Personally, I won't submit anything if I don't think it is a correct solution, especially for something this big into a system that is used by a large population. On the top level, I don't understand why it matters where the #pragma omp parallel is placed. Can you please explain me that? I agree it feels weird when you think about from OMP standpoint, but so what? It is just used in the internal representation for _Cilk_for so that I can use the OMP routines to create child functions and transplant the correct parts of code to it. _Cilk_for behaves very differently compared to OMP for. It is almost like apple and orange when it comes to functionality. To my best knowledge, there is no additional scoping or overhead instructions inserted when I put #prgma omp parallel around the body.
I am just asking this to get the whole picture. Please don't think this as an argument/flame.
Thanks,
Balaji V. Iyer.
>
> Jakub