Community
cancel
Showing results for 
Search instead for 
Did you mean: 
nazgob
Beginner
75 Views

Fast coordinates calculations

Hello,
I'm pretty new to HPC, SSE technlogy etc so forgive me easy question.
I'm developing an application for a fast simulation in magnetism. I use very large array(implemented as vector from stl) to store index of every atom. My array is 1D so when i need xyz coordinates of a certain atom I need to calculate it(i know the dimensions of a "cube"). Functions responisble for that are main issiue in my program performance.


It's sth like this(for 2D model), index is an input:
(*ptrDANE_2D).y = index * (*ptrD2);
(*ptrDANE_2D).x = index & (*ptrD3);


Can you give me any suggetions what I can do with that? Should I use SSE? Or maybe there is some HPC lib with such functions?
Thank you in advance.


I use Visual Studio 2005 compiler for C++ coding and my target platform is Pentium4 HT.
0 Kudos
2 Replies
Intel_C_Intel
Employee
75 Views

Hello.

There are so many different ways to achieve good performance of large 1D arrays, so my advise is just one of many, many possible solutions. About one year agowe investigated the various options for efficient arrays in C/C++, and we found that the efficiency obtained was depentent on compiler and compiler version, for exampleSTL arrays may be more efficient with later versions of the compiler. The workaround to this is to use ordinary C-arraysin the most timeconsuming parts of your code. Compile using -xN -O2 or -xN -O3to obtain good SSE2 code.

Hope this works,

Lars Petter Endresen

nazgob
Beginner
75 Views

Hello,
Thank you for your answer. I'm pretty sure that I use most efficient tools and compiler flag I can. My question was more about what to do with calculation algorithm. I believe it's a common problem in 3D models or even 3D graphics. Thanks to VTune I know that this function needs improvment.
Reply