-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling profiling in RAVEN #1318
Conversation
On my mac machine, I saaw 636 passed, 99 skipped, with line_profiler installed (but not pillow). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment. In addition, can you create a "mini"-developer guide for how to use it (basically your PR description with some additions here and there"?
framework/Driver.py
Outdated
builtins.profile | ||
except (AttributeError,ImportError): | ||
# profiler not preset, so pass through | ||
builtins.profile = lambda f: f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is a decorator, can we add this in RAVEN decorator module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we could; it would just mean adding that import to any file we want to use profiling on. I was able to mask it in the decorators just fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a section to the Python Optimization wiki page.
Job Test qsubs on cefcb67 : invalidated by @alfoa hpc issue? |
Checklist passed. PR can be merged. |
I added this to the RAVEN 2.1 tracking list. |
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
Closes #1317
What are the significant changes in functionality due to this change request?
Extends the options in
raven_framework
to include a--profile
mode, which enablesline_profiler
during the run and activates the@profile
decorator to indicate which methods should be profiled.If not in
--profile
mode, then the@profile
decorator is ignored (passthrough).One method (
Simulation.setInputFiles
) was added to the profiling list just for demonstration and testing.Note that the
line_profiler
library was added as an optional one, so running--profile
without this installed will crash with something like "bash: kernprof: command not found".The results of profiling is a line-by-line analysis of tagged methods with many factors, including:
For example, profiling
Driver.raven()
as:then running a test case, like
prints, at the end of a RAVEN run ...
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.