Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

matmul() thread safe?

dnoack
Beginner
909 Views
Hello,

I have some trouble with the intrinsic function matmul() in case of parallel prcessing using threads. I use ifort 10.1.021 .

If I run the program sequentially with 1 tread, it works fine.

If I use more than 1 threads it crashes with different errors, e.g.:

Generating Traceback ...
Using host libthread_db library "/lib64/tls/libthread_db.so.1".
Program terminated with signal 11, Segmentation fault.
#0 0x0000002aa0bf8e1c in pthread_mutex_lock () from /lib64/tls/libpthread.so.0
#0 0x0000002aa0bf8e1c in pthread_mutex_lock () from /lib64/tls/libpthread.so.0
#1 0x0000002a9fe16a1e in thr_Mutex::Lock ()
...

I have the suspicion that this lies on matmul() and have overloaded the intrinsic function with an own function and this works also fine. So I think the reason of the problem is the intrinsic matmul().

I am aware, that the intrinsic matmul() is highly optimized and my own function is rather poor. Since my program were used in the field of scientific calculations, I have to pay attention to the cpu-time.

This arises the following questions:
1. Have anyone also problems with the threadsafeness of matmul()?
2. Is there an workaround that not significantly degrade the performance?

Best regards
dieter
0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
909 Views
Your program may require larger stack size. See environment variable KMP_STACKSIZE. This sets the stack size for the additional threads, There is also a linkeroption to set the stack size of the application's main thread.

Jim Dempsey
0 Kudos
Reply