Page 11 of 13 FirstFirst ... 910111213 LastLast
Results 101 to 110 of 124

Thread: Executable running slower on opensuse 12.3

  1. #101
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    26

    Default Re: Executable running slower on opensuse 12.3

    Quote Originally Posted by robin_listas View Post
    On 2013-04-09 22:16, a jaeger wrote:

    > There's no package available yet, you can download and compile from the
    > glibc git repository ('GlibcGit - glibc wiki'
    > (GlibcGit - glibc wiki)). I expect that openSUSE
    > 13.1 will have the next glibc release in it - and openSUSE factory will
    > get it once its released (this summer).


    Any chance of patching and backporting libm? As an experimental patch,
    perhaps. :-?

    If not, the people using math intensive apps will have to stay using oS
    12.2 and wait for 13.1.

    There are lots of smaller patches for these functions, there's not a single fix. Let's see what's possible...

    Btw. if you really want the speed and less precision, try using floats.


    > There might still be some slowdown for certain inputs since glibc's
    > software routines are used instead of the inaccurate sin x87 instruction
    > - just less dramatic as the numbers above show. But you'll get better
    > precision

    You mean that some of the hardware cpu math instructions are inaccurate,
    and thus we have to use again software implementations, as we did 20
    years ago before the math coprocesor was invented? That's a shame :-(
    Yes, exactly. The Intel manual explains these limitations on sine and cosine.
    Andreas Jaeger
    aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
    SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
    GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer, HRB 16746 (AG Nuernberg)

  2. #102

    Default Re: Executable running slower on opensuse 12.3

    On 2013-04-10, a jaeger <a_jaeger@no-mx.forums.opensuse.org> wrote:
    > Yes, exactly. The Intel manual explains these limitations on sine and
    > cosine.


    Thanks for the explanation for the slow-down. IIRC however Intel's sin/cosine instructions are valid for the range of
    about ~-2^60->2^60 radians (or thereabouts). I don't know if they use Mary Payne and Robert Hanek's method, but if the
    range for accurate calculation is indeed so generous (certainly within the range for regular scientific use), then would
    it not make sense to provide to provide fast hard-coded versions for trignometric routines e.g.

    Code:
    double fcos(double angle);
    double fsin(double angle);
    .... giving the programmer the choice of which routine to use?


  3. #103
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    26

    Default Re: Executable running slower on opensuse 12.3

    Quote Originally Posted by flymail View Post
    On 2013-04-10, a jaeger <a_jaeger@no-mx.forums.opensuse.org> wrote:
    > Yes, exactly. The Intel manual explains these limitations on sine and
    > cosine.


    Thanks for the explanation for the slow-down. IIRC however Intel's sin/cosine instructions are valid for the range of
    about ~-2^60->2^60 radians (or thereabouts). I don't know if they use Mary Payne and Robert Hanek's method, but if the
    range for accurate calculation is indeed so generous (certainly within the range for regular scientific use), then would
    it not make sense to provide to provide fast hard-coded versions for trignometric routines e.g.

    Code:
    double fcos(double angle);
    double fsin(double angle);
    .... giving the programmer the choice of which routine to use?
    Sure, compile with -ffast-math. That way gcc is allowed to use fsin/fcos hardware instructions directly (but might not do it). If any of you are interested in improving
    the glibc implementation of glibc, the glibc developers are always looking for contributions and I'm happy to guide you.
    Andreas Jaeger
    aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
    SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
    GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer, HRB 16746 (AG Nuernberg)

  4. #104

    Default Re: Executable running slower on opensuse 12.3

    On 2013-04-10, a jaeger <a_jaeger@no-mx.forums.opensuse.org> wrote:
    > Sure, compile with -ffast-math. That way gcc is allowed to use
    > fsin/fcos hardware instructions directly (but might not do it).


    Thanks Andreas. Elegant solution (gcc-permitting!).

    > If any
    > of you are interested in improving
    > the glibc implementation of glibc, the glibc developers are always
    > looking for contributions and I'm happy to guide you.


    Thanks although I'm not sure precisely what the `glibc implementation of glibc' is . Would gladly volunteer but my
    assembler instruction knowledge is limited to ia32/64 architectures and I believe the noble intent of the glibc
    project is architecture ambivalence.

  5. #105

    Default Re: Executable running slower on opensuse 12.3

    On 2013-04-10, a jaeger <a_jaeger@no-mx.forums.opensuse.org> wrote:
    > Sure, compile with -ffast-math. That way gcc is allowed to use
    > fsin/fcos hardware instructions directly (but might not do it).



    .... still a good idea: but I tested it on the sample code and can confirm that while gcc might be allowed to use it, it
    chose not to!

  6. #106

    Default Version from glibc git repository still slow

    I compiled source files from glibc git repository, obtained libm.so.6, and used it to run my large programs that do computation.

    The math library version from glibc git is still slow compared to the one from opensuse 12.2, approximately 1.9 times. (Version from opensuse 12.3 is slower about 2 - 2.5 times, and much worse in a 32 bit computer).

    I will continue to use the libm-2.15.so from opensuse 12.2.

    There was no such problem over years going from version to version of opensuse. Now I wonder whether opensuse 12.2 would be the quickest version, math-wise, ever released?

  7. #107
    Join Date
    Aug 2012
    Location
    Austin, TX
    Posts
    77

    Default Re: Executable running slower on opensuse 12.3

    I think I'm having a similar problem related to this. The same Python + Cython code runs 2+ times slower in openSUSE 12.3 than Windows 8. The Cython code uses gsl functions such as gsl_cdf_ugaussian_P, gsl_cdf_ugaussian_Pinv, gsl_cdf_gaussian_P in loop intensive routine.

    After reading this thread, I copied over libm-2.15.so from openSUSE 12.2 and made a symlink in /lib64 directory. But the execution speed of my code is invariant. The test code in this thread does show 2X speedup when I use libm-2.15.so than libm-2.17.so. So I wonder why my code does not get the speedup? Is there something else I need to do when I use gsl? Any help will be greatly appreciated!

    Best,
    Joon

  8. #108
    Join Date
    Aug 2012
    Location
    Austin, TX
    Posts
    77

    Default Re: Executable running slower on opensuse 12.3

    Oh wait, it seems I'm using bunch of other functions from libm as well:

    Code:
    from libc.math cimport exp, log, log1p, sqrt, fabs, fmin, fmax, cos

  9. #109

    Default Re: Executable running slower on opensuse 12.3

    On 2013-06-06, joonro <joonro@no-mx.forums.opensuse.org> wrote:
    >
    > I think I'm having a similar problem related to this. The same Python +
    > Cython code runs 2+ times slower in openSUSE 12.3 than Windows 8.


    If you are using Python to perform numerical calculations, you have the advantage of easily importing the numerical
    Python module (numpy), which performs substantially faster than equivalent native Python code. The numpy module uses the
    LAPACK/BLAS library rather than libm and this this is highly optimised for both ia32/ia64 archictectures especially for
    array operations. For Windows AFAIK (which isn't very far), numpy 64-bit support is not available or at least very
    flaky, so I would expect better performance in a 64-bit Linux environment.

    If you use the fast Fourier transform (a lot), for which numpy uses FFTPACK rather than the faster FFTW (for licensing
    reasons), you may want use the Python bindings available for FFTW. Although I code extensively in IA32/IA64 asm, C/C++,
    as well as Python, I confess I don't know Cython so I can't help you identify the source of slow-downs in your code. But
    if you post it, I can at least try.

  10. #110
    Join Date
    Aug 2012
    Location
    Austin, TX
    Posts
    77

    Default Re: Executable running slower on opensuse 12.3

    Quote Originally Posted by flymail View Post
    On 2013-06-06, joonro wrote:[color=blue] If you are using Python to perform numerical calculations, you have the advantage of easily importing the numerical Python module (numpy), which performs substantially faster than equivalent native Python code.
    Thanks for the reply. My code is very loop intensive and it is infeasible to vectorize. (The reason why I'm using Cython in the first place). Maybe I will be able to find out which function is causing the problem by trying out some toy code. -Joon

Page 11 of 13 FirstFirst ... 910111213 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •