Karim BELABAS on Mon, 25 Oct 1999 15:12:39 +0200 (MET DST)


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

Re: bug (seems minor) in the Alpha bench


> [Philippe Elbaz-Vincent:]
>> In the test suite for Alpha EV6/OSF1 (with the DEC C compiler)
>> and with  pari 2.0.18 (developpement cvs 17/10/1999)
>> I got the following [BUG] put in the diff files (both for dyn and sta)
[... output edited ...]
>>   ? getheap
>> ! [21, 1568]
>> --- 111,117 ----
>>   ? getheap
>> ! [21, 1569]

[John Cremona:]
> That is indeed a trivial thing and not a bug at all:  different machines
> obviously run the bench tests in different times, and the "make bench" is
> supposed to edit out these lines before doing the diff.  However
> sometimes with a new release they do not tidy this up properly.

First a general note: as mentioned in CVS.DOC, the cvs repository contains
the very latest development sources (they are updated at least on a daily
basis), and are in fact only guaranteed to compile cleanly on (at least)
one of the developers's machines. So you may get minor discrepancies or
blatant bugs if you use these, esp. on 64 bit machines which are not as
readily available to me as, UltraSparcs say. [ This is not to say you
shouldn't use the repository. I'm very grateful for all the feedback we
get, and the sooner a problem is detected, the better for everybody. Also,
it's easier to update once in a while than to apply all patches. ]

In this specific case, it's a genuine problem, though hardly a severe one:
the "getheap" counts (supposedly roughly equal to the heap size) differ
by 1.

This has been with us for quite a long time, without our noticing [ on
alpha + linux, the problem is not exhibited ] and is due to a typo in the
getheap() function, which (possibly) returned a meaningless result for the
"size" of a user function.

I've corrected the problem in the cvs repository. Please check that the
benches have indeed been corrected. After the patch, the getheap() result
will still be slightly off (argument structure not taken into account), but
at least meaningful.

A better patch, for release 2.2, will store the block size in the 'bloc'
structure for all such objects. [ the internal GP structures: 'entree',
'bloc', 'gp_args'... are mostly hacks and need to be cleaned up. ]

Cheers,

  Karim.

Index: src/language/init.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/language/init.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -c -r1.8 -r1.9
*** src/language/init.c	1999/10/22 15:36:29	1.8
--- src/language/init.c	1999/10/25 12:51:31	1.9
***************
*** 483,489 ****
    {
      m++; l+=4;
      if (! x[0]) /* user function */
!       l += (strlen((char *)(x+sizeof(entree*)))) / sizeof(long);
      else if (x==bernzone)
        l += x[0];
      else /* GEN */
--- 483,489 ----
    {
      m++; l+=4;
      if (! x[0]) /* user function */
!       l += (strlen((char *)(x+2))) / sizeof(long);
      else if (x==bernzone)
        l += x[0];
      else /* GEN */
Index: src/test/32/program
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/test/32/program,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** src/test/32/program	1999/09/16 13:48:29	1.1
--- src/test/32/program	1999/10/25 12:59:32	1.2
***************
*** 112,118 ****
  3
  ? kill(addii)
  ? getheap
! [21, 2992]
  ? print("Total time spent: ",gettime);
! Total time spent: 1151
  ? \q
--- 112,118 ----
  3
  ? kill(addii)
  ? getheap
! [21, 2994]
  ? print("Total time spent: ",gettime);
! Total time spent: 1144
  ? \q
Index: src/test/64/program
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/test/64/program,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** src/test/64/program	1999/09/16 13:48:37	1.1
--- src/test/64/program	1999/10/25 12:59:32	1.2
***************
*** 111,117 ****
  3
  ? kill(addii)
  ? getheap
! [21, 1568]
  ? print("Total time spent: ",gettime);
  Total time spent: 247
  ? \q
--- 111,117 ----
  3
  ? kill(addii)
  ? getheap
! [21, 1570]
  ? print("Total time spent: ",gettime);
  Total time spent: 247
  ? \q
__
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://hasse.mathematik.tu-muenchen.de/ntsw/pari/