Re: [eigen] Parallel matrix multiplication causes heap allocation |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: Re: [eigen] Parallel matrix multiplication causes heap allocation*From*: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>*Date*: Sun, 18 Dec 2016 23:46:57 +0100*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=kA7M8IECaKbfDB79oBjl2abb0LLs8FENcKhK2+Btn3k=; b=YgyycszZt3ivZIj2k+ZmQDWEzTzG3+VXGXZRpPMmPywMi3KUFuQJSjKzSF9gB46h5A u6EtfO74miLfStIFTKPFqt+PFOFa9qsHpHqkUpWgtrS4gjf/1eLKrISjQC72aNrZeWU8 Re03paIzjp22h5KmrY4YVwJ74Vg2wpY9dEQ5WougS6b/d46nzuf4NzFj+BElJvphq9+/ g+KlYE0rvaaXR5jm0/Ky76ptDJr0KDvtlvi3dP5X6aDhKuIWcGDzNyQ+hXgAPGm92giA HU5CS+BdBeb8YQSgJgslis0nXTzpf8Fmhl0Y1dtXXmaebVMSrnAtJWAjUOyNVmyg2Bys Al5w==

On Sun, Dec 18, 2016 at 11:15 PM, Jeff Hammond <jeff.science@xxxxxxxxx> wrote:

All good GEMM implementations copy into temporaries but they should not have to dynamically allocate them in every call.Some BLAS libraries allocate the buffer only once, during the first call. GotoBLAS used to do this. I don't know if OpenBLAS still does this, or in which cases.At one time, BLIS (cousin of OpenBLAS) used a static buffer that was part of the data segment, so malloc was not necessary to get the temporary buffers. I think it can dynamically allocate instead now but only once during the first call.

but what about multi-threading? (GEMM being called from multiple threads)

gael

JeffgaelFrançoisDear Eigen team,

first of all, thank you for all your effort to create such a great math library. I really love using it.

I’ve got a question about your parallelization routines. I want to calculate a parallel (omp based) matrix multiplication (result: 500 x 250 matrix) without allocating any new space in the meantime. So I have activated „Eigen::internal::set_is_malloc_allowed(false)“ to check that nothing goes wrong. However, my program crashes with the error message „Assertion failed: (is_malloc_allowed() && "heap allocation is forbidden (EIGEN_RUNTIME_NO_MALLOC is defined and g_is_malloc_allowed is false)"), function check_that_malloc_is_allowed, file /Users/xxx//libs/eigen/Eigen/s. Is this behaviour desired? Should there be an allocation before doing parallel calculations? Or am I doing something wrong?rc/Core/util/Memory.h, line 143.“

Thanks in advance.

Regards,

René AhlsdorfEigen Version: 3.3.1 (commit f562a193118d)Attached: Screenshot showing the last function calls<Screenshot 2016-12-18 01.01.42.png>

**Follow-Ups**:**Re: [eigen] Parallel matrix multiplication causes heap allocation***From:*Jeff Hammond

**References**:**[eigen] Parallel matrix multiplication causes heap allocation***From:*Rene Ahlsdorf

**Re: [eigen] Parallel matrix multiplication causes heap allocation***From:*François Fayard

**Re: [eigen] Parallel matrix multiplication causes heap allocation***From:*Gael Guennebaud

**Re: [eigen] Parallel matrix multiplication causes heap allocation***From:*Jeff Hammond

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Parallel matrix multiplication causes heap allocation** - Next by Date:
**Re: [eigen] Parallel matrix multiplication causes heap allocation** - Previous by thread:
**Re: [eigen] Parallel matrix multiplication causes heap allocation** - Next by thread:
**Re: [eigen] Parallel matrix multiplication causes heap allocation**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |