This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

tabulate_tensor() slow

+2 votes

When profiling my code, I noticed that a lot of time is spent the tabulate_tensor(...) calls in ./dolfin/fem/Assembler.cpp::assemble_cells(...). Is that a function produced by FFC? What could I do to get further down to the cause of this bottle neck?

asked Dec 12, 2013 by nschloe FEniCS User (7,120 points)

1 Answer

+3 votes
 
Best answer

This is the code that is generated by FFC.

You can try set some ffc related parameters. Try them in random order and see what makes the most difference.

parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["optimize"] = True
parameters["form_compiler"]["cpp_optimize_flags"] = "-O3 --fast-math" if you_dare else "-O3"
parameters["form_compiler"]["quadrature_degree"] = 2

If you have uflacs installed you can also try:

parameters["form_compiler"]["representation"] = "uflacs"
answered Dec 12, 2013 by johanhake FEniCS Expert (22,480 points)
selected Dec 12, 2013 by nschloe

This helped me finding out that it is the quadrature degree that is killing performance here. I'll go and find out why FEniCS thinks it needs such a high quadrature degree and fix the cause for it.

...