darshan-hpc / darshan

Darshan I/O characterization tool
Other
56 stars 27 forks source link

BUG: runtime heatmap handling in pydarshan when STDIO not "active" #748

Open tylerjereddy opened 2 years ago

tylerjereddy commented 2 years ago

Looks like plot_heatmap() cannot gracefully handle the case where runtime HEATMAP data is collected for STDIO, but the max and min values are both 0.0. Presumably the same would happen for 0.0 min/max in other HEATMAP submodules as well. We should generate a simpler reproducing log than the one I used for ML I think. This might extend to the DXT cases as well, should check, if it is also possible to record 0.0 min/max cases there as well.

modules: {'POSIX': {'len': 26898, 'ver': 4, 'idx': 1, 'partial_flag': False, 'num_records': 441}, 'STDIO': {'len': 449, 'ver': 2, 'idx': 8, 'partial_flag': False, 'num_records': 8}, 'DXT_POSIX': {'len': 227393, 'ver': 1, 'idx': 9, 'partial_flag': False, 'num_records': 305}, 'HEATMAP': {'len': 1740, 'ver': 1, 'idx': 14, 'partial_flag': False}}
-----processing DXT_POSIX read
mod: DXT_POSIX
submodule: None
ops: ['read']
hmap_df.max()
 659379483.0
hmap_df.min()
 0.0
-----end processing
-----processing DXT_POSIX write
mod: DXT_POSIX
submodule: None
ops: ['write']
hmap_df.max()
 205802027.0
hmap_df.min()
 0.0
-----end processing
-----processing HEATMAP POSIX read
mod: HEATMAP
submodule: POSIX
ops: ['read']
hmap_df.max()
 659379483
hmap_df.min()
 0
-----end processing
-----processing HEATMAP POSIX write
mod: HEATMAP
submodule: POSIX
ops: ['write']
hmap_df.max()
 205802027
hmap_df.min()
 0
-----end processing
-----processing HEATMAP STDIO read
mod: HEATMAP
submodule: STDIO
ops: ['read']
hmap_df.max()
 0.0
hmap_df.min()
 0.0
Traceback (most recent call last):
  File "/Users/treddy/LANL/xcp-gitlab/machine_learning_galen/analysis_modules/heatmap_separate_rw.py", line 48, in <module>
    main(log_path=args.log_path)
  File "/Users/treddy/LANL/xcp-gitlab/machine_learning_galen/analysis_modules/heatmap_separate_rw.py", line 35, in main
    fig = plot_heatmap(report=report,
  File "/Users/treddy/github_projects/darshan/darshan-util/pydarshan/darshan/experimental/plots/plot_dxt_heatmap.py", line 405, in plot_heatmap
    hmap = sns.heatmap(
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/seaborn/_decorators.py", line 46, in inner_f
    return f(**kwargs)
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/seaborn/matrix.py", line 553, in heatmap
    plotter.plot(ax, cbar_ax, kwargs)
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/seaborn/matrix.py", line 312, in plot
    cb = ax.figure.colorbar(mesh, cax, ax, **self.cbar_kws)
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/matplotlib/figure.py", line 1176, in colorbar
    cb = cbar.Colorbar(cax, mappable, **cb_kw)
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/matplotlib/colorbar.py", line 1197, in __init__
    super().__init__(ax, **kwargs)
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/matplotlib/_api/deprecation.py", line 471, in wrapper
    return func(*args, **kwargs)
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/matplotlib/colorbar.py", line 511, in __init__
    self.draw_all()
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/matplotlib/colorbar.py", line 528, in draw_all
    self._process_values()
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/matplotlib/colorbar.py", line 962, in _process_values
    b = self.norm.inverse(self._uniform_y(self.cmap.N + 1))
  File "/Users/treddy/python_venvs/python_395_darshan/lib/python3.9/site-packages/matplotlib/colors.py", line 1480, in inverse
    raise ValueError("Invalid vmin or vmax")
ValueError: Invalid vmin or vmax
tylerjereddy commented 2 years ago

Note that this is for a case where we are interested in splitting the read and write ops--sometimes there's data for i.e., writing but not reading for a submodule, etc.