Phalanx: turn PHX_ALLOW_MULTIPLE_EVALUATORS_FOR_SAME_FIELD off by default
Created by: bartgol
@trilinos/Phalanx
Expectations
I think more likely than not one wants to see an error if two evaluators evaluate the same field. I am ok with keeping the feature (CMakeLists.txt explain it is for backward compatibility), but should not be the default. It is more costly to debug an app that wrongly has two evaluators evaluating the same field, than it is for another app to add the configure option to allow this. The former, can take hours of debugging (I did this mistake twice); the latter takes one failed run (with meaningful error message) to adjust the installation.
Current Behavior
The flag is on by default, so PHX allows multiple evaluators to evaluate the same field, in which case, the first is used, and the others tossed. If one does not want this feature, the option must be explicitly turned off at configure time.
Note: this option was introduced in 2015, and left ON by default for bwd compatibility in existing codes. I believe 3 years is a reasonable time for codes to either adapt, or add a config option to their trilinos configuration.
Motivation and Context
It is not unlikely to fall in the scenario where 2 evaluators evaluate the same field. Perhaps you used to have OldEvaluator
to compute F
, but now you wrote VeryCoolNewEvaluator
to evaluate F
. So you add it to your problem, but forget to delete the previous one. Or worse yet: two evaluators happen to evaluate the same field because of a particular clash in your app parameters, in which case, you probably need to rethink your app flow (so you would love to see an error message).
Possible Solution
Simply change the default to OFF. Or remove the option altogether. It may be that it was meant to achieve the same thing that contributed fields now allow. So perhaps this is no longer needed.
Steps to Reproduce
Take your favorite problem, and register the same evaluator twice, and see if you get an error. Yes, in that case everything would be fine, since the two evaluators are the same, but it still exposes the problem: no errors with the default PHX configuration.