SolverProgress Class Reference

SolverProgress Class Reference#

Reference API: gko::log::SolverProgress Class Reference
Reference API
gko::log::SolverProgress Class Reference

#include <ginkgo/core/log/solver_progress.hpp>

Inheritance diagram for gko::log::SolverProgress:
[legend]

Static Public Member Functions

static std::shared_ptr< SolverProgresscreate_scalar_table_writer (std::ostream &output, int precision=6, int column_width=12)
 
static std::shared_ptr< SolverProgresscreate_scalar_csv_writer (std::ostream &output, int precision=6, char separator=',')
 
static std::shared_ptr< SolverProgresscreate_vector_storage (std::string output_file_prefix="solver_", bool binary=false)
 

Additional Inherited Members

- Public Types inherited from gko::log::Logger
using mask_type = gko::uint64
 
- Public Member Functions inherited from gko::log::Logger
template<size_type Event, typename... Params>
std::enable_if_t< Event==0 &&(0< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==1 &&(1< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==2 &&(2< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==3 &&(3< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==4 &&(4< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==5 &&(5< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==6 &&(6< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==7 &&(7< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==8 &&(8< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==9 &&(9< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==10 &&(10< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==11 &&(11< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==12 &&(12< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==13 &&(13< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==14 &&(14< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==15 &&(15< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==16 &&(16< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==17 &&(17< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==18 &&(18< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==19 &&(19< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==20 &&(20< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==21 &&(21< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==22 &&(22< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==23 &&(23< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==24 &&(24< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==25 &&(25< event_count_max)> on (Params &&... params) const
 
template<size_type Event, typename... Params>
std::enable_if_t< Event==26 &&(26< event_count_max)> on (Params &&... params) const
 
virtual bool needs_propagation () const
 
- Static Public Attributes inherited from gko::log::Logger
static constexpr size_type event_count_max = sizeof(mask_type) * byte_size
 
static constexpr mask_type all_events_mask = ~mask_type{0}
 
static constexpr size_type allocation_started { 0 }
 
static constexpr mask_type allocation_started_mask {mask_type{1} << 0 }
 
static constexpr size_type allocation_completed { 1 }
 
static constexpr mask_type allocation_completed_mask {mask_type{1} << 1 }
 
static constexpr size_type free_started { 2 }
 
static constexpr mask_type free_started_mask {mask_type{1} << 2 }
 
static constexpr size_type free_completed { 3 }
 
static constexpr mask_type free_completed_mask {mask_type{1} << 3 }
 
static constexpr size_type copy_started { 4 }
 
static constexpr mask_type copy_started_mask {mask_type{1} << 4 }
 
static constexpr size_type copy_completed { 5 }
 
static constexpr mask_type copy_completed_mask {mask_type{1} << 5 }
 
static constexpr size_type operation_launched { 6 }
 
static constexpr mask_type operation_launched_mask {mask_type{1} << 6 }
 
static constexpr size_type operation_completed { 7 }
 
static constexpr mask_type operation_completed_mask {mask_type{1} << 7 }
 
static constexpr size_type polymorphic_object_create_started { 8 }
 
static constexpr mask_type polymorphic_object_create_started_mask {mask_type{1} << 8 }
 
static constexpr size_type polymorphic_object_create_completed { 9 }
 
static constexpr mask_type polymorphic_object_create_completed_mask {mask_type{1} << 9 }
 
static constexpr size_type polymorphic_object_copy_started { 10 }
 
static constexpr mask_type polymorphic_object_copy_started_mask {mask_type{1} << 10 }
 
static constexpr size_type polymorphic_object_copy_completed { 11 }
 
static constexpr mask_type polymorphic_object_copy_completed_mask {mask_type{1} << 11 }
 
static constexpr size_type polymorphic_object_deleted { 12 }
 
static constexpr mask_type polymorphic_object_deleted_mask {mask_type{1} << 12 }
 
static constexpr size_type linop_apply_started { 13 }
 
static constexpr mask_type linop_apply_started_mask {mask_type{1} << 13 }
 
static constexpr size_type linop_apply_completed { 14 }
 
static constexpr mask_type linop_apply_completed_mask {mask_type{1} << 14 }
 
static constexpr size_type linop_advanced_apply_started { 15 }
 
static constexpr mask_type linop_advanced_apply_started_mask {mask_type{1} << 15 }
 
static constexpr size_type linop_advanced_apply_completed { 16 }
 
static constexpr mask_type linop_advanced_apply_completed_mask {mask_type{1} << 16 }
 
static constexpr size_type linop_factory_generate_started { 17 }
 
static constexpr mask_type linop_factory_generate_started_mask {mask_type{1} << 17 }
 
static constexpr size_type linop_factory_generate_completed { 18 }
 
static constexpr mask_type linop_factory_generate_completed_mask {mask_type{1} << 18 }
 
static constexpr size_type criterion_check_started { 19 }
 
static constexpr mask_type criterion_check_started_mask {mask_type{1} << 19 }
 
static constexpr size_type criterion_check_completed { 20 }
 
static constexpr mask_type criterion_check_completed_mask {mask_type{1} << 20 }
 
static constexpr size_type iteration_complete {21}
 
static constexpr mask_type iteration_complete_mask {mask_type{1} << 21}
 
static constexpr size_type polymorphic_object_move_started { 22 }
 
static constexpr mask_type polymorphic_object_move_started_mask {mask_type{1} << 22 }
 
static constexpr size_type polymorphic_object_move_completed { 23 }
 
static constexpr mask_type polymorphic_object_move_completed_mask {mask_type{1} << 23 }
 
static constexpr size_type batch_linop_factory_generate_started { 24 }
 
static constexpr mask_type batch_linop_factory_generate_started_mask {mask_type{1} << 24 }
 
static constexpr size_type batch_linop_factory_generate_completed { 25 }
 
static constexpr mask_type batch_linop_factory_generate_completed_mask {mask_type{1} << 25 }
 
static constexpr size_type batch_solver_completed {26}
 
static constexpr mask_type batch_solver_completed_mask {mask_type{1} << 26}
 
static constexpr mask_type executor_events_mask
 
static constexpr mask_type operation_events_mask
 
static constexpr mask_type polymorphic_object_events_mask
 
static constexpr mask_type linop_events_mask
 
static constexpr mask_type linop_factory_events_mask
 
static constexpr mask_type batch_linop_factory_events_mask
 
static constexpr mask_type criterion_events_mask
 
- Protected Member Functions inherited from gko::log::Logger
virtual void on_allocation_started (const Executor *exec, const size_type &num_bytes) const
 
virtual void on_allocation_completed (const Executor *exec, const size_type &num_bytes, const uintptr &location) const
 
virtual void on_free_started (const Executor *exec, const uintptr &location) const
 
virtual void on_free_completed (const Executor *exec, const uintptr &location) const
 
virtual void on_copy_started (const Executor *exec_from, const Executor *exec_to, const uintptr &loc_from, const uintptr &loc_to, const size_type &num_bytes) const
 
virtual void on_copy_completed (const Executor *exec_from, const Executor *exec_to, const uintptr &loc_from, const uintptr &loc_to, const size_type &num_bytes) const
 
virtual void on_operation_launched (const Executor *exec, const Operation *op) const
 
virtual void on_operation_completed (const Executor *exec, const Operation *op) const
 
virtual void on_polymorphic_object_create_started (const Executor *exec, const PolymorphicObject *po) const
 
virtual void on_polymorphic_object_create_completed (const Executor *exec, const PolymorphicObject *input, const PolymorphicObject *output) const
 
virtual void on_polymorphic_object_copy_started (const Executor *exec, const PolymorphicObject *input, const PolymorphicObject *output) const
 
virtual void on_polymorphic_object_copy_completed (const Executor *exec, const PolymorphicObject *input, const PolymorphicObject *output) const
 
virtual void on_polymorphic_object_deleted (const Executor *exec, const PolymorphicObject *po) const
 
virtual void on_linop_apply_started (const LinOp *A, const LinOp *b, const LinOp *x) const
 
virtual void on_linop_apply_completed (const LinOp *A, const LinOp *b, const LinOp *x) const
 
virtual void on_linop_advanced_apply_started (const LinOp *A, const LinOp *alpha, const LinOp *b, const LinOp *beta, const LinOp *x) const
 
virtual void on_linop_advanced_apply_completed (const LinOp *A, const LinOp *alpha, const LinOp *b, const LinOp *beta, const LinOp *x) const
 
virtual void on_linop_factory_generate_started (const LinOpFactory *factory, const LinOp *input) const
 
virtual void on_linop_factory_generate_completed (const LinOpFactory *factory, const LinOp *input, const LinOp *output) const
 
virtual void on_criterion_check_started (const stop::Criterion *criterion, const size_type &it, const LinOp *r, const LinOp *tau, const LinOp *x, const uint8 &stopping_id, const bool &set_finalized) const
 
virtual void on_criterion_check_completed (const stop::Criterion *criterion, const size_type &it, const LinOp *r, const LinOp *tau, const LinOp *x, const uint8 &stopping_id, const bool &set_finalized, const array< stopping_status > *status, const bool &one_changed, const bool &all_converged) const
 
virtual void on_criterion_check_completed (const stop::Criterion *criterion, const size_type &it, const LinOp *r, const LinOp *tau, const LinOp *implicit_tau_sq, const LinOp *x, const uint8 &stopping_id, const bool &set_finalized, const array< stopping_status > *status, const bool &one_changed, const bool &all_converged) const
 
virtual void on_iteration_complete (const LinOp *solver, const size_type &it, const LinOp *r, const LinOp *x=nullptr, const LinOp *tau=nullptr) const
 
virtual void on_iteration_complete (const LinOp *solver, const size_type &it, const LinOp *r, const LinOp *x, const LinOp *tau, const LinOp *implicit_tau_sq) const
 
virtual void on_iteration_complete (const LinOp *solver, const LinOp *b, const LinOp *x, const size_type &it, const LinOp *r, const LinOp *tau, const LinOp *implicit_tau_sq, const array< stopping_status > *status, bool stopped) const
 
virtual void on_polymorphic_object_move_started (const Executor *exec, const PolymorphicObject *input, const PolymorphicObject *output) const
 
virtual void on_polymorphic_object_move_completed (const Executor *exec, const PolymorphicObject *input, const PolymorphicObject *output) const
 
virtual void on_batch_linop_factory_generate_started (const batch::BatchLinOpFactory *factory, const batch::BatchLinOp *input) const
 
virtual void on_batch_linop_factory_generate_completed (const batch::BatchLinOpFactory *factory, const batch::BatchLinOp *input, const batch::BatchLinOp *output) const
 
virtual void on_batch_solver_completed (const array< int > &iters, const array< double > &residual_norms) const
 
virtual void on_batch_solver_completed (const array< int > &iters, const array< float > &residual_norms) const
 
virtual void on_batch_solver_completed (const array< int > &iters, const array< gko::half > &residual_norms) const
 
 Logger (std::shared_ptr< const gko::Executor > exec, const mask_type &enabled_events=all_events_mask)
 
 Logger (const mask_type &enabled_events=all_events_mask)
 

Detailed Description

This Logger outputs the value of all scalar values (and potentially vectors) stored internally by the solver after each iteration. It needs to be attached to the solver being inspected.

Member Function Documentation

◆ create_scalar_csv_writer()

static std::shared_ptr< SolverProgress > gko::log::SolverProgress::create_scalar_csv_writer ( std::ostream &  output,
int  precision = 6,
char  separator = ',' 
)
static

Creates a logger printing the value for all scalar values in the solver after each iteration in a CSV table. If the solver is applied to multiple right-hand sides, only the first right-hand side gets printed.

Parameters
outputthe stream to write the output to.
precisionthe number of digits of precision to print
separatorthe character separating columns from each other

◆ create_scalar_table_writer()

static std::shared_ptr< SolverProgress > gko::log::SolverProgress::create_scalar_table_writer ( std::ostream &  output,
int  precision = 6,
int  column_width = 12 
)
static

Creates a logger printing the value for all scalar values in the solver after each iteration in an ASCII table. If the solver is applied to multiple right-hand sides, only the first right-hand side gets printed.

Parameters
outputthe stream to write the output to.
precisionthe number of digits of precision to print
column_widththe number of characters an output column is wide

◆ create_vector_storage()

static std::shared_ptr< SolverProgress > gko::log::SolverProgress::create_vector_storage ( std::string  output_file_prefix = "solver_",
bool  binary = false 
)
static

Creates a logger storing all vectors and scalar values in the solver after each iteration on disk. This logger can handle multiple right-hand sides, in contrast to create_scalar_table_writer or create_scalar_csv_writer.

Parameters
outputthe path and file name prefix used to generate the output file names.
precisionthe number of digits of precision to print when outputting matrices in text format
binaryif true, write data in Ginkgo's own binary format (lossless), if false write data in the MatrixMarket format (potentially lossy)

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