From 531b7391808c727a974d39862e3864fbcae47793 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 2 Feb 2020 12:03:58 +0100 Subject: Add spent time info to report --- common/router1.cc | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/common/router1.cc b/common/router1.cc index 02c817c7..e1160074 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -769,14 +769,20 @@ bool router1(Context *ctx, const Router1Cfg &cfg) int last_arcs_with_ripup = 0; int last_arcs_without_ripup = 0; - log_info(" | (re-)routed arcs | delta | remaining\n"); - log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs\n"); + log_info(" | (re-)routed arcs | delta | remaining| time spent |\n"); + log_info(" | | | | batch| total|\n"); + log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs| sec| sec|\n"); + auto prev_time = rstart; while (!router.arc_queue.empty()) { if (++iter_cnt % 1000 == 0) { - log_info("%10d | %8d %10d | %4d %5d | %9d\n", iter_cnt, router.arcs_with_ripup, + auto curr_time = std::chrono::high_resolution_clock::now(); + log_info("%10d | %8d %10d | %4d %5d | %9d| %9.02f| %9.02f|\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, - router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size())); + router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), + std::chrono::duration(curr_time - prev_time).count(), + std::chrono::duration(curr_time - rstart).count()); + prev_time = curr_time; last_arcs_with_ripup = router.arcs_with_ripup; last_arcs_without_ripup = router.arcs_without_ripup; ctx->yield(); @@ -800,12 +806,13 @@ bool router1(Context *ctx, const Router1Cfg &cfg) return false; } } - - log_info("%10d | %8d %10d | %4d %5d | %9d\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, - router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup, - int(router.arc_queue.size())); - log_info("Routing complete.\n"); auto rend = std::chrono::high_resolution_clock::now(); + log_info("%10d | %8d %10d | %4d %5d | %9d| %9.02f| %9.02f|\n", iter_cnt, router.arcs_with_ripup, + router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, + router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), + std::chrono::duration(rend - prev_time).count(), + std::chrono::duration(rend - rstart).count()); + log_info("Routing complete.\n"); ctx->yield(); log_info("Route time %.02fs\n", std::chrono::duration(rend - rstart).count()); -- cgit v1.2.3 From f81bd6b1fc10670e18ad9bbdead39cba24421b9b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 2 Feb 2020 12:16:34 +0100 Subject: Better formatting --- common/router1.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common/router1.cc b/common/router1.cc index e1160074..7de8cd09 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -769,15 +769,14 @@ bool router1(Context *ctx, const Router1Cfg &cfg) int last_arcs_with_ripup = 0; int last_arcs_without_ripup = 0; - log_info(" | (re-)routed arcs | delta | remaining| time spent |\n"); - log_info(" | | | | batch| total|\n"); - log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs| sec| sec|\n"); + log_info(" | (re-)routed arcs | delta | remaining| time spent |\n"); + log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs| batch(sec)| total(sec)|\n"); auto prev_time = rstart; while (!router.arc_queue.empty()) { if (++iter_cnt % 1000 == 0) { auto curr_time = std::chrono::high_resolution_clock::now(); - log_info("%10d | %8d %10d | %4d %5d | %9d| %9.02f| %9.02f|\n", iter_cnt, router.arcs_with_ripup, + log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f| %10.02f|\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), std::chrono::duration(curr_time - prev_time).count(), @@ -807,7 +806,7 @@ bool router1(Context *ctx, const Router1Cfg &cfg) } } auto rend = std::chrono::high_resolution_clock::now(); - log_info("%10d | %8d %10d | %4d %5d | %9d| %9.02f| %9.02f|\n", iter_cnt, router.arcs_with_ripup, + log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f| %10.02f|\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), std::chrono::duration(rend - prev_time).count(), -- cgit v1.2.3 From d5f50070d7b8de8fbddc19a41d145571b7069aa7 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 2 Feb 2020 17:20:14 +0100 Subject: Update formatting --- common/router1.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/router1.cc b/common/router1.cc index 7de8cd09..a89d870d 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -769,14 +769,14 @@ bool router1(Context *ctx, const Router1Cfg &cfg) int last_arcs_with_ripup = 0; int last_arcs_without_ripup = 0; - log_info(" | (re-)routed arcs | delta | remaining| time spent |\n"); - log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs| batch(sec)| total(sec)|\n"); + log_info(" | (re-)routed arcs | delta | remaining| time spent |\n"); + log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs| batch(sec) total(sec)|\n"); auto prev_time = rstart; while (!router.arc_queue.empty()) { if (++iter_cnt % 1000 == 0) { auto curr_time = std::chrono::high_resolution_clock::now(); - log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f| %10.02f|\n", iter_cnt, router.arcs_with_ripup, + log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f %10.02f|\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), std::chrono::duration(curr_time - prev_time).count(), @@ -806,7 +806,7 @@ bool router1(Context *ctx, const Router1Cfg &cfg) } } auto rend = std::chrono::high_resolution_clock::now(); - log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f| %10.02f|\n", iter_cnt, router.arcs_with_ripup, + log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f %10.02f|\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), std::chrono::duration(rend - prev_time).count(), -- cgit v1.2.3