[Bug report] BLAS : Bad memory unallocation!

1 month 2 weeks ago #2718 by Guosheng Fu
Hello,

I encountered the following bug:
I use a div-conforming HDG to solve the vector-Poisson equation. (see attached code)
When using a high-order version (order >= 8), the assembly of stiffness matrix using TaskManager() give me an error message
with TaskManager():
    a.Assemble()
...
>> BLAS : Bad memory unallocation! 
And the returned results are incorrect.

(1) This bug is not observed for lower order HDG cases (order <8), or other high order methods like VectorH1 space. (When condensation is turned off, the bug is also not observed)
(2) This bug is not observed when TaskManager is turned off.
(3) TaskManager is also not compatible with DG stiffness matrices.

I am using NGSolve-6.2.2004-128-gc8324807

Best,
Guosheng
Attachments:

Please Log in or Create an account to join the conversation.

1 month 2 weeks ago #2719 by matthiash
Hi Guosheng,

This error seems to come from openblas ( just found this: github.com/xianyi/OpenBLAS/issues/1882 )

How many threads are you running?
Does it run if you set the environment variable NGS_NUM_THREADS to 1? If so, what's the maximum number without errors?

Did you compile the version yourself or are you using the Ubuntu nightly build?

Best,
Matthias

Please Log in or Create an account to join the conversation.

1 month 2 weeks ago #2721 by Guosheng Fu
Hi Matthias,

I compile the code myself. The machine has 8 dual cores. The blacs/lapack library was found within intel MKL.

With 4 threads, the code runs without error.
With 8 threads, the code runs without error most of time, but occasionally (roughly 1 out of 6 runs) it produces the bug.

Best,
Guosheng

Please Log in or Create an account to join the conversation.

1 month 2 weeks ago #2742 by matthiash
I cannot reproduces the issue with a 8x2 core machine (also linking with Intel MKL).

Did you set MKL_THREADING_LAYER (either "gnu", "intel" or "sequential") or MKL_NUM_THREADS? Try different settings and check, if it makes any difference. If MKL_NUM_THREADS=1 is not working either, I guess the error message is from another blas library.

To check your build settings, please attach my_build_dir/CMakeLists.txt and my_build_dir/ngsolve/CMakeLists.txt and the output of
ldd `which ngs`

Best,
Matthias

Please Log in or Create an account to join the conversation.

© 2019 Netgen/NGSolve