<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 05/12/2012 04:00 PM, Matthieu Brucher wrote:
    <blockquote
cite="mid:CAHCaCkLzqE_GbKRo4qLwSDtax+oZtnadWA4AkMC9NBVQ7QGv3Q@mail.gmail.com"
      type="cite">Does ACML now provide a CBLAS interface?
      <div><br>
      </div>
      <div>Matthieu<br>
      </div>
    </blockquote>
    <br>
    D'oh!<br>
    <br>
    Very good point, I wasn't aware that numpy needed a CLBAS interface.
    I now followed the steps outlined at the end of 
    <a class="moz-txt-link-freetext" href="http://mail.scipy.org/pipermail/numpy-discussion/2006-February/018379.html">http://mail.scipy.org/pipermail/numpy-discussion/2006-February/018379.html</a> 
    (Basically: I built a libcblas.a for ACML, then tried to build numpy
    with that).<br>
    <br>
    However it didn't seem to work. The same 5000x5000 matrix-multiply
    is still spinning at 100% CPU usage. I attached to the process after
    I let it run for over 3 minutes, and the stacktrace looked like
    this:<br>
    <br>
    #0  DOUBLE_dot (ip1=<optimized out>, is1=8, ip2=<br>
        [...gibberish...], is2=40000, op=0x7f8633086000 "", <br>
        n=5000, __NPY_UNUSED_TAGGEDignore=0x23f40f0) at
    numpy/core/src/multiarray/arraytypes.c.src:3077<br>
    #1  0x00007f864dea1466 in PyArray_MatrixProduct2 (op1=<optimized
    out>, op2=<optimized out>, out=<optimized out>)<br>
        at numpy/core/src/multiarray/multiarraymodule.c:847<br>
    #2  0x00007f864dea18ed in array_matrixproduct
    (__NPY_UNUSED_TAGGEDdummy=<optimized out>, args=<optimized
    out>, <br>
        kwds=<optimized out>) at
    numpy/core/src/multiarray/multiarraymodule.c:2025<br>
    #3  0x000000000042a485 in PyEval_EvalFrameEx ()<br>
    #4  0x00000000004317f2 in PyEval_EvalCodeEx ()<br>
    #5  0x000000000054bd50 in PyRun_InteractiveOneFlags ()<br>
    #6  0x000000000054c045 in PyRun_InteractiveLoopFlags ()<br>
    #7  0x000000000054ce9f in Py_Main ()<br>
    #8  0x00007f864ec7976d in __libc_start_main () from
    /lib/x86_64-linux-gnu/libc.so.6<br>
    #9  0x000000000041b931 in _start ()<br>
    <br>
    <br>
    So either the process needed changed since that message was written
    in 2006, or I did something wrong (I am absolutely unfamiliar with
    the build-system used by numpy) or missed something :(<br>
    <br>
    <br>
    <br>
    Thomas<br>
    <br>
    <br>
    <blockquote
cite="mid:CAHCaCkLzqE_GbKRo4qLwSDtax+oZtnadWA4AkMC9NBVQ7QGv3Q@mail.gmail.com"
      type="cite">
      <div><br>
        <div class="gmail_quote">2012/5/12 Thomas Unterthiner <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:thomas_unterthiner@web.de" target="_blank">thomas_unterthiner@web.de</a>></span><br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div class="im"><br>
              On 05/12/2012 03:27 PM, <a moz-do-not-send="true"
                href="mailto:numpy-discussion-request@scipy.org">numpy-discussion-request@scipy.org</a>
              wrote:<br>
              > 12.05.2012 00:54, Thomas Unterthiner kirjoitti:<br>
              > [clip]<br>
              >> >  The process will have 100% CPU usage and
              will not show any activity<br>
              >> >  under strace. A gdb backtrace looks as
              follows:<br>
              >> ><br>
              >> >  (gdb) bt<br>
              >> >  #0  0x00007fdcc000e524 in ?? ()<br>
              >> >       from
              /usr/lib/python2.7/dist-packages/numpy/core/multiarray.so<br>
              > [clip]<br>
              ><br>
              > The backtrace looks like it does not use ACML. Does<br>
              ><br>
              >       from numpy.core._dotblas import dot<br>
              ><br>
              > work?<br>
              ><br>
              <br>
            </div>
            Thanks for having a look at this.  The following was tried
            with the<br>
            numpy that comes from the Ubuntu repo and symlinked ACML:<br>
            <br>
            <br>
            $ python<br>
            Python 2.7.3 (default, Apr 20 2012, 22:39:59)<br>
            [GCC 4.6.3] on linux2<br>
            Type "help", "copyright", "credits" or "license" for more
            information.<br>
             >>> from numpy.core._dotblas import dot<br>
            Traceback (most recent call last):<br>
              File "<stdin>", line 1, in <module><br>
            ImportError:
            /usr/lib/python2.7/dist-packages/numpy/core/_dotblas.so:<br>
            undefined symbol: cblas_cdotc_sub<br>
             >>><br>
            <br>
            <br>
            Following up:<br>
            <br>
            $ ldd
            /usr/lib/python2.7/dist-packages/numpy/core/_dotblas.so<br>
                linux-vdso.so.1 =>  (0x00007fff3de00000)<br>
                libblas.so.3gf => /usr/lib/libblas.so.3gf
            (0x00007f10965f8000)<br>
                libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
            (0x00007f1096238000)<br>
                librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
            (0x00007f1096030000)<br>
                libgfortran.so.3 =>
            /usr/lib/x86_64-linux-gnu/libgfortran.so.3<br>
            (0x00007f1095d18000)<br>
                libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
            (0x00007f1095a18000)<br>
                /lib64/ld-linux-x86-64.so.2 (0x00007f1098a88000)<br>
                libpthread.so.0 =>
            /lib/x86_64-linux-gnu/libpthread.so.0<br>
            (0x00007f10957f8000)<br>
                libquadmath.so.0 =>
            /usr/lib/x86_64-linux-gnu/libquadmath.so.0<br>
            (0x00007f10955c0000)<br>
            $ ls -lh /usr/lib/libblas.so.3gf<br>
            lrwxrwxrwx 1 root root 32 May 11 22:27
            /usr/lib/libblas.so.3gf -><br>
            /etc/alternatives/libblas.so.3gf<br>
            $ ls -lh  /etc/alternatives/libblas.so.3gf<br>
            lrwxrwxrwx 1 root root 45 May 11 22:36
            /etc/alternatives/libblas.so.3gf<br>
            -> /opt/acml5.1.0/gfortran64_fma4/lib/libacml.so<br>
            <br>
            <br>
            <br>
            Cheers<br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>