-
Notifications
You must be signed in to change notification settings - Fork 2
/
common.py
38 lines (34 loc) · 1.12 KB
/
common.py
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
import subprocess, pipes
packages = {
"atlas": {
"version": "3.10.3",
"archive": "atlas3.10.3.tar.bz2",
"extract_dir": "ATLAS",
"deps": []
},
"openmpi": {
"version": "1.6.3",
"archive": "openmpi-1.6.3.tar.bz2",
"extract_dir": "openmpi-1.6.3",
"deps": []
},
"hpl": {
"version": "2.1",
"archive": "hpl-2.1.tar.gz",
"extract_dir": "hpl-2.1",
"deps": [ "atlas", "openmpi" ]
}
}
node_working_dir = "/tmp/benchflops"
preparation_dir = "preparation"
def prepared_archive(package, cluster):
return "compiled-%s-%s-%s.tgz" % (package, packages[package]["version"], cluster)
def find_files(*args):
"""run find utility with given path(es) and parameters, return the result as a list"""
find_args = "find " + " ".join([pipes.quote(arg) for arg in args])
p = subprocess.Popen(find_args, shell = True,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
(stdout, stderr) = p.communicate()
p.wait()
return [ p for p in stdout.split("\n") if p ]