forked from accel-sim/accel-sim-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_posted_hw_stats.py
More file actions
executable file
·64 lines (57 loc) · 1.57 KB
/
get_posted_hw_stats.py
File metadata and controls
executable file
·64 lines (57 loc) · 1.57 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
#!/usr/bin/env python3
from optparse import OptionParser
import re
import os
import subprocess
from subprocess import Popen, STDOUT
import sys
this_directory = os.path.dirname(os.path.realpath(__file__)) + "/"
data_root = os.path.join(this_directory, "..", "..", "hw_run")
cards_availible = [
"fermi-gtx480",
"kepler-titan",
"pascal-titanx",
"pascal-p100",
"pascal-1080ti",
"volta-titanv",
"volta-quadro-v100",
"volta-tesla-v100",
"turing-rtx2060",
"ampere-rtx3070",
]
parser = OptionParser()
parser.add_option(
"-c",
"--cards",
dest="cards",
default="all",
help="Comma seperated list of cards to download. Available cards: {0}".format(
cards_availible
),
)
(options, args) = parser.parse_args()
os.makedirs(data_root, exist_ok=True)
if "all" == options.cards:
options.cards = ",".join(cards_availible)
for card in options.cards.split(","):
if card not in cards_availible:
sys.exit(
'Error, wrong card name "{0}". Valid names: all or {1}'.format(
card, cards_availible
)
)
tarfilename = card + ".tgz"
folder_path = os.path.join(data_root, card)
if not os.path.exists(folder_path):
subprocess.run(
[
"wget",
"https://engineering.purdue.edu/tgrogers/gpgpu-sim/hw_data/{0}".format(
tarfilename
),
]
)
subprocess.run(["tar", "-xzvf", tarfilename, "-C", data_root])
os.remove(tarfilename)
else:
print("Found " + folder_path)