-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add profiling utilities #3
Conversation
396c45e
to
267b01c
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
267b01c
to
65d001b
Compare
ea0669d
to
35b3ca1
Compare
35b3ca1
to
7bba5f8
Compare
9c1b3c8
to
1693f62
Compare
… the tests directory to test_utils to avoid nameclashes.
1693f62
to
89421b8
Compare
…ay dataset containing the corresponding profiling data. To make this more generic and robust a ProfilingParser abstract class is introduced.
… parallel scaling.
89421b8
to
e972276
Compare
@dougiesquire Would you have time to look at this PR? It's quite large, but I would be more interested in general comments about structure and design, rather than a careful review of all the details. |
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.
This looks great @micaeljtoliveira. My first thought is that these tools are sufficiently general and useful beyond OM3 to justify moving them into their own package. Something to do now, later or never?
Since you asked for it, here's an attempt at a proposed restructure that I think makes things clearer for users and developers. Of course, this is all a matter of opinion so feel free to ignore all or parts of it:
om3utils/
├── __init__.py
├── config_file
│ ├── __init__.py # import all read_*.py and write_*.py functions
│ ├── mom6_input.py
│ ├── nuopc_config.py
│ └── payu_config_yaml.py
├── profiling
│ ├── __init__.py
│ ├── parser
│ │ ├── __init__.py # import ESMFProfilingParser and FMSProfilingParser
│ │ ├── base.py # contains ProfilingParser from profiling.py
│ │ ├── esmf.py # contains all of esmf_profiling.py and esmf_trace.py
│ │ └── fms.py # contains all of fms_profiling.py
│ └── analysis.py # contains all of profiling_analyses.py and parse_profiling_data from profiling.py
└── utils.py
Then the profiling tools could be used as follows:
from om3utils.profiling.parser import ESMFProfilingParser
from om3utils.profiling.analysis import (
parse_profiling_data,
scaling_efficiency
)
stats = parse_profiling_data(
run_dirs,
ESMFProfilingParser,
varname,
getvar
)
eff = scaling_efficiency(stats)
You could even import all the parsers and analysis functions in profiling.__init__.py
so that one does not need to go through the parser
and analysis
subpackages.
(Note I'm not really sold on the name of the config_file
subpackage)
@dougiesquire Thanks for the feedback, lots of good points. I now realize that this PR is probably not the best place to discuss these, as they are quite broad and general. I'll open an issue for this. In order not to stall development anymore, I'll merge this branch as is, unless you want to have a more detailed look. |
Happy to merge 🙂 |
Add utilities to handle FMS and ESMF profiling information. These allow to easily generate plots for scaling studies.