|
27 | 27 | import gzip
|
28 | 28 | import os.path
|
29 | 29 | import shutil
|
| 30 | +from pathlib import Path |
30 | 31 | from urllib.request import urlretrieve
|
31 | 32 |
|
32 | 33 | from testlib import *
|
33 | 34 |
|
34 |
| -resource_path = joinpath(absdirpath(__file__), "..", "gpu-pannotia-resources") |
| 35 | +resource_path = joinpath( |
| 36 | + absdirpath(__file__), "..", "resources", "gpu-pannotia" |
| 37 | +) |
35 | 38 | binary_path = joinpath(resource_path, "pannotia-bins")
|
36 | 39 | dataset_path = joinpath(resource_path, "pannotia-datasets")
|
37 | 40 |
|
|
57 | 60 | "G3_circuit.graph": "https://storage.googleapis.com/dist.gem5.org/dist/develop/datasets/pannotia/mis/G3_circuit.graph",
|
58 | 61 | "ecology1.graph": "https://storage.googleapis.com/dist.gem5.org/dist/develop/datasets/pannotia/mis/ecology1.graph",
|
59 | 62 | "coAuthorsDBLP.graph": "https://storage.googleapis.com/dist.gem5.org/dist/develop/datasets/pannotia/pagerank/coAuthorsDBLP.graph",
|
60 |
| - "USA-road-d.NY.gr.gz": "http://www.diag.uniroma1.it/challenge9/data/USA-road-d/USA-road-d.NY.gr.gz", |
| 63 | + "USA-road-d.NY.gr": "https://storage.googleapis.com/dist.gem5.org/dist/develop/datasets/pannotia/USA-road-d/USA-road-d.NY.gr", |
61 | 64 | }
|
62 | 65 |
|
63 | 66 |
|
|
66 | 69 | os.makedirs(dataset_path)
|
67 | 70 |
|
68 | 71 | for name in binary_links.keys():
|
| 72 | + if Path(f"{binary_path}/{name}").exists(): |
| 73 | + continue |
69 | 74 | urlretrieve(binary_links[name], f"{binary_path}/{name}")
|
70 | 75 | for name in dataset_links.keys():
|
| 76 | + if Path(f"{dataset_path}/{name}").exists(): |
| 77 | + continue |
71 | 78 | urlretrieve(dataset_links[name], f"{dataset_path}/{name}")
|
72 | 79 |
|
73 |
| - with gzip.open(f"{dataset_path}/USA-road-d.NY.gr.gz", "rb") as f_in: |
74 |
| - with open(f"{dataset_path}/USA-road-d.NY.gr", "wb") as f_out: |
75 |
| - shutil.copyfileobj(f_in, f_out) |
76 |
| - os.remove(f"{dataset_path}/USA-road-d.NY.gr.gz") |
77 |
| - |
78 | 80 | if len(os.listdir(binary_path)) < len(binary_links):
|
79 | 81 | testlib.log.test_log.warn(
|
80 | 82 | "One or more binaries for the Pannotia GPU tests are missing! Try deleting gpu-pannotia-resources and rerunning."
|
|
0 commit comments