Skip to content

Commit

Permalink
Record number of crossing edges between Inner and Outer sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
SSoelvsten committed Dec 20, 2023
1 parent 0f7f374 commit a55d35a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/adiar/internal/algorithms/nested_sweeping.h
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,14 @@ namespace adiar::internal
void push(const value_type& v)
{
if (v.source().is_flagged()) {
#ifdef ADIAR_STATS
stats.inner_up.outer_arcs += 1;
#endif
_outer_pq.push(arc(unflag(v.source()), v.target()));
} else {
#ifdef ADIAR_STATS
stats.inner_up.inner_arcs += 1;
#endif
_inner_pq.push(v);
}
}
Expand Down
27 changes: 25 additions & 2 deletions src/adiar/statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,6 @@ namespace adiar

void __printstat_nested_sweeping(std::ostream &o)
{
// TODO: Merge code duplication with `__printstat_reduce(...)`

const uintwide total_runs = internal::nested_sweeping::stats.skips
+ internal::nested_sweeping::stats.runs;

Expand Down Expand Up @@ -785,6 +783,31 @@ namespace adiar
o << indent << bold_on << "inner down sweep" << bold_off << endl;
indent_level++;

const uintwide total_arcs = internal::nested_sweeping::stats.inner_up.outer_arcs
+ internal::nested_sweeping::stats.inner_up.inner_arcs;

o << indent << bold_on << label << "arc types" << bold_off
<< total_arcs
<< endl;

indent_level++;

o << indent << label << "outer"
<< 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"
<< internal::nested_sweeping::stats.inner_up.inner_arcs
<< " = " << internal::percent_frac(internal::nested_sweeping::stats.inner_up.inner_arcs,
total_arcs) << percent
<< endl;

indent_level--;

o << indent << endl;

o << indent << bold_on << "root requests" << bold_off << endl;

indent_level++;
Expand Down
10 changes: 10 additions & 0 deletions src/adiar/statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,16 @@ namespace adiar
//////////////////////////////////////////////////////////////////////////
struct inner_up_t : public reduce_t
{
//////////////////////////////////////////////////////////////////////
/// \brief Number of arcs within inner sweep.
//////////////////////////////////////////////////////////////////////
uintwide inner_arcs = 0;

//////////////////////////////////////////////////////////////////////
/// \brief Number of arcs within outer sweep.
//////////////////////////////////////////////////////////////////////
uintwide outer_arcs = 0;

////////////////////////////////////////////////////////////////////////
/// \brief Number of levels reduced canonically.
////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit a55d35a

Please sign in to comment.