Skip to content

Commit 50731c5

Browse files
committed
Merge branch 'develop' into v0.2
2 parents 6d920ac + a7ff810 commit 50731c5

File tree

12 files changed

+205
-24
lines changed

12 files changed

+205
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pypop/version
12
__pycache__
23
*.egg-info
34
*.pkl

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
include pypop/version
12
recursive-include pypop/examples *
23
recursive-include pypop/cfgs *
34
recursive-include pypop/cutters *
45
recursive-include pypop/filters *
6+
global-exclude */.ipynb_checkpoints/*

bin/modelfactors2precomputed.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env python3
2+
3+
import pandas
4+
5+
import sys
6+
7+
8+
def usage():
9+
print("Usage: {} <input.csv>".format(sys.argv[0]))
10+
11+
12+
def main():
13+
if len(sys.argv) > 2:
14+
usage()
15+
return -1
16+
17+
inputfile = "modelfactors.csv"
18+
if len(sys.argv) == 2:
19+
inputfile = sys.argv[1]
20+
21+
try:
22+
inputdata = pandas.read_csv(
23+
inputfile, sep=";", index_col=0, comment="#"
24+
).transpose()
25+
except FileNotFoundError:
26+
print("FATAL: {} not found".format(inputfile))
27+
return -1
28+
29+
inputdata.columns.name = "Metrics"
30+
31+
mapper = {m: m.title() for m in inputdata.columns}
32+
replacements = {
33+
"Ipc": "IPC",
34+
"Scalability": "Scaling",
35+
"Load Balance": "MPI Load Balance",
36+
"Communication Efficiency": "MPI Communication Efficiency",
37+
"Transfer Efficiency": "MPI Transfer Efficiency",
38+
"Serialization Efficiency": "MPI Serialisation Efficiency",
39+
}
40+
for rin, rout in replacements.items():
41+
mapper = {k: v.replace(rin, rout) for k, v in mapper.items()}
42+
43+
inputdata.rename(columns=mapper, inplace=True)
44+
45+
for column in inputdata.columns:
46+
if column in ["Speedup", "Average IPC", "Average Frequency (Ghz)"]:
47+
continue
48+
inputdata[column] = inputdata[column] / 100
49+
50+
inputdata["Number of Processes"] = inputdata.index
51+
inputdata["Threads per Process"] = 1
52+
inputdata["Total Threads"] = inputdata.index
53+
inputdata["Hybrid Layout"] = ["{}x1".format(i) for i in inputdata.index]
54+
55+
inputdata.to_csv("precomputed.csv")
56+
57+
58+
if __name__ == "__main__":
59+
main()

pypop/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@
99
from . import metrics
1010
from . import prv
1111
from . import config
12+
13+
from .version import get_version
14+
15+
__all__ = ['__version__']
16+
17+
__version__ = get_version()
18+
19+

pypop/cfgs/serial_useful_computation.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ window_pixel_size 1
109109
window_labels_to_draw 1
110110
window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } }
111111
window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } }
112-
window_filter_module evt_type 2 60000018 60000023
113-
window_filter_module evt_type_label 2 "Executed OpenMP parallel function" "Executed OpenMP task function"
112+
window_filter_module evt_type 3 60000005 60000018 60000023
113+
window_filter_module evt_type_label 3 "OpenMP barrier" "Executed OpenMP parallel function" "Executed OpenMP task function"
114114
window_synchronize 1
115115

116116
################################################################################

pypop/dimemas.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,14 @@ def dimemas_idealise(tracefile, outpath=None):
4949
with zipopen(tracefile, "rt") as fh:
5050
metadata = _parse_paraver_headerline(fh.readline().strip())
5151

52-
# Calculate ranks per node for Dimemas
53-
ranks_per_node = metadata.application_layout.commsize // metadata.nodes
54-
5552
# Populate run specfic config data
5653
subs = {
57-
"@NUM_NODES@": metadata.nodes,
58-
"@PROCS_PER_NODE@": metadata.procs_per_node[0],
59-
"@RANKS_PER_NODE@": ranks_per_node,
54+
"@NUM_NODES@": metadata.application_layout.commsize,
55+
"@PROCS_PER_NODE@": max(metadata.procs_per_node),
56+
"@RANKS_PER_NODE@": 1,
6057
"@COLLECTIVES_PATH@": IDEAL_COLL_PATH,
6158
}
6259

63-
# Try to handle odd layouts with one rank per node...
64-
if (
65-
len(set(metadata.procs_per_node)) != 1
66-
or ranks_per_node * metadata.nodes != metadata.application_layout.commsize
67-
):
68-
# Populate run specfic config data
69-
subs = {
70-
"@NUM_NODES@": metadata.application_layout.commsize,
71-
"@PROCS_PER_NODE@": 1,
72-
"@RANKS_PER_NODE@": 1,
73-
"@COLLECTIVES_PATH@": IDEAL_COLL_PATH,
74-
}
75-
7660
# Pass trace, run config and path to idealisation skeleton config and let
7761
# dimemas_analyze work its subtle magic(k)s
7862
return dimemas_analyse(
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Number of processes;1;2;4;8;16
2+
Parallel efficiency;99.925583;99.378252;97.349953;95.707736;95.151184
3+
Load balance;100.000000;99.760930;98.687584;98.280683;99.248259
4+
Communication efficiency;99.925583;99.616405;98.644580;97.382042;95.871892
5+
Serialization efficiency;100.000000;99.842359;99.203493;98.282015;97.952863
6+
Transfer efficiency;99.925583;99.773690;99.436599;99.084296;97.875538
7+
Computation scalability;100.000000;95.500319;92.390414;81.340933;61.436394
8+
Global efficiency;99.925583;94.906548;89.942024;77.849566;58.457456
9+
IPC scalability;100.000000;99.916598;99.745711;93.982492;82.262861
10+
Instruction scalability;100.000000;96.748633;95.788940;94.145829;91.017467
11+
Frequency scalability;100.000000;98.792129;96.697961;91.930815;82.053509
12+
Speedup;1.000000;1.899545;3.600360;6.232603;9.360158
13+
Average IPC;1.871993;1.870432;1.867233;1.759346;1.539955
14+
Average frequency (GHz);2.069905;2.044904;2.001556;1.902881;1.698430
15+
#
16+
#Runtime (us);21898659.14;11528373.56;6082352.21;3513565.33;2339560.72
17+
#Runtime (ideal);21884758.97;11504370.09;6051059.08;3486349.43;2310335.96
18+
#Useful duration (average);21882362.82;11456696.18;5921167.02;3362753.84;2226119.73
19+
#Useful duration (maximum);21882362.82;11484151.34;5999910.80;3421581.67;2242981.13
20+
#Useful duration (total);21882362.82;22913392.37;23684668.07;26902030.73;35617915.65
21+
#Useful duration (ideal, max);21884758.97;11486234.50;6002862.00;3426454.46;2263040.22
22+
#Useful instructions (total);84790848422.00;87640358419.00;88518412143.00;90063308642.00;93158874793.00
23+
#Useful cycles (total);45294421893.00;46855679955.00;47406198069.00;51191361663.00;60494538119.00

pypop/metrics/metricset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def _choose_ref_key(stats_dict):
107107
return min(
108108
stats_dict.items(),
109109
key=lambda x: "{:05}_{:05}".format(
110-
x[1].metadata.total_threads, x[1].metadata.threads_per_process[0]
110+
sum(x[1].metadata.threads_per_process),
111+
max(x[1].metadata.threads_per_process),
111112
),
112113
)[0]
113114

pypop/trace/prvtrace.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"../cfgs/serial_useful_computation_omp_task.cfg",
2828
"../cfgs/serial_useful_computation_no_omp.cfg",
2929
),
30-
"Total Runtime": ("../cfgs/total_runtime.cfg",),
30+
"Total Runtime": (
31+
"../cfgs/total_runtime_excl_disabled.cfg",
32+
"../cfgs/total_runtime.cfg",),
3133
"Useful Instructions": ("../cfgs/useful_instructions.cfg",),
3234
"Useful Cycles": ("../cfgs/useful_cycles.cfg",),
3335
}.items()

pypop/version.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python3
2+
3+
from warnings import warn
4+
from pkg_resources import resource_filename
5+
from subprocess import run, PIPE
6+
7+
_k_unknown_ver = "Unknown"
8+
9+
def get_git_verstring():
10+
git_result = run(
11+
['git', 'describe', '--tags', '--dirty', '--long'],
12+
stdout=PIPE,
13+
stderr=PIPE,
14+
)
15+
if git_result.returncode != 0:
16+
return _k_unknown_ver
17+
18+
ver_string = git_result.stdout.decode().strip()
19+
ver_tokens = ver_string.split('-')
20+
21+
dirty = None
22+
if ver_tokens[-1] == "dirty":
23+
dirty = ver_tokens.pop()
24+
25+
sha = ver_tokens.pop()
26+
commitcount = ver_tokens.pop()
27+
tag = '-'.join(ver_tokens)
28+
29+
if commitcount == '0':
30+
return "-".join([tag, dirty]) if dirty else tag
31+
32+
return ver_string
33+
34+
35+
def get_version():
36+
37+
gitver = get_git_verstring()
38+
if gitver != _k_unknown_ver:
39+
return gitver
40+
41+
try:
42+
with open(resource_filename(__name__, 'version'), 'rt') as fh:
43+
fileversion = fh.readlines()[0].strip()
44+
return fileversion
45+
except FileNotFoundError:
46+
pass
47+
48+
return _k_unknown_ver

0 commit comments

Comments
 (0)