This object tracks the success/failure state of the executor system as execution proceeds in a simulation. More...
#include <Executor.h>
Public Member Functions | |
Result () | |
Result (const std::string &name) | |
Result (const MooseObject *obj) | |
std::string | str (bool success_msg=false, const std::string &indent="", const std::string &subname="") |
Prints a full recursive output of this result object - including all descendant's results. More... | |
void | pass (const std::string &msg, bool overwrite=false) |
Marks the result as passing/converged with the given msg text describing detail about how things ran. More... | |
void | fail (const std::string &msg) |
Marks the result as failing/unconverged with the given msg text describing detail about how things ran. More... | |
bool | record (const std::string &name, const Result &r) |
Records results from sub/internal executors in a executor's result. More... | |
bool | convergedAll () const |
Returns false if any single executor in the current hierarchy of results (i.e. More... | |
Public Attributes | |
bool | converged = true |
whether or not a executor ran its code successfully - only reports results from the executor itself. More... | |
std::string | reason |
Optional message detailing why an executor passed or failed (i.e. failed to converge). More... | |
std::map< std::string, Result > | subs |
Maps a name/label of a executor's internal/sub executors to the result object returned by running each of those internal/sub executors. More... | |
Private Member Functions | |
std::string | label (bool success_msg, const std::string &subname="") |
Private Attributes | |
std::string | _name |
This object tracks the success/failure state of the executor system as execution proceeds in a simulation.
Because executors can be composed into trees, result objects are correspondingly composed into trees to track simulation progress. Result objects should generally be created by executors calling the Result::newResult() function rather than by using the Result constructor directly.
Definition at line 35 of file Executor.h.
|
inline |
Definition at line 37 of file Executor.h.
|
inline |
Definition at line 38 of file Executor.h.
|
inline |
Definition at line 39 of file Executor.h.
|
inline |
Returns false if any single executor in the current hierarchy of results (i.e.
including all child results accumulated recursively via record) had a failed/unconverged return state. Returns true otherwise. This is how convergence should generally be checked/tracked by executors - rather than accessing e.g. the converged member directly.
Definition at line 108 of file Executor.h.
Referenced by Executor::lastSolveConverged(), and record().
|
inline |
Marks the result as failing/unconverged with the given msg text describing detail about how things ran.
Definition at line 86 of file Executor.h.
|
inlineprivate |
Definition at line 119 of file Executor.h.
Referenced by str().
|
inline |
Marks the result as passing/converged with the given msg text describing detail about how things ran.
A result object is in this state by default, so it is not necessary to call this function for converged/passing scenarios.
Definition at line 75 of file Executor.h.
|
inline |
Records results from sub/internal executors in a executor's result.
When child-executors return a result object following their execution, this function should be called to add that info into the result hierarchy. If the child executor was identified by a label/text from the input file (e.g. via sub_solve1=foo_executor) - then "name" should be "sub_solve1".
Definition at line 97 of file Executor.h.
|
inline |
Prints a full recursive output of this result object - including all descendant's results.
If success_msg is true, then all result output that contains a message will be printed even if it converged/passed. Otherwise, messages will only be printed for unconverged/failed results.
Definition at line 63 of file Executor.h.
|
private |
Definition at line 126 of file Executor.h.
Referenced by label().
bool Executor::Result::converged = true |
whether or not a executor ran its code successfully - only reports results from the executor itself.
If a sub/internal executor of a executor fails, that sub-executor's result object will have converged=false, while the parent may still have converged=truee. Users should use convergedAll to recursively determine if there was any descendant executor failure.
Definition at line 46 of file Executor.h.
Referenced by convergedAll(), fail(), label(), and pass().
std::string Executor::Result::reason |
Optional message detailing why an executor passed or failed (i.e. failed to converge).
Definition at line 49 of file Executor.h.
std::map<std::string, Result> Executor::Result::subs |
Maps a name/label of a executor's internal/sub executors to the result object returned by running each of those internal/sub executors.
This member should generally not be accessed directly. It should generally be populated through the record function. Info contained in these results will be included in printouts from the str function.
Definition at line 56 of file Executor.h.
Referenced by convergedAll(), record(), and str().