Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Efficient storage of 3D field data

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

Sebastian_U_1

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-29-2016
03:51 AM

44 Views

Efficient storage of 3D field data

Hi,

in working on a numerical code, which solves a discretised equation on a three dimensional grid. I have multiple fields (around 80) I need to save on this grid and which are needed to compute my results. I want to perform my computations (which consist of rather simple operations (as product / dot product) to set up a sparse matrix and solve this matrix using MKL. My questions are:

1) What ist the most efficient way to store the data? Using a 1D array or a multidimensional array? At the moment I'm using a 1D array and accessing it in my innermost loop using

for kk... for jj... for ii... for (int k = 0 ; k < 8 l k++){ for (int j = 0 ; j < 8 ; j++){ for (int i = 0 ; i < 8 ; i++){ field1[offset + i] += field2[offset + i] }}} }}}

in order to get good spacial and temporal data locality. The data is aligned in such a way, that offset is always a multiple of 8. To do so - as far as I understood - my data should be aligned to a 64 byte boundary. Since I have many blocks consisting of ni x nj x nk cells, this alignment leads to a quite high overhead (the factor between aligned and unaligned data is between 1.5 and 2). Is there a more efficient way to store my data?

Thanks,

Sebastian

Link Copied

2 Replies

Anoop_M_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016
11:42 AM

44 Views

Hi Sebastian,

I have redirected this thread to MKL forum who can help with the best data layout for using MKL routines.

Thanks and Regards

Anoop

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016
11:50 PM

44 Views

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

For more complete information about compiler optimizations, see our Optimization Notice.