gcpy.benchmark.modules.benchmark_scrape_gchp_timers
Scrapes GCHP Classic benchmark timing information from one or more text files.
Functions
|
Checks if a given text file contains GCHP timers output. |
|
Returns the number of characters in a string of text. |
|
Prints the GCHP timer information to a table. |
|
Creates a table of timing information for GCHP benchmark simulations given one or more text files as input. |
|
Prints timing info for a single timer to a log file. |
|
Parses the GCHP log file (plain text) with timing information and returns a dictionary with the results. |
|
Parses the GEOS-Chem Classic timing information in JSON format and returns a dictionary with the results. |
|
Sums the time in seconds for each GEOS-Chem timer. |
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.read_timing_data(input_files)[source]
Parses the GEOS-Chem Classic timing information in JSON format and returns a dictionary with the results.
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.count_characters(text, char_to_match='.')[source]
Returns the number of characters in a string of text.
- Parameters:
- Returns:
result – Number of occurrences of
char_to_matchintext.- Return type:
References
https://stackoverflow.com/questions/991350/counting-repeated-characters-in-a-string-in-python
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.check_file_for_timing_info(text_file)[source]
Checks if a given text file contains GCHP timers output. If not, we will reset the file name to allPEs.log (in the same path).
This update is necessary because MAPL v2.59 has switched the GCHP timers printout from the GCHP log file to allPEs.log. This will allow backwards compatibility with output from GCHP simulations that use older MAPL versions.
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.read_one_text_file(text_file)[source]
Parses the GCHP log file (plain text) with timing information and returns a dictionary with the results.
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.sum_timers(timers)[source]
Sums the time in seconds for each GEOS-Chem timer. Input may be a single dict with timing information or a list of dicts.
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.print_timer(key, ref, dev, ofile)[source]
Prints timing info for a single timer to a log file.
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.display_timers(ref, ref_label, dev, dev_label, table_file)[source]
Prints the GCHP timer information to a table.
- gcpy.benchmark.modules.benchmark_scrape_gchp_timers.make_benchmark_gchp_timing_table(ref_files, ref_label, dev_files, dev_label, dst='./benchmark', overwrite=False)[source]
Creates a table of timing information for GCHP benchmark simulations given one or more text files as input.
- Parameters:
ref_files (
strorlist) – File(s) with timing info from the “Ref” model.ref_label (
str) – Version string for the “Ref” model.dev_files (
strorlist) – File(s) with timing info from the “Dev” model.dev_label (
str) – Version string for the “Dev” model.dst (
str, optional) – Directory where output will be written.overwrite (
bool, optional) – Overwrite existing files? Default: False.