|
9 | 9 | use("agg") |
10 | 10 |
|
11 | 11 | from .traceset import TraceSet |
12 | | -from .metrics import MPI_Metrics, MPI_OpenMP_Metrics |
| 12 | +from .metrics import MPI_Metrics, MPI_OpenMP_Metrics, OpenMP_Metrics |
13 | 13 | from .dimemas import dimemas_idealise |
14 | 14 | from .config import set_dimemas_path, set_paramedir_path, set_tmpdir_path |
15 | 15 |
|
@@ -131,7 +131,38 @@ def mpi_cli_metrics(): |
131 | 131 |
|
132 | 132 | statistics = TraceSet(config.traces) |
133 | 133 |
|
134 | | - metrics = MPI_Metrics(statistics.by_commsize()) |
| 134 | + metrics = MPI_Metrics(statistics) |
| 135 | + |
| 136 | + # Create and save table |
| 137 | + if not config.no_metric_table: |
| 138 | + metric_table = metrics.plot_table(title=config.metric_title) |
| 139 | + metric_table.savefig(config.metric_table) |
| 140 | + |
| 141 | + # Create and save scaling plot |
| 142 | + if not config.no_scaling_plot: |
| 143 | + scaling_plot = metrics.plot_scaling(title=config.scaling_title) |
| 144 | + scaling_plot.savefig(config.scaling_plot) |
| 145 | + |
| 146 | + # Save metrics as csv |
| 147 | + if not config.no_csv: |
| 148 | + metrics.metric_data.to_csv(config.csv, index=False) |
| 149 | + |
| 150 | + |
| 151 | +def openmp_cli_metrics(): |
| 152 | + """Entrypoint for pypop-hybrid-metrics script |
| 153 | + """ |
| 154 | + |
| 155 | + config = _mpi_parse_args() |
| 156 | + |
| 157 | + if config.paramedir_path: |
| 158 | + set_paramedir_path(config.paramedir_path) |
| 159 | + |
| 160 | + if config.dimemas_path: |
| 161 | + set_dimemas_path(config.dimemas_path) |
| 162 | + |
| 163 | + statistics = TraceSet(config.traces) |
| 164 | + |
| 165 | + metrics = OpenMP_Metrics(statistics) |
135 | 166 |
|
136 | 167 | # Create and save table |
137 | 168 | if not config.no_metric_table: |
@@ -162,7 +193,7 @@ def hybrid_cli_metrics(): |
162 | 193 |
|
163 | 194 | statistics = TraceSet(config.traces) |
164 | 195 |
|
165 | | - metrics = MPI_OpenMP_Metrics(statistics.by_commsize()) |
| 196 | + metrics = MPI_OpenMP_Metrics(statistics) |
166 | 197 |
|
167 | 198 | # Create and save table |
168 | 199 | if not config.no_metric_table: |
|
0 commit comments