Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's another benchmark (on Linux, just type <code>make</code>): <a href="http://dl.dropbox.com/u/5453551/blas_call_benchmark.zip" rel="noreferrer">http://dl.dropbox.com/u/5453551/blas_call_benchmark.zip</a></p> <p><a href="http://dl.dropbox.com/u/5453551/blas_call_benchmark.png" rel="noreferrer">http://dl.dropbox.com/u/5453551/blas_call_benchmark.png</a></p> <p>I do not see essentially any difference between the different methods for large matrices, between Numpy, Ctypes and Fortran. (Fortran instead of C++ --- and if this matters, your benchmark is probably broken.)</p> <p><s> Your <code>CalcTime</code> function in C++ seems to have a sign error. <code>... + ((double)start.tv_usec))</code> should be instead <code>... - ((double)start.tv_usec))</code>.</s> Perhaps your benchmark also has other bugs, e.g., comparing between different BLAS libraries, or different BLAS settings such as number of threads, or between real time and CPU time?</p> <p><strong>EDIT</strong>: failed to count the braces in the <code>CalcTime</code> function -- it's OK.</p> <p>As a guideline: if you do a benchmark, please always post <em>all</em> the code somewhere. Commenting on benchmarks, especially when surprising, without having the full code is usually not productive.</p> <hr> <p>To find out which BLAS Numpy is linked against, do:</p> <pre> $ python Python 2.7.2+ (default, Aug 16 2011, 07:24:41) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy.core._dotblas >>> numpy.core._dotblas.__file__ '/usr/lib/pymodules/python2.7/numpy/core/_dotblas.so' >>> $ ldd /usr/lib/pymodules/python2.7/numpy/core/_dotblas.so linux-vdso.so.1 => (0x00007fff5ebff000) libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007fbe618b3000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbe61514000) </pre> <p><strong>UPDATE</strong>: If you <em>can't</em> import numpy.core._dotblas, your Numpy is using its internal fallback copy of BLAS, which is slower, and not meant to be used in performance computing! The reply from @Woltan below indicates that this is the explanation for the difference he/she sees in Numpy vs. Ctypes+BLAS.</p> <p>To fix the situation, you need either ATLAS or MKL --- check these instructions: <a href="http://scipy.org/Installing_SciPy/Linux" rel="noreferrer">http://scipy.org/Installing_SciPy/Linux</a> Most Linux distributions ship with ATLAS, so the best option is to install their <code>libatlas-dev</code> package (name may vary).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload