-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use correct stream for output. #17024
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the current logic is that the output of deallog
will be used if output is present. If nothing is printed to deallog
then everything piped to std::cout
is used for comparison instead.
If I remember correctly, it was not possible to combine both, i.e., using deallog
and std::cout
together for comparison, back when we introduced that behavior because that lead to quite a number of failing tests.
Yes, not worth trying to support outputting to both. |
#ifdef DEBUG | ||
print(std::cout, "symb_st", symb_st); | ||
print(std::cout, "symb_t", symb_t); | ||
print(std::cout, "symb_v", symb_v); | ||
print(std::cout, "symb_s", symb_s); | ||
|
||
print(std::cout, "symb_psi", symb_psi); | ||
|
||
print(std::cout, "symb_dpsi_dst", symb_dpsi_dst); | ||
print(std::cout, "symb_dpsi_dt", symb_dpsi_dt); | ||
print(std::cout, "symb_dpsi_dv", symb_dpsi_dv); | ||
print(std::cout, "symb_dpsi_ds", symb_dpsi_ds); | ||
|
||
print(std::cout, "symb_d2psi_dst_x_dst", symb_d2psi_dst_x_dst); | ||
print(std::cout, "symb_d2psi_dst_x_dt", symb_d2psi_dst_x_dt); | ||
print(std::cout, "symb_d2psi_dst_x_dv", symb_d2psi_dst_x_dv); | ||
print(std::cout, "symb_d2psi_dst_x_ds", symb_d2psi_dst_x_ds); | ||
|
||
print(std::cout, "symb_d2psi_dt_x_dst", symb_d2psi_dt_x_dst); | ||
print(std::cout, "symb_d2psi_dt_x_dt", symb_d2psi_dt_x_dt); | ||
print(std::cout, "symb_d2psi_dt_x_dv", symb_d2psi_dt_x_dv); | ||
print(std::cout, "symb_d2psi_dt_x_ds", symb_d2psi_dt_x_ds); | ||
|
||
print(std::cout, "symb_d2psi_dv_x_dst", symb_d2psi_dv_x_dst); | ||
print(std::cout, "symb_d2psi_dv_x_dt", symb_d2psi_dv_x_dt); | ||
print(std::cout, "symb_d2psi_dv_x_dv", symb_d2psi_dv_x_dv); | ||
print(std::cout, "symb_d2psi_dv_x_ds", symb_d2psi_dv_x_ds); | ||
|
||
print(std::cout, "symb_d2psi_ds_x_dst", symb_d2psi_ds_x_dst); | ||
print(std::cout, "symb_d2psi_ds_x_dt", symb_d2psi_ds_x_dt); | ||
print(std::cout, "symb_d2psi_ds_x_dv", symb_d2psi_ds_x_dv); | ||
print(std::cout, "symb_d2psi_ds_x_ds", symb_d2psi_ds_x_ds); | ||
print(deallog, "symb_st", symb_st); | ||
print(deallog, "symb_t", symb_t); | ||
print(deallog, "symb_v", symb_v); | ||
print(deallog, "symb_s", symb_s); | ||
|
||
print(deallog, "symb_psi", symb_psi); | ||
|
||
print(deallog, "symb_dpsi_dst", symb_dpsi_dst); | ||
print(deallog, "symb_dpsi_dt", symb_dpsi_dt); | ||
print(deallog, "symb_dpsi_dv", symb_dpsi_dv); | ||
print(deallog, "symb_dpsi_ds", symb_dpsi_ds); | ||
|
||
print(deallog, "symb_d2psi_dst_x_dst", symb_d2psi_dst_x_dst); | ||
print(deallog, "symb_d2psi_dst_x_dt", symb_d2psi_dst_x_dt); | ||
print(deallog, "symb_d2psi_dst_x_dv", symb_d2psi_dst_x_dv); | ||
print(deallog, "symb_d2psi_dst_x_ds", symb_d2psi_dst_x_ds); | ||
|
||
print(deallog, "symb_d2psi_dt_x_dst", symb_d2psi_dt_x_dst); | ||
print(deallog, "symb_d2psi_dt_x_dt", symb_d2psi_dt_x_dt); | ||
print(deallog, "symb_d2psi_dt_x_dv", symb_d2psi_dt_x_dv); | ||
print(deallog, "symb_d2psi_dt_x_ds", symb_d2psi_dt_x_ds); | ||
|
||
print(deallog, "symb_d2psi_dv_x_dst", symb_d2psi_dv_x_dst); | ||
print(deallog, "symb_d2psi_dv_x_dt", symb_d2psi_dv_x_dt); | ||
print(deallog, "symb_d2psi_dv_x_dv", symb_d2psi_dv_x_dv); | ||
print(deallog, "symb_d2psi_dv_x_ds", symb_d2psi_dv_x_ds); | ||
|
||
print(deallog, "symb_d2psi_ds_x_dst", symb_d2psi_ds_x_dst); | ||
print(deallog, "symb_d2psi_ds_x_dt", symb_d2psi_ds_x_dt); | ||
print(deallog, "symb_d2psi_ds_x_dv", symb_d2psi_ds_x_dv); | ||
print(deallog, "symb_d2psi_ds_x_ds", symb_d2psi_ds_x_ds); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is guarded by DEBUG
and so you will get different output in Debug
and Release
mode but there is only one output file AFAICT.
e892fbc
to
c729d8c
Compare
I fixed the issue @masterleinad points out by always outputting. I also fixed a few other places where we were writing to |
@@ -97,7 +97,7 @@ namespace Step44 | |||
|
|||
if (debug) | |||
{ | |||
SD::Utilities::print_substitution_map(std::cout, sub_vals); | |||
SD::Utilities::print_substitution_map(deallog, sub_vals); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output here depends on a bool variable that is false
. If someone was to change that, the test would then fail. Ultimately, it seems that this output is not intended to be recorded in an output file but only printed to the screen for debugging purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. There are other places where these programs have #ifdef DEBUG_EXTRA
. It is true that one could address all of these things, but that's more work than I'm willing to put in at the moment. I'm just trying to make things better, not optimal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
Many of the autodifferentiation tests output parts to
deallog
and other parts of their output tostd::cout
. The latter is not captured in the.output
files and consequently not checked. I think that this is accidental.Addresses part of #16534, though there is more to do.