[SciPy-user] minimizers don't work - d1mach problem
Christian Kristukat
ckkart at hoc.net
Thu Mar 2 22:46:01 EST 2006
Robert Kern wrote:
> Christian Kristukat wrote:
>> Robert Kern wrote:
>>
>>> Christian Kristukat wrote:
>>>
>>>> Hi,
>>>> sorry for posting this again, but I'd really like to have the minimizers work
>>>> again. Every call to any of the miminizers scipy.fmin* fails with:
>>>>
>>>> Adjust D1MACH by uncommenting data statements
>>>> appropriate for your machine.
>>>> STOP 779
>>>>
>>>> I already looked at Lib/special/d1mach.f but I don't see what I should change
>>>> there. Anyway, d1mach.f hasn't been changed for ages so I doubt that the problem
>>>> is there.
>>>>
>>>> Here's my configuration:
>>>>
>>>> P4
>>>>
>>>> Python 2.4.1 (#1, Sep 13 2005, 00:39:20)
>>>> [GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2
>>>>
>>>> numpy/scipy from svn
>>>> ATLAS built with gfortran
>>> Odd. For your configuration, D1MACH ought to be taking the IEEE LITTLE ENDIAN
>>> branch earlier on, and the STOP 779 statements should never be reached. Try
>>> adding these lines to diagnose the issue:
>>>
>>> Index: Lib/special/mach/d1mach.f
>>> ===================================================================
>>> --- Lib/special/mach/d1mach.f (revision 1630)
>>> +++ Lib/special/mach/d1mach.f (working copy)
>>> @@ -60,6 +60,9 @@
>>> C ON FIRST CALL, IF NO DATA UNCOMMENTED, TEST MACHINE TYPES.
>>> IF (SC .NE. 987) THEN
>>> DMACH(1) = 1.D13
>>> + write(*,*) 'DMACH(1) == ', DMACH(1)
>>> + write(*,*) 'SMALL(1) == ', SMALL(1)
>>> + write(*,*) 'SMALL(2) == ', SMALL(2)
>>> IF ( SMALL(1) .EQ. 1117925532
>>> * .AND. SMALL(2) .EQ. -448790528) THEN
>>> * *** IEEE BIG ENDIAN ***
>> There's no additional output, so the if condition seems to be False.
>
> In that case, the STOP statements wouldn't be executed either. Add more
> write(*,*) statements to explore it, if you like. But:
>
>> There's
>> another d1mach.f in Lib/integrate/mach. Which one is the relevant here?
>
> Couldn't say. Try adding some different write(*,*) statements to it in order to
> find out.
>
>> Btw, the minimizers partly run, maybe in case when the gradients are far from
>> IEEE numeric limits?
>
> That wouldn't trigger anything in d1mach, though.
>
> What is your function? Are you using anything in scipy.special or scipy.integrate?
>
I put the same some write statements in Lib/integrate/mach/d1mach.f, and that's
what I get:
tnc: Version 1.2, (c) 2002-2003, Jean-Sebastien Roy (js at jeannot.org)
tnc: RCS ID: @(#) $Jeannot: tnc.c,v 1.201 2004/04/02 22:36:25 js Exp $
integrate DMACH(1) == 10000000000000.0
integrate SMALL(1) == -448790528
integrate SMALL(2) == 1117925532
STOP 778
Odd, that the error message disappeared and the subroutine stops at a different
line number. Before, the messag was:
tnc: Version 1.2, (c) 2002-2003, Jean-Sebastien Roy (js at jeannot.org)
tnc: RCS ID: @(#) $Jeannot: tnc.c,v 1.201 2004/04/02 22:36:25 js Exp $
Adjust D1MACH by uncommenting data statements
appropriate for your machine.
STOP 779
Any ideas?
Regards, Christian
More information about the SciPy-User
mailing list