Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

Efficient storage of 3D field data

$
0
0

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

Thread Topic: 

How-To

Viewing all articles
Browse latest Browse all 3005


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>