Open dbeurle opened 5 years ago
I ran the same test and got some interesting results. The voigt_contraction
requires only two thirds the time to run tensor_contraction
.
2019-01-20 17:19:02
Running ./a.out
Run on (8 X 4000 MHz CPU s)
CPU Caches:
L1 Data 32K (x4)
L1 Instruction 32K (x4)
L2 Unified 256K (x4)
L3 Unified 8192K (x1)
Load Average: 0.85, 1.13, 1.08
------------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
------------------------------------------------------------------------------
tensor_contraction 29366 ns 29314 ns 21955 norms=21.955k
voigt_contraction 20264 ns 20232 ns 34895 norms=34.895k
Okay your results make more sense. I'll test on my workstation as well when I get home.
Are you considering that Mandel notation consists in representing 2nd order tensors as 3×3 matrices? As far as I know, Mandel notation expresses also 2nd order tensors in vector form, but in the following form: T{ij} = T{ji} → [T{11} T{22} T{33} \sqrt{2}T{23} \sqrt{2}T{13} \sqrt{2}T{12}]^t
You seem not clear what you are considering Mandel notation. Can you clarify what are you considering Mandel notation?
We current store second order tensors as 3x3 matrices, regardless of symmetric considerations. Some memory (or theoretically computation) reduction can be achieved from using Voigt or Mandel notation.
Some data on a conversion:
Benchmark code
Provided by the code:
and