-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_ga.py
70 lines (60 loc) · 2.15 KB
/
config_ga.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
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
import os
import sys
# global arrays
ga_url = "http://hpc.pnl.gov/globalarrays/download/ga-5-3.tgz"
ga_dir = "ga-5-3"
ga_tgz = ga_dir + ".tgz"
#blas
blas_inc = "/opt/apps/intel/13/composer_xe_2013_sp1.1.106/mkl/include"
blas_libdir = "/opt/apps/intel/13/composer_xe_2013_sp1.1.106/mkl/lib/intel64"
blas_libs = "-lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -liomp5"
lapack_inc = blas_inc
lapack_libdir = blas_libdir
lapack_libs = blas_libs
scalapack_inc = blas_inc
scalapack_libdir = blas_libdir
scalapack_libs = "-lmkl_scalapack_lp64"
#mpi
mpi_inc = "/opt/apps/intel14/mvapich2/2.0b/include"
mpi_libdir = "/opt/apps/intel14/mvapich2/2.0b/lib"
mpi_libs = ""
#openib
openib_device = "mlx4_0"
openib_inc = "/opt/ofed/include"
openib_libdir = "/opt/ofed/lib64"
openib_libs = "-libumad -libverbs"
# initialize variales
str = os.popen("pwd").read()
pwdir = str.strip("\n")
install_dir = pwdir + "/GAlib-armci"
config_cmd = "./configure"
config_cmd += " --prefix=" + install_dir
config_cmd += " --with-blas=\"" + "-I" + blas_inc + " -L" + blas_libdir + " " + blas_libs + "\""
config_cmd += " --with-lapack=\"" + "-I" + lapack_inc + " -L" + lapack_libdir + " " + lapack_libs + "\""
config_cmd += " --with-scalapack=\"" + "-I" + scalapack_inc + " -L" + scalapack_libdir + " " + scalapack_libs + "\""
config_cmd += " --with-mpi=\"" + "-I" + mpi_inc + " -L" + mpi_libdir + " " + mpi_libs + "\""
with_openib = False
download_ga = False
# parse arguments
for str in sys.argv:
if str == sys.argv[0]:
print "Config global arrays"
elif str == "download":
download_ga = True
elif str == "openib":
with_openib = True
else:
print "Usage: " + sys.argv[0] + " <openib> <download>"
sys.exit(0)
if download_ga:
os.system("wget " + ga_url + " -O " + ga_tgz)
os.system("tar xzf " + ga_tgz)
os.system ("rm -f " + ga_tgz)
if with_openib:
config_cmd += " --with-openib=\"" + "-I" + openib_inc + " -L" + openib_libdir + " " + openib_libs + "\""
print config_cmd
os.chdir(ga_dir)
os.system("export ARMCI_OPENIB_DEVICE=\"" + openib_device + "\"")
os.system(config_cmd)
os.system("make CC=icc FC=ifort MPICC=mpicc")
os.system("make install")