timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::operation::finalize::base::print Struct Referenceabstract

#include "timemory/operations/types.hpp"

+ Collaboration diagram for tim::operation::finalize::base::print:

Public Types

using this_type = print
 
using stream_type = std::shared_ptr< utility::stream >
 
using settings_t = std::shared_ptr< settings >
 

Public Member Functions

 print (bool _forced_json=false, settings_t _settings=settings::shared_instance())
 
 print (std::string _label, bool _forced_json, settings_t _settings=settings::shared_instance())
 
virtual ~print ()=default
 
virtual void setup ()=0
 
virtual void execute ()=0
 
virtual void read_json ()=0
 
virtual void print_dart ()=0
 
virtual void update_data ()=0
 
virtual void print_custom ()=0
 
virtual void write (std::ostream &os, stream_type stream)
 
virtual void print_cout (stream_type stream)
 
virtual void print_text (const std::string &fname, stream_type stream)
 
virtual void print_plot (const std::string &fname, std::string suffix)
 
auto get_label () const
 
auto get_text_output_name () const
 
auto get_tree_output_name () const
 
auto get_json_output_name () const
 
auto get_json_input_name () const
 
auto get_text_diff_name () const
 
auto get_json_diff_name () const
 
void set_debug (bool v)
 
void set_update (bool v)
 
void set_verbose (int32_t v)
 
void set_max_call_stack (int64_t v)
 
int64_t get_max_depth () const
 
bool dart_output ()
 
bool file_output ()
 
bool cout_output ()
 
bool tree_output ()
 
bool json_output ()
 
bool text_output ()
 
bool plot_output ()
 
bool flame_output ()
 

Protected Attributes

settings_t m_settings = settings::shared_instance()
 
bool debug = false
 
bool update = true
 
bool json_forced = false
 
bool node_init = dmp::is_initialized()
 
int32_t node_rank = dmp::rank()
 
int32_t node_size = dmp::size()
 
int32_t verbose = 0
 
int64_t max_depth = 0
 
int64_t max_call_stack = std::numeric_limits<int64_t>::max()
 
std::string label = ""
 
std::string description = ""
 
std::string text_outfname = ""
 
std::string tree_outfname = ""
 
std::string json_outfname = ""
 
std::string json_inpfname = ""
 
std::string text_diffname = ""
 
std::string json_diffname = ""
 
stream_type data_stream = stream_type{}
 
stream_type diff_stream = stream_type{}
 

Detailed Description

Definition at line 1170 of file types.hpp.

Member Typedef Documentation

◆ settings_t

Definition at line 1174 of file types.hpp.

◆ stream_type

Definition at line 1173 of file types.hpp.

◆ this_type

Constructor & Destructor Documentation

◆ print() [1/2]

tim::operation::finalize::base::print::print ( bool  _forced_json = false,
settings_t  _settings = settings::shared_instance() 
)
inlineexplicit

Definition at line 1176 of file types.hpp.

1178 : m_settings(std::move(_settings))
1179 , json_forced(_forced_json)
1180 {
1181 if(m_settings)
1182 {
1183 debug = m_settings->get_debug();
1184 verbose = m_settings->get_verbose();
1185 max_call_stack = m_settings->get_max_depth();
1186 }
1187 }
char argparse::argument_parser tim::settings * _settings
Definition: config.cpp:255

References debug, m_settings, max_call_stack, and verbose.

◆ print() [2/2]

tim::operation::finalize::base::print::print ( std::string  _label,
bool  _forced_json,
settings_t  _settings = settings::shared_instance() 
)
inline

Definition at line 1189 of file types.hpp.

1191 : m_settings(std::move(_settings))
1192 , json_forced(_forced_json)
1193 , label(std::move(_label))
1194 {
1195 if(m_settings)
1196 {
1197 debug = m_settings->get_debug();
1198 verbose = m_settings->get_verbose();
1199 max_call_stack = m_settings->get_max_depth();
1200 }
1201 }

References debug, m_settings, max_call_stack, and verbose.

◆ ~print()

virtual tim::operation::finalize::base::print::~print ( )
virtualdefault

Member Function Documentation

◆ cout_output()

bool tim::operation::finalize::base::print::cout_output ( )
inline

Definition at line 1255 of file types.hpp.

1256 {
1257 if(!m_settings)
1258 {
1259 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1260 return false;
1261 }
1262 return m_settings->get_cout_output();
1263 }
#define PRINT_HERE(...)
Definition: macros.hpp:152

References m_settings, and PRINT_HERE.

◆ dart_output()

bool tim::operation::finalize::base::print::dart_output ( )
inline

Definition at line 1237 of file types.hpp.

1238 {
1239 if(!m_settings)
1240 {
1241 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1242 return false;
1243 }
1244 return m_settings->get_dart_output();
1245 }

References m_settings, and PRINT_HERE.

◆ execute()

virtual void tim::operation::finalize::base::print::execute ( )
pure virtual

◆ file_output()

bool tim::operation::finalize::base::print::file_output ( )
inline

Definition at line 1246 of file types.hpp.

1247 {
1248 if(!m_settings)
1249 {
1250 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1251 return false;
1252 }
1253 return m_settings->get_file_output();
1254 }

References m_settings, and PRINT_HERE.

◆ flame_output()

bool tim::operation::finalize::base::print::flame_output ( )
inline

Definition at line 1303 of file types.hpp.

1304 {
1305 if(!m_settings)
1306 {
1307 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1308 return false;
1309 }
1310 return m_settings->get_flamegraph_output() && m_settings->get_file_output();
1311 }

References m_settings, and PRINT_HERE.

◆ get_json_diff_name()

auto tim::operation::finalize::base::print::get_json_diff_name ( ) const
inline

Definition at line 1223 of file types.hpp.

1223{ return json_diffname; }

References json_diffname.

◆ get_json_input_name()

auto tim::operation::finalize::base::print::get_json_input_name ( ) const
inline

Definition at line 1221 of file types.hpp.

1221{ return json_inpfname; }

References json_inpfname.

◆ get_json_output_name()

auto tim::operation::finalize::base::print::get_json_output_name ( ) const
inline

Definition at line 1220 of file types.hpp.

1220{ return json_outfname; }

References json_outfname.

◆ get_label()

auto tim::operation::finalize::base::print::get_label ( ) const
inline

Definition at line 1217 of file types.hpp.

1217{ return label; }

References label.

◆ get_max_depth()

int64_t tim::operation::finalize::base::print::get_max_depth ( ) const
inline

Definition at line 1230 of file types.hpp.

1231 {
1232 return (max_depth > 0)
1233 ? max_depth
1234 : std::min<int64_t>(max_call_stack, m_settings->get_max_depth());
1235 }

References m_settings, max_call_stack, and max_depth.

◆ get_text_diff_name()

auto tim::operation::finalize::base::print::get_text_diff_name ( ) const
inline

Definition at line 1222 of file types.hpp.

1222{ return text_diffname; }

References text_diffname.

◆ get_text_output_name()

auto tim::operation::finalize::base::print::get_text_output_name ( ) const
inline

Definition at line 1218 of file types.hpp.

1218{ return text_outfname; }

References text_outfname.

◆ get_tree_output_name()

auto tim::operation::finalize::base::print::get_tree_output_name ( ) const
inline

Definition at line 1219 of file types.hpp.

1219{ return tree_outfname; }

References tree_outfname.

◆ json_output()

bool tim::operation::finalize::base::print::json_output ( )
inline

Definition at line 1274 of file types.hpp.

1275 {
1276 if(!m_settings)
1277 {
1278 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1279 return false;
1280 }
1281 return (m_settings->get_json_output() || json_forced) &&
1282 m_settings->get_file_output();
1283 }

References json_forced, m_settings, and PRINT_HERE.

◆ plot_output()

bool tim::operation::finalize::base::print::plot_output ( )
inline

Definition at line 1293 of file types.hpp.

1294 {
1295 if(!m_settings)
1296 {
1297 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1298 return false;
1299 }
1300 return m_settings->get_plot_output() && m_settings->get_json_output() &&
1301 m_settings->get_file_output();
1302 }

References m_settings, and PRINT_HERE.

◆ print_cout()

virtual void tim::operation::finalize::base::print::print_cout ( stream_type  stream)
virtual

◆ print_custom()

virtual void tim::operation::finalize::base::print::print_custom ( )
pure virtual

◆ print_dart()

virtual void tim::operation::finalize::base::print::print_dart ( )
pure virtual

◆ print_plot()

virtual void tim::operation::finalize::base::print::print_plot ( const std::string &  fname,
std::string  suffix 
)
virtual

◆ print_text()

virtual void tim::operation::finalize::base::print::print_text ( const std::string &  fname,
stream_type  stream 
)
virtual

◆ read_json()

virtual void tim::operation::finalize::base::print::read_json ( )
pure virtual

◆ set_debug()

void tim::operation::finalize::base::print::set_debug ( bool  v)
inline

Definition at line 1225 of file types.hpp.

1225{ debug = v; }

References debug.

◆ set_max_call_stack()

void tim::operation::finalize::base::print::set_max_call_stack ( int64_t  v)
inline

Definition at line 1228 of file types.hpp.

1228{ max_call_stack = v; }

References max_call_stack.

◆ set_update()

void tim::operation::finalize::base::print::set_update ( bool  v)
inline

Definition at line 1226 of file types.hpp.

References update.

◆ set_verbose()

void tim::operation::finalize::base::print::set_verbose ( int32_t  v)
inline

Definition at line 1227 of file types.hpp.

1227{ verbose = v; }

References verbose.

◆ setup()

virtual void tim::operation::finalize::base::print::setup ( )
pure virtual

◆ text_output()

bool tim::operation::finalize::base::print::text_output ( )
inline

Definition at line 1284 of file types.hpp.

1285 {
1286 if(!m_settings)
1287 {
1288 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1289 return false;
1290 }
1291 return m_settings->get_text_output() && m_settings->get_file_output();
1292 }

References m_settings, and PRINT_HERE.

◆ tree_output()

bool tim::operation::finalize::base::print::tree_output ( )
inline

Definition at line 1264 of file types.hpp.

1265 {
1266 if(!m_settings)
1267 {
1268 PRINT_HERE("%s", "Null pointer to settings! Disabling");
1269 return false;
1270 }
1271 return (m_settings->get_tree_output() || json_forced) &&
1272 m_settings->get_file_output();
1273 }

References json_forced, m_settings, and PRINT_HERE.

◆ update_data()

virtual void tim::operation::finalize::base::print::update_data ( )
pure virtual

◆ write()

virtual void tim::operation::finalize::base::print::write ( std::ostream &  os,
stream_type  stream 
)
virtual

Member Data Documentation

◆ data_stream

stream_type tim::operation::finalize::base::print::data_stream = stream_type{}
protected

Definition at line 1333 of file types.hpp.

◆ debug

bool tim::operation::finalize::base::print::debug = false
protected

Definition at line 1316 of file types.hpp.

Referenced by print(), and set_debug().

◆ description

std::string tim::operation::finalize::base::print::description = ""
protected

Definition at line 1326 of file types.hpp.

◆ diff_stream

stream_type tim::operation::finalize::base::print::diff_stream = stream_type{}
protected

Definition at line 1334 of file types.hpp.

◆ json_diffname

std::string tim::operation::finalize::base::print::json_diffname = ""
protected

Definition at line 1332 of file types.hpp.

Referenced by get_json_diff_name().

◆ json_forced

bool tim::operation::finalize::base::print::json_forced = false
protected

Definition at line 1318 of file types.hpp.

Referenced by json_output(), and tree_output().

◆ json_inpfname

std::string tim::operation::finalize::base::print::json_inpfname = ""
protected

Definition at line 1330 of file types.hpp.

Referenced by get_json_input_name().

◆ json_outfname

std::string tim::operation::finalize::base::print::json_outfname = ""
protected

Definition at line 1329 of file types.hpp.

Referenced by get_json_output_name().

◆ label

std::string tim::operation::finalize::base::print::label = ""
protected

Definition at line 1325 of file types.hpp.

Referenced by get_label(), and tim::operation::finalize::TIMEMORY_OPERATIONS_LINKAGE().

◆ m_settings

◆ max_call_stack

int64_t tim::operation::finalize::base::print::max_call_stack = std::numeric_limits<int64_t>::max()
protected

Definition at line 1324 of file types.hpp.

Referenced by print(), get_max_depth(), and set_max_call_stack().

◆ max_depth

int64_t tim::operation::finalize::base::print::max_depth = 0
protected

Definition at line 1323 of file types.hpp.

Referenced by get_max_depth().

◆ node_init

bool tim::operation::finalize::base::print::node_init = dmp::is_initialized()
protected

Definition at line 1319 of file types.hpp.

◆ node_rank

int32_t tim::operation::finalize::base::print::node_rank = dmp::rank()
protected

Definition at line 1320 of file types.hpp.

Referenced by tim::operation::finalize::TIMEMORY_OPERATIONS_LINKAGE().

◆ node_size

int32_t tim::operation::finalize::base::print::node_size = dmp::size()
protected

Definition at line 1321 of file types.hpp.

◆ text_diffname

std::string tim::operation::finalize::base::print::text_diffname = ""
protected

Definition at line 1331 of file types.hpp.

Referenced by get_text_diff_name().

◆ text_outfname

std::string tim::operation::finalize::base::print::text_outfname = ""
protected

Definition at line 1327 of file types.hpp.

Referenced by get_text_output_name().

◆ tree_outfname

std::string tim::operation::finalize::base::print::tree_outfname = ""
protected

Definition at line 1328 of file types.hpp.

Referenced by get_tree_output_name().

◆ update

bool tim::operation::finalize::base::print::update = true
protected

Definition at line 1317 of file types.hpp.

Referenced by set_update().

◆ verbose

int32_t tim::operation::finalize::base::print::verbose = 0
protected

Definition at line 1322 of file types.hpp.

Referenced by print(), and set_verbose().


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