Question about partial fix of bug #15523

classic Classic list List threaded Threaded
4 messages Options
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Question about partial fix of bug #15523

Hello devs,

As I said in http://bugzilla.scilab.org/show_bug.cgi?id=15523#c4, there
is a an easy fix to repair mode %ODEOPTIONS(1)=2 for the "rkf" solver.
In fact, lines 189-90 of this file

if(itask.eq.1) then iflag=1
if(itask.eq.2) then iflag=-1

appear as completely *dumb* as fortran compilers (at least gfortran on
OSX) silently ignore the code following a "then" on the same line. The
following program :

        program dumb_program
           flag=0
           if (flag.eq.0) then flag=1/flag
           print *,flag
        end program dumb_program

gives the output

    0.00000000

Even by using -Wall no warning is produced at compilation. Anyway, there
are only two allowed forms:

-short form:

if (flag.eq.0) flag=1/flag

-long form:

if (flag.eq.0) then
     flag=1/flag
endif

And the fixed program works as expected

        program dumb_program
           flag=0
           if (flag.eq.0) flag=1/flag
           print *,flag
        end program dumb_program

as the output is

          Infinity

Hence, my question is: can I create a small patch for "rkf" solver,
commited to 6.0 branch, and keep the improvements to 'rk' solver for
master ?

S.


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Question about partial fix of bug #15523

I forgot to give the path to the source file:

scilab/modules/differential_equations/src/fortran/rkf45.f

Le 11/04/2018 à 15:36, Stéphane Mottelet a écrit :

> Hello devs,
>
> As I said in http://bugzilla.scilab.org/show_bug.cgi?id=15523#c4,
> there is a an easy fix to repair mode %ODEOPTIONS(1)=2 for the "rkf"
> solver. In fact, lines 189-90 of this file
>
> if(itask.eq.1) then iflag=1
> if(itask.eq.2) then iflag=-1
>
> appear as completely *dumb* as fortran compilers (at least gfortran on
> OSX) silently ignore the code following a "then" on the same line. The
> following program :
>
>        program dumb_program
>           flag=0
>           if (flag.eq.0) then flag=1/flag
>           print *,flag
>        end program dumb_program
>
> gives the output
>
>    0.00000000
>
> Even by using -Wall no warning is produced at compilation. Anyway,
> there are only two allowed forms:
>
> -short form:
>
> if (flag.eq.0) flag=1/flag
>
> -long form:
>
> if (flag.eq.0) then
>     flag=1/flag
> endif
>
> And the fixed program works as expected
>
>        program dumb_program
>           flag=0
>           if (flag.eq.0) flag=1/flag
>           print *,flag
>        end program dumb_program
>
> as the output is
>
>          Infinity
>
> Hence, my question is: can I create a small patch for "rkf" solver,
> commited to 6.0 branch, and keep the improvements to 'rk' solver for
> master ?
>
> S.
>
>

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: Question about partial fix of bug #15523

Hello Stéphane,

As this change can have an impact on existing code (even if the previous is incorrect) could please
fix it in master ?

Thanks,

--
Clément

Le mercredi 11 avril 2018 à 15:40 +0200, Stéphane Mottelet a écrit :

> I forgot to give the path to the source file:
>
> scilab/modules/differential_equations/src/fortran/rkf45.f
>
> Le 11/04/2018 à 15:36, Stéphane Mottelet a écrit :
> > Hello devs,
> >
> > As I said in http://bugzilla.scilab.org/show_bug.cgi?id=15523#c4,
> > there is a an easy fix to repair mode %ODEOPTIONS(1)=2 for the "rkf"
> > solver. In fact, lines 189-90 of this file
> >
> > if(itask.eq.1) then iflag=1
> > if(itask.eq.2) then iflag=-1
> >
> > appear as completely *dumb* as fortran compilers (at least gfortran on
> > OSX) silently ignore the code following a "then" on the same line. The
> > following program :
> >
> >        program dumb_program
> >           flag=0
> >           if (flag.eq.0) then flag=1/flag
> >           print *,flag
> >        end program dumb_program
> >
> > gives the output
> >
> >    0.00000000
> >
> > Even by using -Wall no warning is produced at compilation. Anyway,
> > there are only two allowed forms:
> >
> > -short form:
> >
> > if (flag.eq.0) flag=1/flag
> >
> > -long form:
> >
> > if (flag.eq.0) then
> >     flag=1/flag
> > endif
> >
> > And the fixed program works as expected
> >
> >        program dumb_program
> >           flag=0
> >           if (flag.eq.0) flag=1/flag
> >           print *,flag
> >        end program dumb_program
> >
> > as the output is
> >
> >          Infinity
> >
> > Hence, my question is: can I create a small patch for "rkf" solver,
> > commited to 6.0 branch, and keep the improvements to 'rk' solver for
> > master ?
> >
> > S.
> >
> >
>
>
_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Question about partial fix of bug #15523

I have another question: the fix for 'rk' and 'rkf'
(http://bugzilla.scilab.org/15523) will be visible only if
http://bugzilla.scilab.org/15527 is solved before.

However, I have proposed the fix for bug 15527 in 6.0 as this bug really
breaks ode. So please tell me if you want to

-group fixes for bugs 15523, 1527 for master or

-fix bug 15527 in 6.0, wait for weekly 6.0->master merge,  then fix bug
15523 on master

In any case

https://codereview.scilab.org/#/c/19946/

needs a review from the team.

S.

Le 12/04/2018 à 11:39, Clément David a écrit :

> Hello Stéphane,
>
> As this change can have an impact on existing code (even if the previous is incorrect) could please
> fix it in master ?
>
> Thanks,
>
> --
> Clément
>
> Le mercredi 11 avril 2018 à 15:40 +0200, Stéphane Mottelet a écrit :
>> I forgot to give the path to the source file:
>>
>> scilab/modules/differential_equations/src/fortran/rkf45.f
>>
>> Le 11/04/2018 à 15:36, Stéphane Mottelet a écrit :
>>> Hello devs,
>>>
>>> As I said in http://bugzilla.scilab.org/show_bug.cgi?id=15523#c4,
>>> there is a an easy fix to repair mode %ODEOPTIONS(1)=2 for the "rkf"
>>> solver. In fact, lines 189-90 of this file
>>>
>>> if(itask.eq.1) then iflag=1
>>> if(itask.eq.2) then iflag=-1
>>>
>>> appear as completely *dumb* as fortran compilers (at least gfortran on
>>> OSX) silently ignore the code following a "then" on the same line. The
>>> following program :
>>>
>>>         program dumb_program
>>>            flag=0
>>>            if (flag.eq.0) then flag=1/flag
>>>            print *,flag
>>>         end program dumb_program
>>>
>>> gives the output
>>>
>>>     0.00000000
>>>
>>> Even by using -Wall no warning is produced at compilation. Anyway,
>>> there are only two allowed forms:
>>>
>>> -short form:
>>>
>>> if (flag.eq.0) flag=1/flag
>>>
>>> -long form:
>>>
>>> if (flag.eq.0) then
>>>      flag=1/flag
>>> endif
>>>
>>> And the fixed program works as expected
>>>
>>>         program dumb_program
>>>            flag=0
>>>            if (flag.eq.0) flag=1/flag
>>>            print *,flag
>>>         end program dumb_program
>>>
>>> as the output is
>>>
>>>           Infinity
>>>
>>> Hence, my question is: can I create a small patch for "rkf" solver,
>>> commited to 6.0 branch, and keep the improvements to 'rk' solver for
>>> master ?
>>>
>>> S.
>>>
>>>
>>
> _______________________________________________
> dev mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/dev


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev