FEATURE: log run durations for solvers and time analyses - #278
Open
CyberSarvesh wants to merge 2 commits into
Open
FEATURE: log run durations for solvers and time analyses#278CyberSarvesh wants to merge 2 commits into
CyberSarvesh wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
[FEATURE] Log run durations for solvents and trim analyses
Motivation
Convergence analysis reports per-iteration and total durations via
_functions.format_durationinconvergence.py, but the other long-running entry points are silent.SteadyHorseshoe/SteadyRing/UnsteadyRingrun()andtrim.analyze_steady_trim/analyze_unsteady_trimlog progress but never wall-clock duration, so users must time calls themselves when comparing parameters or planning studies. This PR adds consistent total-duration logging styled afterconvergence.py.Relevant Issues
Closes #244
Changes
pterasoftware/steady_horseshoe_vortex_lattice_method.py:12,168: addimport time, capturerun_start_time = time.time()inSteadyHorseshoeVortexLatticeMethodSolver.run(), logSteady horseshoe vortex lattice method solver completed in <_functions.format_duration>at end of run (after streamlines, beforeself._ran = True)pterasoftware/steady_ring_vortex_lattice_method.py:13,223: same forSteadyRingVortexLatticeMethodSolver.run()→Steady ring vortex lattice method solver completed inpterasoftware/unsteady_ring_vortex_lattice_method.py:15,469,591: same forUnsteadyRingVortexLatticeMethodSolver.run()→Unsteady ring vortex lattice method solver completed in; verifiedaeroelastic_unsteady_ring_vortex_lattice_method.py/free_flight_unsteady_ring_vortex_lattice_method.py/_coupled_unsteady_ring_vortex_lattice_method.pyreuse thisrun(grepdef runfinds only 3 solvers), so they are covered without extra instrumentationpterasoftware/trim.py:19,27,361,413,844,896: addimport time+from . import _functions, capturerun_start_timebeforeBeginning trim analysisin bothanalyze_steady_trimandanalyze_unsteady_trim, logTrim analysis completed in <format_duration>on all 3 exits each (local hit, global hit, not found) — total only, no per-iteration as requestedDependency Updates
None.
Change Magnitude
Minor: Small enhancement adding logging only, no behavior change.
Checklist
mainand is up to date with the upstreammainbranch.--in-place --black).pterasoftwarepackage use type hints.testspackage.testspackage. (tests.unit.test_steady_horseshoe: 4 OK,tests.unit.test_unsteady_ring_vortex_lattice_method: 20 OK,tests.integration.test_steady_trim: 1 OK;example_solver.logverifiedSteady ... completed in)ascii-only,pre-commit-hooks, andzizmorGitHub actions. (mixed-line-endingfixed to LF intrim.py)lintjob of theCIGitHub action.testjobs of theCIGitHub action.Proof Of Work
Screenshot of the log after running the examples(SteadyHorseshoeVortexLatticeMethodSolver) with the changes. Same pattern applies to the other solvers/trim, so no extra screenshots added.