On 17 Mar 2019, at 12:20, Miklós Homolya <miklos.homolya@tum.de> wrote:
An improved version of the logging idea would be this:
Stay silent for the first, say, few hundred to a thousand invocations of compiling generated code, but then start emitting visible warnings at each invocation. The message of the warning would warn for the potential issue of generating code in each time stepping iteration, and would reference the corresponding FAQ entry of the documentation, which would describe how to verify if that is the case, how to fix the problem, or to configure the number of swallowed invocations (for very complex models), or even to disable these warnings completely (not recommended).
Miklós Homolya <miklos.homolya@tum.de> writes:
Arguably one could let some logging through when just-in-time compilation happens, although that typically evokes the wrong reaction from users: "firedrake keeps printing all this crap! how to disable it?"
I find it a pretty aggressive move to convert all floats to Constants, since it easily leads to a perfusion of kernel arguments. Though, it may still be the safest default behaviour, but I think one should at least be able to disable it.
Stephan Kramer <s.kramer@imperial.ac.uk> writes:
I understand this is how it currently works, but this is an easy "mistake" to make especially in a complex model with lots of forcing terms. Would it not be possible to always treat a float as a parameter in the form, i.e. don't include the value of the float in the hash for the compiled code, and substitute the right value at run-time? The form itself based on a specific float, could still be treated as immutable everywhere else in firedrake. Admittedly, I have no idea how easy it is to do this
I had a go at making literal-value -> Constant at form creation time. This didn't work well. I suppose one could instead rewrite inside the form_compiler interface (when you actually need the code). I like (additionally) Miklós' idea of logging in some increasingly loud manner. Lawrence