Reduction of CPU time with SIMD option

28 views
Skip to first unread message

Camille Chauvigné

unread,
Aug 3, 2022, 4:27:49 AM8/3/22
to ProjectChrono
Hello,

We recently updated our FRyDoM application, which used Chrono v4 to the latest release version of Chrono v7.0.3, which includes notably Eigen. However, we encounter misalignment errors at the run time when SIMD option is activated (SSE/AVX/FMA). These errors disappear when SIMD option is disabled. We have therefore deactivated this option for the moment although this prevents us from reducing the computation time. Before to adapt the code, we wondered what was the CPU time reduction we can expect with the SIMD option in Chrono ? Besides, does this option is limited to some solvers or models ?

Thank you in advance

Best regards,

Camille

Dario Mangoni

unread,
Aug 3, 2022, 4:37:48 AM8/3/22
to ProjectChrono
Hi Camille,
I'm not sure if it is the same issue I encountered, but might be worth you to just briefly visit this issue: https://github.com/projectchrono/chrono/issues/290

In my case the Eigen::SparseLU solver was having issue, at the point that solutions themselves were off and it was due to misalignment issues.
Not sure if it's the same, just FYI.

Might be useful for us to know for which solver setup you are observing such issues!

Dario

Camille Chauvigné

unread,
Aug 3, 2022, 7:57:54 AM8/3/22
to ProjectChrono
Hello Dario,

Thank you for your reply, we don't use Eigen::SparseLU solver but chrono::MINRES solver (and also chrono::APGD) with smooth contact and  Euler Implicit Linearized time stepper. With this configuration, the chrono demos we tested, like demo_FEA_dynamics, work fine. The errors we encounter is only when we run demos with new objects (classes) derived from Chrono (in the FRyDoM API).

Maybe this error is linked to the EIGEN_MAKE_ALIGNED_OPERATOR_NEW method that we don't define as a public method in all our classes ? Related to this issue : https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html.

 We are wondering if the CPU time saving provided by the SIMD option is limited to certain solvers or application cases only, in order to know if we should use it.

Radu Serban

unread,
Aug 3, 2022, 9:09:03 AM8/3/22
to ProjectChrono

Camille,

 

It is likely that the issues you are seeing are due to misaligned memory in your classes/structures if they happen to have members that are fixed-size Eigen types (such as ChMatrixNM, ChMatrix33, ChVectorN, etc).  You must include the macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW in such classes (as we do everywhere relevant in Chrono; see for example ChFrame.h).

 

Currently, Chrono relies on SIMD acceleration only through Eigen.  So, it is a bit difficult to point exactly which solvers in Chrono benefit most from this.   But with heavy and judicious use of Eigen (as is done in some parts of Chrono, e.g., the new ANCF element implementations), you can and will see efficiency improvements.

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/e592d49b-d369-440b-b0e0-90f2efc7d3a2n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages