-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_api.py
More file actions
98 lines (85 loc) · 1.53 KB
/
test_api.py
File metadata and controls
98 lines (85 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
"""
Author: Ahmad Tarraf
Copyright (c) 2026 TU Darmstadt, Germany
Version: v0.0.8
Licensed under the BSD 3-Clause License.
For more information, see the LICENSE file in the project root:
https://github.com/tuda-parallel/FTIO/blob/main/LICENSE
"""
import numpy as np
from ftio.cli.ftio_core import core
from ftio.parse.args import parse_args
from ftio.parse.bandwidth import overlap
from ftio.processing.print_output import display_prediction
ranks = 10
total_bytes = 100
# Set up data
## 1) overlap for rank level metrics
b_rank = [
0.0,
0.0,
1000.0,
1000.0,
0.0,
0.0,
1000.0,
1000.0,
0.0,
0.0,
1000.0,
1000.0,
0.0,
0.0,
]
t_rank_s = [
0.5,
0.0,
10.5,
10.0,
20.5,
20.0,
30.5,
30.0,
40.5,
40.0,
50.5,
50.0,
60.5,
60,
]
t_rank_e = [
5.0,
4.5,
15.0,
14.5,
25.0,
24.5,
35.0,
34.5,
45.0,
44.5,
55.0,
54.5,
65.0,
64.5,
]
b, t = overlap(b_rank, t_rank_s, t_rank_e)
## 2) or directly specify the app level metrics
# t = [10.0, 20.1, 30.0, 40.2, 50.3, 60, 70, 80.0,]
# b = [10, 0, 10, 0, 10, 0, 10, 0]
# command line arguments
argv = ["-e", "no"] # ["-e", "mat"]
# set up data
data = {
"time": np.array(t),
"bandwidth": np.array(b),
"total_bytes": total_bytes,
"ranks": ranks,
}
# parse args
args = parse_args(argv, "ftio")
# perform prediction
prediction, analysis_figures = core(data, args)
# plot and print info
analysis_figures.show()
display_prediction(args, prediction)