Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7875 Discussions

OMP: Error #13: Assertion failure at kmp_atomic.cpp(3935).

Doron
Beginner
1,125 Views

I am compiling a C++ program on Fedora 34 with MKL 2022.0.2.

In the code I have an std::atomic class member to manage access to my custom class object.

When I try to access the object I get the SIGABRT with the above message printed to the console.

What am I doing wrong?

0 Kudos
12 Replies
VarshaS_Intel
Moderator
1,079 Views

Hi,


Thanks for posting in Intel Communities.


Could you please provide us with the sample reproducer code along with the steps to reproduce the issue?


And also, could you please let us know the C++ compiler you are using(Intel Classic compiler(icpc)/LLVM compiler(icpx)) ?


Thanks & Regards,

Varsha


0 Kudos
Doron
Beginner
1,068 Views

Hi Varsha

I am using: gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2).

The project uses cmake with: set(CMAKE_CXX_STANDARD 17)

 The attached project reproduces the problem with a small subset of the code.

Let me know if you need any additional information.

0 Kudos
VarshaS_Intel
Moderator
1,016 Views

Hi,


We are working on your issue. We will get back to you soon.


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
949 Views

Hi,


Apologies for the delay in my response.


Could you please provide us with a complete sample reproducer since we did not find any MKL function usage, in order to find the root cause of the error?


Thanks & Regards,

Varsha


0 Kudos
Doron
Beginner
919 Views

Hi Varsha

 

Have you been able to compile and run the test project I shared? I am not sure how it is related to MKL, but when I run it I get the following message:

OMP: Error #13: Assertion failure at kmp_atomic.cpp(3935).
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.
Aborted (core dumped)

If compile the same code without linking with MKL, I get the following:

/usr/bin/ld: CMakeFiles/test.dir/main.cxx.o: in function `main':
main.cxx:(.text.startup+0x1d): undefined reference to `__atomic_load'

It seems like MKL provides the implementation to atomic load.

 

Hope this helps

Doron

0 Kudos
VarshaS_Intel
Moderator
867 Views

Hi,


>>I am using: gcc (GCC) 11.3.1 20220421

Could you please try using the Intel Compilers(icc,icx,icpx) and let us know what errors you are facing?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
836 Views

Hi,


We have not heard back from you. Could you please provide us with an update?


Thanks & Regards,

Varsha


0 Kudos
Doron
Beginner
826 Views

Hi Varsha

 

I don't have the Intel compiler installed.

Did you try to compile the project I sent?

 

Cheers

Doron

0 Kudos
VarshaS_Intel
Moderator
645 Views

Hi,

 

>>Did you try to compile the project I sent?

Yes, we have tried the project you had send to us. But with the Intel ICC compiler, we are facing different errors related to the code issue.

 

Please find the below screenshot where we are getting the error:

VarshaS_Intel_0-1671445633578.png

 

We don't see a default constructor for Matrix4x4 defined. The declaration

 

std::atomic<Matrix4x4> _data;

 

defines _data as a trivially copyable object but it's a complex data type without a default constructor defined. For example, is the intent here (in main.cxx) to define this object as Matrix4x4 of strings or Vector3D objects defined in Matrix4x4.h or doubles as some of the provided constructors may suggest?

 

Basically, the operations std::atomic are available on trivially copyable types but beyond that, the std::<atomic> requires more careful design.

 

Could you please provide us with a valid test case?

 

Thanks & Regards,

Varsha

 

0 Kudos
VarshaS_Intel
Moderator
604 Views

Hi,


We have not heard back from you. Could you please provide us with a valid test case?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
551 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks & Regards,

Varsha


0 Kudos
Doron
Beginner
531 Views

Hi Varsha

 

Sorry for the late replay and happy new year.

Based on your feedback I did some testing and as you mentioned the Matrix4x4 doesn't meet the requirements to be used as the template type for atomic.

I am not sure why GCC doesn't issue a compile time error, but it's definitely not an MKL issue.

Feel free to close this issue.

 

Thanks for the support

Doron

0 Kudos
Reply