Skip to content

Comments

Add elapsed time reporting for long-running commands#9513

Open
Bbn08 wants to merge 5 commits intoThe-OpenROAD-Project:masterfrom
Bbn08:runtime-reporting-5003
Open

Add elapsed time reporting for long-running commands#9513
Bbn08 wants to merge 5 commits intoThe-OpenROAD-Project:masterfrom
Bbn08:runtime-reporting-5003

Conversation

@Bbn08
Copy link

@Bbn08 Bbn08 commented Feb 20, 2026

Add INFO-level elapsed time logging to 9 long-running OpenROAD commands using utl::Timer:

  • DPL: Opendp::detailedPlacement (msg 500)
  • CTS: TritonCTS::runTritonCts (msg 500)
  • GRT: GlobalRouter::globalRoute (msg 501)
  • DRT: TritonRoute::main (msg 501)
  • GPL: Replace::doPlace (msg 500)
  • MPL: MacroPlacer::place (msg 500)
  • RSZ: Resizer::repairDesign (msg 500)
  • PDN: PdnGen::buildGrids (msg 500)
  • IFP: InitFloorplan::initFloorplan (msg 500)

Each function logs 'Elapsed time: X.XXs' at INFO level upon completion, providing users with runtime visibility without requiring verbose mode.

Closes #5003

@Bbn08 Bbn08 force-pushed the runtime-reporting-5003 branch from a14c1f5 to bfba497 Compare February 20, 2026 21:34
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request successfully adds elapsed time reporting to several long-running commands using utl::Timer. This provides better visibility into command execution times at the INFO level. However, there is an inconsistency in src/grt/src/GlobalRouter.cpp where the utl/timer.h header is included but not used, and the elapsed time is calculated manually using std::chrono instead of the utl::Timer class used in other files.

@Bbn08 Bbn08 marked this pull request as draft February 20, 2026 22:15
@Bbn08 Bbn08 force-pushed the runtime-reporting-5003 branch 5 times, most recently from 7cf7a29 to c05534a Compare February 21, 2026 11:47
Add INFO-level elapsed time logging to 9 long-running OpenROAD
commands using utl::Timer:

- DPL: Opendp::detailedPlacement (msg 500)
- CTS: TritonCTS::runTritonCts (msg 500)
- GRT: GlobalRouter::globalRoute (msg 501)
- DRT: TritonRoute::main (msg 501)
- GPL: Replace::doPlace (msg 500)
- MPL: MacroPlacer::place (msg 500)
- RSZ: Resizer::repairDesign (msg 500)
- PDN: PdnGen::buildGrids (msg 500)
- IFP: InitFloorplan::initFloorplan (msg 500)

Each function logs 'Elapsed time: X.XXs' at INFO level upon
completion, providing users with runtime visibility without
requiring verbose mode.

Closes The-OpenROAD-Project#5003

Signed-off-by: Bbn08 <atrancendentbeing@gmail.com>
@Bbn08 Bbn08 force-pushed the runtime-reporting-5003 branch from c05534a to d5ad6ed Compare February 21, 2026 12:36
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Bbn08 <atrancendentbeing@gmail.com>
@Bbn08 Bbn08 force-pushed the runtime-reporting-5003 branch from d52da0d to 2536d62 Compare February 22, 2026 08:13
@Bbn08 Bbn08 marked this pull request as ready for review February 22, 2026 13:28
Comment on lines 397 to 400
logger_->info(
GRT, 303, "Global routing runtime = {:02}:{:02}:{:02}", hour, min, sec);
}
logger_->info(GRT, 501, "Runtime: {:.2f}s", timer.elapsed());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already reporting runtime here under -verbose, why add it again?

Note that existing h:m:s is easier to read the just a total number of seconds. It might be nice to do that generally. You could make a method on Timer to return such a string.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, the existing verbose h:m:s line is sufficient. Will follow up with a Timer::toString() method in a separate cleanup if desired.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Bbn08 <atrancendentbeing@gmail.com>
@maliberty
Copy link
Member

The PDN change seems unrelated and should be its own PR


void PdnGen::buildGrids(bool trim)
{
utl::Timer timer;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only captures one "phase" of the build, it seems like what you want is to measure the time from the start of buildGrids through writeDb (which can also make a lot of time)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the separate PDN pr (shall be pushing shortly) added PdnGen::run() that wraps buildGrids + writeToDb under a single timer, so the reported runtime covers both phases.

Signed-off-by: Bbn08 <atrancendentbeing@gmail.com>
Signed-off-by: Bbn08 <atrancendentbeing@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Long running OR commands should report their runtime

3 participants