Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
minghangli-uni committed Oct 31, 2024
1 parent ae45de4 commit bd5a276
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ESMF_profiling/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ESMF Profiling tool
The **ESMF Profiling tool** is a Python-based tool designed to read and process performance profile data from ESMF profiling log files. It provides a structured way to extract hierachical timing and computational stats for various regions within ESMF log files, enabling detailed performance analysis.
The **ESMF Profiling tool** is a Python-based tool designed to read and process performance profile data from ESMF profiling log files for **ACCESS-OM3**. It provides a structured way to extract hierachical timing and computational stats for various regions within ESMF log files, enabling detailed performance analysis.

## Directory structure
```
Expand All @@ -13,6 +13,7 @@ The **ESMF Profiling tool** is a Python-based tool designed to read and process
- handles the input ESMF profile files.
- constructs the hierarchical data structure.
- outputs runtimes for specific regions.
- supports both exact and prefix matching for `regionNames` in runtime collection - an example is provided in this script.
2. `esmfRegion.py`:
- defines the ESMFRegion class.
- represents individual ESMF regions, capturing performance metrics.
Expand All @@ -28,17 +29,27 @@ env:
ESMF_RUNTIME_PROFILE: "ON"
ESMF_RUNTIME_PROFILE_OUTPUT: "TEXT SUMMARY"
```
where `TEXT` collects profiling logs per PET, and `SUMMARY` collects profiling data in a single summary text file that aggregates timings over multiple PETs. Details can be found [here](https://earthsystemmodeling.org/docs/nightly/develop/ESMF_refdoc/node6.html#SECTION060140000000000000000).

After running the configuration, specify the path to the profiling logs, along with any specific regions of interest.

One example for demonstration:
----------
```python
# Collect runtime info for specific regions
ESMF_path = ['/path/to/your/ESMF/output/files']
region_names = ['[ESMF]', '[ESMF]/[ensemble] RunPhase1/[ESM0001] RunPhase1/[OCN] RunPhase1']
regionNames=[
"[ESMF]",
"[ESMF]/[ensemble] RunPhase1/[ESM0001] RunPhase1/[OCN] RunPhase1",
"[ESMF]/[ensemble] RunPhase1/[ESM0001] RunPhase1/[MED]",
]
profile_prefix = 'ESMF_Profile.'
esmf_summary = True # Set to True for summary profiling
index = 2 # Choose the metric above to extract (e.g., mean time for summary profiling)
runtime_totals = collect_runtime_tot(ESMF_path, regionNames=region_names, profile_prefix=profile_prefix, esmf_summary=esmf_summary, index=index)
runtime_totals = collect_runtime_tot(ESMF_path,
regionNames=region_names,
profile_prefix=profile_prefix,
esmf_summary=esmf_summary,
index=index)
print(runtime_totals)
```

0 comments on commit bd5a276

Please sign in to comment.