Skip to content

Commit 8da0bc4

Browse files
author
telemin
committed
Merge branch 'v0.2' into develop
2 parents 18d5f89 + a4be35b commit 8da0bc4

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

pypop/cli.py

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use("agg")
1414

1515
from .traceset import TraceSet
16-
from .metrics import MPI_Metrics, MPI_OpenMP_Metrics
16+
from .metrics import MPI_Metrics, MPI_OpenMP_Metrics, OpenMP_Metrics
1717
from .dimemas import dimemas_idealise
1818
from .config import set_dimemas_path, set_paramedir_path, set_tmpdir_path
1919
from .examples import examples_directory
@@ -144,7 +144,38 @@ def mpi_cli_metrics():
144144

145145
statistics = TraceSet(config.traces)
146146

147-
metrics = MPI_Metrics(statistics.by_commsize())
147+
metrics = MPI_Metrics(statistics)
148+
149+
# Create and save table
150+
if not config.no_metric_table:
151+
metric_table = metrics.plot_table(title=config.metric_title)
152+
metric_table.savefig(config.metric_table)
153+
154+
# Create and save scaling plot
155+
if not config.no_scaling_plot:
156+
scaling_plot = metrics.plot_scaling(title=config.scaling_title)
157+
scaling_plot.savefig(config.scaling_plot)
158+
159+
# Save metrics as csv
160+
if not config.no_csv:
161+
metrics.metric_data.to_csv(config.csv, index=False)
162+
163+
164+
def openmp_cli_metrics():
165+
"""Entrypoint for pypop-hybrid-metrics script
166+
"""
167+
168+
config = _mpi_parse_args()
169+
170+
if config.paramedir_path:
171+
set_paramedir_path(config.paramedir_path)
172+
173+
if config.dimemas_path:
174+
set_dimemas_path(config.dimemas_path)
175+
176+
statistics = TraceSet(config.traces)
177+
178+
metrics = OpenMP_Metrics(statistics)
148179

149180
# Create and save table
150181
if not config.no_metric_table:
@@ -175,7 +206,7 @@ def hybrid_cli_metrics():
175206

176207
statistics = TraceSet(config.traces)
177208

178-
metrics = MPI_OpenMP_Metrics(statistics.by_commsize())
209+
metrics = MPI_OpenMP_Metrics(statistics)
179210

180211
# Create and save table
181212
if not config.no_metric_table:

pypop/metrics/metricset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class MetricSet:
5656

5757
_default_metric_key = None
5858
_default_group_key = None
59+
_default_scaling_key = "Total Threads"
5960

6061
_key_descriptions = {
6162
"Number of Processes": "",
@@ -376,7 +377,7 @@ def plot_scaling(self, x_key="auto", y_key="Speedup", label=None, title=None):
376377
Figure containing complete scaling plot.
377378
"""
378379
if x_key == "auto":
379-
x_key = self._default_metric_key
380+
x_key = self._default_scaling_key
380381

381382
with mpl.rc_context(pypop_mpl_params):
382383
return self._plot_scaling(x_key, y_key, label, title)

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
setup(
88
name="pypop",
9-
version="0.2.0rc2",
10-
url="https://github.com/numericalalgorithmsgroup/ezpop.git",
9+
version="0.2.0rc7",
10+
url="https://github.com/numericalalgorithmsgroup/pypop.git",
1111
author="Numerical Algorithms Group",
1212
author_email="[email protected]",
1313
description="Python notebook support for POP metrics and reports",
@@ -27,6 +27,7 @@
2727
"console_scripts": [
2828
"pypop-mpi-metrics = pypop.cli:mpi_cli_metrics",
2929
"pypop-hybrid-metrics = pypop.cli:hybrid_cli_metrics",
30+
"pypop-openmp-metrics = pypop.cli:openmp_cli_metrics",
3031
"pypop-preprocess = pypop.cli:preprocess_traces",
3132
"pypop-idealise-prv = pypop.cli:dimemas_idealise",
3233
"pypop-copy-examples = pypop.cli:copy_examples",

0 commit comments

Comments
 (0)