On 29 August 2012 21:20, Stefan Behnel <stefan...@behnel.de> wrote:
> Christoph Gohlke, 27.08.2012 18:05:
>> On 8/27/2012 2:42 AM, mark florisson wrote:
>>> On 27 August 2012 01:39, Christoph Gohlke wrote:
>>>> On my system, the following patch fixes all the lastprivate related test
>>>> errors and does not have any side effects on other tests. It removes the
>>>> additional initialization of the target index after `#pragma omp parallel`:
>>>>
>>>> diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
>>>> index 188de3d..5ba0eee 100644
>>>> --- a/Cython/Compiler/Nodes.py
>>>> +++ b/Cython/Compiler/Nodes.py
>>>> @@ -7627,7 +7627,7 @@ class ParallelRangeNode(ParallelStatNode):
>>>>           # target index uninitialized
>>>>           code.putln("if (%(nsteps)s > 0)" % fmt_dict)
>>>>           code.begin_block() # if block
>>>> -        code.putln("%(target)s = 0;" % fmt_dict)
>>>>           self.generate_loop(code, fmt_dict)
>>>>           code.end_block() # end if block
>>>>
>>>> I'm down to one remaining test failure on win32-py2.7
>>>
>>> Thanks, that's useful. Could you make a pull request? Maybe because
>>> the entry to the parallel loop has no barrier the assignment comes
>>> after the lastprivate? I'm not sure how that's possible, I would
>>> expect the lastprivate to be executed after the barrier by the highest
>>> ranking thread, so there would be no race. Maybe the last thread is
>>> slow, and doesn't get any iterations, and assigns the firstprivate
>>> value? Anyway, if it fixes stuff it's great :)
>>>
>>> I think the patch should then also remove the firstprivate() clause,
>>> since that variable wouldn't be initialized. It was only there to make
>>> compiler warnings to away.
>>>
>>> Mark
>>
>> I opened a pull request. Let's discuss it there.
>>
>> <https://github.com/cython/cython/pull/145>
>
> Mark, could you comment on the pull request and/or merge it then?
>
> Stefan
>
> _______________________________________________
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel

Oh sorry, yeah it looks good, I merged it.
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to