MADNESS 0.10.1
madness::test_output Struct Reference

small class for pretty printing of test output More...

#include <test_utilities.h>

Public Member Functions

 test_output (std::string line, bool print=true)
 ~test_output ()
void checkpoint (bool success, std::string message, double error=-1.0)
void checkpoint (double error, double tol, std::string message, double time=-1.0)
void checkpoint (double value, double reference, double tol, std::string message, double time=-1.0)
void checkpoint (int value, int reference, std::string message, double time=-1.0)
int end (bool success=true)
bool get_final_success () const
void print_and_clear_log ()
void print_success_fail (std::ostream &os, bool success, double time, double error) const
void set_cout_to_logger ()
void set_cout_to_terminal (bool newline=true)
 newline for use by user, not for internal use (e.g. checkpoint())
void set_do_print (bool print)

Static Public Member Functions

static std::string ltrim_to_length (std::string line, long length=70)

Public Attributes

std::stringstream logger

Private Attributes

bool cout_set_to_logger =false
bool do_print =true
bool final_success =true
bool have_checkpoints =false
std::streambuf * stream_buffer_cout
double time_begin =0.0
double time_last_checkpoint =0.0

Detailed Description

small class for pretty printing of test output

Constructor & Destructor Documentation

◆ test_output()

madness::test_output::test_output ( std::string line,
bool print = true )
inline
Parameters
[in]useas if (world.rank()==0) to avoid printing on all ranks

References madness::cpu_time(), do_print, logger, ltrim_to_length(), madness::print(), set_cout_to_logger(), time_begin, and time_last_checkpoint.

◆ ~test_output()

madness::test_output::~test_output ( )
inline

Member Function Documentation

◆ checkpoint() [1/4]

◆ checkpoint() [2/4]

void madness::test_output::checkpoint ( double error,
double tol,
std::string message,
double time = -1.0 )
inline

References checkpoint(), and madness::error().

Referenced by checkpoint(), checkpoint(), checkpoint(), main(), run_all_calculations(), run_batched_cell(), run_correctness_cell(), run_tests(), test_adaptive_diagnosis(), test_adaptive_grid_projection(), test_adaptive_project(), test_arithmetic(), test_bad_input(), test_batch_cache(), test_batch_fetch_chunked(), test_batch_fetch_of_missing_record(), test_batch_split(), test_batch_store_and_fetch(), test_broaden_resets_norms(), test_clear(), test_combine_generic(), test_combined_operators(), test_compress_clears_snorm(), test_consolidate(), test_consolidate_vs_direct(), test_construction(), test_constructor(), test_contraction_micro(), test_conversion(), test_copy_function_from_other_world(), test_copy_function_from_other_world_through_cloud(), test_ctor_orthonormalization(), test_custom_serialization(), test_deferred(), test_diagnose_GQKffK(), test_diagnose_GQUe(), test_diagnose_GUe(), test_diagnose_Ue(), test_direct_projection(), test_dot_sparse(), test_driver_keeps_root(), test_driver_rejects_nonfinite_cost(), test_duplicate_key_throws(), test_empty_vector_norms(), test_energies(), test_equivalence(), test_ethylene(), test_exact(), test_generic_exchange(), test_golden_values(), test_GQUe(), test_gradient(), test_GUe(), test_hartree_product(), test_hessian(), test_immediate(), test_inactive(), test_inner(), test_inner(), test_integration(), test_invrsq_operator(), test_key_below_deepest_level(), test_load_store(), test_missing_root_throws(), test_molecular_grid(), test_mpi_group(), test_multiply(), test_multiply(), test_multiply_with_f12(), test_nearest_ancestor(), test_no_halo_no_allocation(), test_node_replicated_function(), test_norm(), test_norm_tree_states(), test_norms_preserve_tree_state(), test_numerics(), test_operand_state(), test_operator_apply(), test_output_param_overload(), test_owner_assignment(), test_partial_inner_3d(), test_partial_inner_6d(), test_pointer_to_funcimpl(), test_project_ab(), test_projector(), test_projector(), test_projector_outer(), test_Q12_projector(), test_rank_out_of_range_throws(), test_record_keys(), test_recursive_apply(), test_remove_lindep(), test_replication_policy(), test_row_owner_assignment(), test_row_owner_grid(), test_row_owner_split(), test_scalar_multiplication(), test_scale_inplace_norms(), test_scale_preserves_broaden_marker(), test_scaled_redundant_operand(), test_scaling_factor(), test_screening_accuracy(), test_self_consistency(), test_simple(), test_single_function(), test_size(), test_sum_down(), test_swap_particles(), test_transform(), test_transformations(), test_tree_state(), test_tt2d_summation(), test_unmatched_level_zero_key_throws(), test_vector_composite(), test_Vphi_ij_u(), test_weighted_bra_exchange(), test_with_function(), and test_with_function_vector().

◆ checkpoint() [3/4]

void madness::test_output::checkpoint ( double value,
double reference,
double tol,
std::string message,
double time = -1.0 )
inline

◆ checkpoint() [4/4]

void madness::test_output::checkpoint ( int value,
int reference,
std::string message,
double time = -1.0 )
inline

◆ end()

int madness::test_output::end ( bool success = true)
inline

References madness::cpu_time(), do_print, final_success, have_checkpoints, ltrim_to_length(), print_and_clear_log(), print_success_fail(), set_cout_to_terminal(), and time_begin.

Referenced by chunk_example(), main(), run_batched_cell(), run_correctness_cell(), run_tests(), madness::OEP::selftest(), test_adaptive_diagnosis(), test_adaptive_grid_projection(), test_adaptive_project(), test_apply(), test_arithmetic(), test_bad_input(), test_batch_cache(), test_batch_fetch_chunked(), test_batch_fetch_of_missing_record(), test_batch_split(), test_batch_store_and_fetch(), test_broaden_resets_norms(), test_clear(), test_combine_generic(), test_combined_operators(), test_compress_clears_snorm(), test_consolidate(), test_consolidate_vs_direct(), test_construction(), test_construction(), test_constructor(), test_contraction_micro(), test_conversion(), test_copy_function_from_other_world(), test_copy_function_from_other_world_through_cloud(), test_coulomb_gfit_discard_large_alpha(), test_ctor_orthonormalization(), test_custom_serialization(), test_custom_worldobject(), test_deferred(), test_diagnose_GQKffK(), test_diagnose_GQUe(), test_diagnose_GUe(), test_diagnose_Ue(), test_direct_projection(), test_dot_sparse(), test_driver_keeps_root(), test_driver_rejects_nonfinite_cost(), test_duplicate_key_throws(), test_empty_vector_norms(), test_energies(), test_equivalence(), test_ethylene(), test_exact(), madness::Diamagnetic_potential_factor::test_factor(), test_generic_exchange(), test_golden_values(), test_GQUe(), test_gradient(), test_GUe(), madness::Diamagnetic_potential_factor::test_harmonic_potential(), test_hartree_product(), test_hessian(), test_host_rank_map(), test_immediate(), test_inactive(), test_inner(), test_inner(), test_integration(), test_inv_rsq_gfit(), test_invrsq_operator(), test_key_below_deepest_level(), test_load_store(), test_lowrank_function(), madness::Diamagnetic_potential_factor::test_lz_commutator(), test_missing_root_throws(), test_molecular_grid(), test_mpi_group(), test_multiply(), test_multiply(), test_multiply_with_f12(), test_ne_boys(), test_nearest_ancestor(), test_no_halo_no_allocation(), test_node_replicated_function(), test_norm(), test_norm_tree_states(), test_norms_preserve_tree_state(), test_numerics(), test_operand_state(), test_operator_apply(), test_output_param_overload(), test_owner_assignment(), test_partial_inner_3d(), test_partial_inner_6d(), test_pointer_to_funcimpl(), test_project_ab(), test_projector(), test_projector(), test_projector_outer(), test_Q12_projector(), test_rank_out_of_range_throws(), test_record_keys(), test_recursive_apply(), test_remove_lindep(), test_replication_policy(), test_row_owner_assignment(), test_row_owner_grid(), test_row_owner_split(), test_scalar_multiplication(), madness::Diamagnetic_potential_factor::test_scalar_potentials(), test_scale_inplace_norms(), test_scale_preserves_broaden_marker(), test_scaled_redundant_operand(), test_scaling_factor(), test_screening_accuracy(), test_self_consistency(), test_simple(), test_single_function(), test_size(), test_stuff(), test_sum_down(), test_sum_down_files(), test_swap_particles(), test_transform(), test_transformations(), test_tree_state(), test_tt2d_summation(), madness::Znemo::test_U_potentials(), test_unmatched_level_zero_key_throws(), test_vector_composite(), madness::Diamagnetic_potential_factor::test_vector_potentials(), test_Vphi_ij_u(), test_weighted_bra_exchange(), test_with_function(), and test_with_function_vector().

◆ get_final_success()

bool madness::test_output::get_final_success ( ) const
inline

References final_success.

◆ ltrim_to_length()

std::string madness::test_output::ltrim_to_length ( std::string line,
long length = 70 )
inlinestatic

References length.

Referenced by test_output(), checkpoint(), and end().

◆ print_and_clear_log()

void madness::test_output::print_and_clear_log ( )
inline

References logger, and set_cout_to_terminal().

Referenced by checkpoint(), and end().

◆ print_success_fail()

void madness::test_output::print_success_fail ( std::ostream & os,
bool success,
double time,
double error ) const
inline

References do_print, and madness::error().

Referenced by checkpoint(), and end().

◆ set_cout_to_logger()

void madness::test_output::set_cout_to_logger ( )
inline

◆ set_cout_to_terminal()

◆ set_do_print()

Member Data Documentation

◆ cout_set_to_logger

bool madness::test_output::cout_set_to_logger =false
private

◆ do_print

bool madness::test_output::do_print =true
private

◆ final_success

bool madness::test_output::final_success =true
private

Referenced by checkpoint(), end(), and get_final_success().

◆ have_checkpoints

bool madness::test_output::have_checkpoints =false
private

Referenced by checkpoint(), and end().

◆ logger

◆ stream_buffer_cout

std::streambuf* madness::test_output::stream_buffer_cout
private

◆ time_begin

double madness::test_output::time_begin =0.0
private

Referenced by test_output(), and end().

◆ time_last_checkpoint

double madness::test_output::time_last_checkpoint =0.0
private

Referenced by test_output(), and checkpoint().


The documentation for this struct was generated from the following file: