- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am working on a openmp enabled code . whenever I make a native run there is segmentation fault on MIC but code runs fine on XEON .
Arrays are 64 byte aligned and using #pragma vector aligned in a for loop interestingly this pragma causes seg fault .
Removing the pragma resolves the problem but want to know why is it happening ,I an also using __assume_aligned inside function containg the for loop and memory is allocated using _mm_malloc .
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're probably aware of the idz article on segfaults in general and that the most common MIC causes are low stack limit or too many threads.
http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors
several of the sections apply equally well to c or c++.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had already gone through it but the problem retained. Also this problem is a combination of restrict keyword for pointers in function along with
#pragma vector aligned . Eliminating any one of them resolves the issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply
I worked out as you suggested by removing the pragma vector aligned and going through the vec report . Vec report suggests that all the refrences inside that particular loop are somehow now unaligned .
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has unaligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has unaligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has unaligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has unaligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has unaligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has unaligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has unaligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: reference (unknown) has aligned access
FD_Scheme_block.c(148): (col. 10) remark: vectorization support: unaligned access used inside loop body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler must assume unaligned where it doesn't have information to the contrary. I don't know whether adding debug symbols would help to resolve the (unknown) notations. The compiler can align one reference by peeling the loop for alignment, probably so that a stored array section is aligned (unless you set #pragma vector unaligned).
If you believe the arrays are aligned, you could add __assume aligned() assertions one at a time to find out which one is failing alignment at run time.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page