diff --git a/src/adiar/internal/algorithms/nested_sweeping.h b/src/adiar/internal/algorithms/nested_sweeping.h index a95fb68f3..855a96f9a 100644 --- a/src/adiar/internal/algorithms/nested_sweeping.h +++ b/src/adiar/internal/algorithms/nested_sweeping.h @@ -1691,6 +1691,18 @@ namespace adiar::internal outer_writer.detach(); +#ifdef ADIAR_STATS + nested_sweeping::stats.inner_down.inputs.acc_size += outer_file->size(); + nested_sweeping::stats.inner_down.inputs.max_size = std::max(nested_sweeping::stats.inner_down.inputs.max_size, + outer_file->size()); + nested_sweeping::stats.inner_down.inputs.acc_width += outer_file->width; + nested_sweeping::stats.inner_down.inputs.max_width = std::max(nested_sweeping::stats.inner_down.inputs.max_width, + outer_file->width); + nested_sweeping::stats.inner_down.inputs.acc_levels += outer_file->levels(); + nested_sweeping::stats.inner_down.inputs.max_levels = std::max(nested_sweeping::stats.inner_down.inputs.max_levels, + outer_file->levels()); +#endif + // TODO (optimisation): is_last_inner && !non_gc_request // Use a simpler (and hence faster?) algorithm for a GC-only sweep. diff --git a/src/adiar/statistics.cpp b/src/adiar/statistics.cpp index 35962c83f..42178f034 100644 --- a/src/adiar/statistics.cpp +++ b/src/adiar/statistics.cpp @@ -783,22 +783,57 @@ namespace adiar o << indent << bold_on << "inner down sweep" << bold_off << endl; indent_level++; + o << indent << bold_on << "inputs" << bold_off << endl; + + indent_level++; + + o << indent << "size" << endl; + + indent_level++; + o << indent << label << "accumulated" + << internal::nested_sweeping::stats.inner_down.inputs.acc_size << endl; + o << indent << label << "maximum" + << internal::nested_sweeping::stats.inner_down.inputs.max_size << endl; + indent_level--; + + o << indent << "width" << endl; + + indent_level++; + o << indent << label << "accumulated" + << internal::nested_sweeping::stats.inner_down.inputs.acc_width << endl; + o << indent << label << "maximum" + << internal::nested_sweeping::stats.inner_down.inputs.max_width << endl; + indent_level--; + + o << indent << "levels" << endl; + + indent_level++; + o << indent << label << "accumulated" + << internal::nested_sweeping::stats.inner_down.inputs.acc_levels << endl; + o << indent << label << "maximum" + << internal::nested_sweeping::stats.inner_down.inputs.max_levels << endl; + indent_level--; + + indent_level--; + + o << indent << endl; + const uintwide total_arcs = internal::nested_sweeping::stats.inner_up.outer_arcs - + internal::nested_sweeping::stats.inner_up.inner_arcs; + + internal::nested_sweeping::stats.inner_up.inner_arcs; - o << indent << bold_on << label << "arc types" << bold_off + o << indent << bold_on << label << "output origin (arcs)" << bold_off << total_arcs << endl; indent_level++; - o << indent << label << "outer" + o << indent << label << "outer sweep" << internal::nested_sweeping::stats.inner_up.outer_arcs << " = " << internal::percent_frac(internal::nested_sweeping::stats.inner_up.outer_arcs, total_arcs) << percent << endl; - o << indent << label << "inner" + o << indent << label << "inner sweep" << internal::nested_sweeping::stats.inner_up.inner_arcs << " = " << internal::percent_frac(internal::nested_sweeping::stats.inner_up.inner_arcs, total_arcs) << percent diff --git a/src/adiar/statistics.h b/src/adiar/statistics.h index 76fd327f2..9599a602d 100644 --- a/src/adiar/statistics.h +++ b/src/adiar/statistics.h @@ -564,7 +564,42 @@ namespace adiar //////////////////////////////////////////////////////////////////////// struct inner_down_t { - // TODO: before/after + struct inputs_t + { + ////////////////////////////////////////////////////////////////////// + /// \brief Accumulated size of all diagrams handed over to nested + /// sweeps. + ////////////////////////////////////////////////////////////////////// + uintwide acc_size = 0; + + ////////////////////////////////////////////////////////////////////// + /// \brief Size of the largest diagram handed over to a nested sweep. + ////////////////////////////////////////////////////////////////////// + uintwide max_size = 0; + + ////////////////////////////////////////////////////////////////////// + /// \brief Accumulated width of all diagrams handed over to nested + /// sweeps. + ////////////////////////////////////////////////////////////////////// + uintwide acc_width = 0; + + ////////////////////////////////////////////////////////////////////// + /// \brief Largest width of any diagram handed over to a nested sweep. + ////////////////////////////////////////////////////////////////////// + uintwide max_width = 0; + + ////////////////////////////////////////////////////////////////////// + /// \brief Accumulated number of levels of all diagrams handed over + /// to nested sweeps. + ////////////////////////////////////////////////////////////////////// + uintwide acc_levels = 0; + + ////////////////////////////////////////////////////////////////////// + /// \brief The largest number of levels handed over to a nested sweep, + /// i.e. the depth of the "deepest" diagram. + ////////////////////////////////////////////////////////////////////// + uintwide max_levels = 0; + } inputs; struct requests_t {