Loading ...
Sorry, an error occurred while loading the content.

Re: [PrimeNumbers] Re: A new program for Unix/Mac users

Expand Messages
  • Yves Gallot
    ... You should link with the mathematical library: cc genefer.c -lm and it is better to optimize the code: cc genefer.c -O -lm Yves
    Message 1 of 6 , Jul 1, 2001
    • 0 Attachment
      > Thanks Yves
      >
      > I downloaded genefer.c and typed
      >
      > > cc genefer.c

      You should link with the mathematical library:

      cc genefer.c -lm

      and it is better to optimize the code:

      cc genefer.c -O -lm

      Yves
    • d.broadhurst@open.ac.uk
      ... That compiles, thanks! But it appears that the executable has problems on a DecAlpha. Yves and I hope that maybe Phil will fix these while he is reducing
      Message 2 of 6 , Jul 1, 2001
      • 0 Attachment
        Yves Gallot wrote:
        > cc genefer.c -O -lm
        That compiles, thanks!
        But it appears that the executable has problems
        on a DecAlpha. Yves and I hope that
        maybe Phil will fix these while he is
        reducing the number of lines in the code:-?
        David
      • Phil Carmody
        ... (Reading mail in reverse order, as always) David mentioned something about Alpha problems. #ifdef _MSC_VER typedef __int32 Int32; typedef unsigned __int32
        Message 3 of 6 , Jul 2, 2001
        • 0 Attachment
          On Sun, 01 July 2001, "Yves Gallot" wrote:
          > The C source code of "GeneFer" can be downloaded at
          > http://perso.wanadoo.fr/yves.gallot/primes/download.html
          > http://perso.wanadoo.fr/yves.gallot/primes/genefer.c

          (Reading mail in reverse order, as always)

          David mentioned something about Alpha problems.

          #ifdef _MSC_VER
          typedef __int32 Int32;
          typedef unsigned __int32 UInt32;
          typedef unsigned __int64 UInt64;
          #else
          typedef long Int32;
          typedef unsigned long UInt32;
          typedef unsigned long long UInt64;
          #endif


          If length is important, then all of the above types are 64bit on the alpha. Only int is 32 bits. Note also, however, that 64 bit is the native register size anyway, so the only reason you'd want to use 32 bits is for reducing memory footprints, 64bits often tends to be faster in some situations.
          I'll not get a chance to look at the code for a short while, but the above did appear to be one place that might be a problem point on the alpha.

          Phil

          Mathematics should not have to involve martyrdom;
          Support Eric Weisstein, see http://mathworld.wolfram.com
          Find the best deals on the web at AltaVista Shopping!
          http://www.shopping.altavista.com
        • Phil Carmody
          ... David, it appears that Yves has fixed the problem already, and again I ve cast my eye over the code, but not taken a compiler to it yet. Are you using ccc
          Message 4 of 6 , Jul 2, 2001
          • 0 Attachment
            On Sun, 01 July 2001, d.broadhurst@... wrote:
            > But it appears that the executable has problems
            > on a DecAlpha. Yves and I hope that
            > maybe Phil will fix these while he is
            > reducing the number of lines in the code:-?

            David, it appears that Yves has fixed the problem already, and again I've cast my eye over the code, but not taken a compiler to it yet. Are you using ccc (the compaq c compiler)? If so, can you crank up optimisations to the max (-O6 should do it) and run a profiler over it?
            I've seen a few things that might be slow in the alpha, but I can't tell which are most likely to be in vital areas. There is an address generation issue in the middle of the FFT/squares for example (array[a*b] type references, which probably require a multiply per memory access, which is a no-no on an Alpha).
            I don't mind having a peek at either optimising this (in a "won't harm other architectures" type way), or at least advising on simple expression rewrites that others might want to try out, if there's interest. However, I'm guessing that non-x86 is a minority thing, and that most people will run Proth.exe.

            Phil


            Mathematics should not have to involve martyrdom;
            Support Eric Weisstein, see http://mathworld.wolfram.com
            Find the best deals on the web at AltaVista Shopping!
            http://www.shopping.altavista.com
          Your message has been successfully submitted and would be delivered to recipients shortly.