Documentation didn't tell if element-wise operations are parallel.

Issue #123 resolved
rxu2 created an issue

If I compile the program with OpenMP enabled, will the element-wise operations (such as log2) be automagically parallel? Or I have to parallelize these operations on my own?

The page at https://bitbucket.org/blaze-lib/blaze/wiki/Vector%20Operations#!log-log2-log10 but that didn't mention this.

It would be nice if the documentation add a sentence about this. (Was I just looking at the wrong place?)

Comments (7)

  1. Klaus Iglberger

    Hi!

    Thanks a lot for pointing out this imperfection. You are correct, we don't explicitly mention this detail at this point of the documentation. We will update both the tutorial and wiki accordingly.

    The good news for you is that all componentwise operations are parallelized. The only two conditions are that parallelization is enabled and that vectors are larger than BLAZE_SMP_DVECASSIGN_THRESHOLD (see the <blaze/config/Thresholds.h> header file).

    Thanks again, we will improve the documentation as quickly as possible.

    Best regards,

    Klaus!

  2. rxu2 reporter

    Will the following do the operation in place without creating any intermediate array or copying any array? It would be nice if the home page would have a link to a page the describes the "smart expression template" that talk about this. But I can't quite find that.

    blaze::StaticVector<double,3UL> a, b, c;
    
    a = log(a);    // Find natural logarithm of each element
    b = log(a - b); // any intermediate for a - b or log(a - b)?
    c = log(a - a); // what if the array has zeros?
    

    Another thing is that when I look at the benchmark page (after i click the link at the home page), the first sentence of the page didn't mention the date of the benchmark.

    I scrolled to the end of the page, and found the modification date, and then I click history to find out exactly what is changed. After that I found when is the benchmark performed. Not sure if most people would do that.

  3. Klaus Iglberger

    Hi!

    The paper explaining the details about smart expression templates is listed in the "Publications" section on the homepage. You can download it here.

    All operations in your example will not create any intermediate vectors, but will evaluate the expressions componentwise. Given that you have the SVML, all expression will also be vectorized.

    The benchmarks were done with Blaze 3.0. We will add this information to the page, thanks for pointing this out.

    Best regards,

    Klaus!

  4. rxu2 reporter

    That is nice. Has anyone written any python binding to blaze lib? If not, I guess I will write some for the few blaze function that I will use.

    Thanks for answering my questions.

  5. Klaus Iglberger

    We have updated the tutorial to clearly state that all arithmetic operations on dense vectors and matrices (including additions, subtractions, multiplications, divisions and all componentwise arithmetic operations) and most operations on sparse vectors and matrices can be performed in parallel. The updated tutorial is immediately available via cloning the Blaze repository. The wiki will be updated with the official release of Blaze 3.2.

  6. Log in to comment