Skip to content

Commit 587f36b

Browse files
committed
Merge branch 'jb/new-ctors' of github.com:JuliaLang/julia into jb/new-ctors
2 parents 3766f34 + c07d850 commit 587f36b

File tree

3 files changed

+51
-40
lines changed

3 files changed

+51
-40
lines changed

Make.inc

-12
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ EXTROOT = $(JULIAHOME)/external/root
33
EXTROOTLIB = $(EXTROOT)/lib
44
LLVMROOT = $(EXTROOT)
55
OS = $(shell uname)
6-
DOWNLOAD = curl -O
7-
#DOWNLOAD = wget
86

97
CC = gcc
108
CXX = g++
@@ -31,13 +29,3 @@ ifeq ($(OS), Darwin)
3129
SHLIB_EXT = dylib
3230
OSLIBS += -Wl,-w -framework ApplicationServices
3331
endif
34-
35-
# Library versions for building external libraries
36-
37-
LLVM_VER = 2.9
38-
READLINE_VER = 6.2
39-
PCRE_VER = 8.12
40-
LAPACK_VER = 3.3.1
41-
ARPACK_VER = 96
42-
FFTW_VER = 3.2.2
43-
MONGOOSE_VER = 3.0

external/Makefile

+38-23
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1+
## Library Versions ##
2+
3+
LLVM_VER = 2.9
4+
READLINE_VER = 6.2
5+
PCRE_VER = 8.12
6+
OPENBLAS_VER = v0.1alpha2
7+
LAPACK_VER = 3.3.1
8+
ARPACK_VER = 96
9+
FFTW_VER = 3.2.2
10+
MONGOOSE_VER = 3.0
11+
12+
## High-Level Setup ##
13+
114
JULIAHOME = $(shell pwd)/..
215
include ../Make.inc
316

417
OS = $(shell uname)
518
ARCH = $(shell uname -m)
6-
LIBS = llvm pcre fdlibm lapack arpack fftw mongoose readline
19+
LIBS = llvm pcre fdlibm openblas lapack arpack fftw mongoose readline
720

821
default: install
922
compile: $(addprefix compile-, $(LIBS))
@@ -21,7 +34,7 @@ compile-llvm: $(LLVM_OBJ_SOURCE)
2134
install-llvm: $(LLVM_OBJ_TARGET)
2235

2336
llvm-$(LLVM_VER).tgz:
24-
$(DOWNLOAD) http://llvm.org/releases/$(LLVM_VER)/$@
37+
curl -O http://llvm.org/releases/$(LLVM_VER)/$@
2538
llvm-$(LLVM_VER)/configure: llvm-$(LLVM_VER).tgz
2639
tar zxf $<
2740
touch $@
@@ -48,7 +61,7 @@ compile-readline: $(READLINE_OBJ_SOURCE)
4861
install-readline: $(READLINE_OBJ_TARGET)
4962

5063
readline-$(READLINE_VER).tar.gz:
51-
$(DOWNLOAD) ftp://ftp.gnu.org/gnu/readline/$@
64+
curl -O ftp://ftp.gnu.org/gnu/readline/$@
5265
readline-$(READLINE_VER)/configure: readline-$(READLINE_VER).tar.gz
5366
tar zxf $<
5467
touch $@
@@ -75,9 +88,9 @@ compile-pcre: install-pcre
7588
install-pcre: $(PCRE_OBJ_TARGET)
7689

7790
pcre-$(PCRE_VER).tar.bz2:
78-
$(DOWNLOAD) ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$@
91+
curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$@
7992
pcre-$(PCRE_VER)/configure: pcre-$(PCRE_VER).tar.bz2
80-
tar jxvf $<
93+
tar jxf $<
8194
touch $@
8295
pcre-$(PCRE_VER)/config.status: pcre-$(PCRE_VER)/configure
8396
cd pcre-$(PCRE_VER) && \
@@ -102,7 +115,7 @@ install-fdlibm: $(FDLIBM_OBJ_TARGET)
102115

103116
$(FDLIBM_OBJ_SOURCE): fdlibm/*.c
104117
cd fdlibm && \
105-
make CC=$(CC) CFLAGS="-D_IEEE_LIBM -Dx86 -fPIC -O2 -mtune=native $(CONFIG)" && \
118+
make CC=$(CC) CFLAGS="-D_IEEE_LIBM -Dx86 -fPIC -O2 $(CONFIG)" && \
106119
$(CC) -shared *.o -o libfdm.$(SHLIB_EXT)
107120
$(FDLIBM_OBJ_TARGET): $(FDLIBM_OBJ_SOURCE)
108121
mkdir -p $(EXTROOTLIB)
@@ -115,23 +128,23 @@ distclean-fdlibm: clean-fdlibm
115128

116129
## OpenBLAS ##
117130

118-
OPENBLAS_OBJ_SOURCE = openblas/libopenblas.a
131+
OPENBLAS_OBJ_SOURCE = openblas-$(OPENBLAS_VER)/libopenblas.a
119132

120133
compile-openblas: $(OPENBLAS_OBJ_SOURCE)
134+
install-openblas: compile-openblas
121135

122-
openblas.tar.gz:
123-
$(DOWNLOAD) -Lk https://github.com/xianyi/OpenBLAS/tarball/develop
124-
mv develop $@
125-
openblas/Makefile: openblas.tar.gz
126-
mkdir -p openblas && tar --strip-components 1 -C openblas -xf $<
136+
openblas-$(OPENBLAS_VER).tar.gz:
137+
curl -Lk https://github.com/xianyi/OpenBLAS/tarball/$(OPENBLAS_VER) > $@
138+
openblas-$(OPENBLAS_VER)/Makefile: openblas-$(OPENBLAS_VER).tar.gz
139+
mkdir -p openblas-$(OPENBLAS_VER) && tar -C openblas-$(OPENBLAS_VER) --strip-components 1 -xf $<
127140
touch $@
128-
$(OPENBLAS_OBJ_SOURCE): openblas/Makefile
129-
make -C openblas USE_THREAD=0 NO_CBLAS=1 NO_LAPACK=1 CC=$(CC) FC=$(FC)
141+
$(OPENBLAS_OBJ_SOURCE): openblas-$(OPENBLAS_VER)/Makefile
142+
make -C openblas-$(OPENBLAS_VER) USE_THREAD=0 NO_CBLAS=1 NO_LAPACK=1 CC=$(CC) FC=$(FC)
130143

131144
clean-openblas:
132-
make -C openblas clean
145+
make -C openblas-$(OPENBLAS_VER) clean
133146
distclean-openblas:
134-
rm -rf openblas.tar.gz openblas
147+
rm -rf openblas-$(OPENBLAS_VER).tar.gz openblas-$(OPENBLAS_VER)
135148

136149
## LAPACK ##
137150

@@ -142,14 +155,16 @@ compile-lapack: $(LAPACK_OBJ_SOURCE)
142155
install-lapack: $(LAPACK_OBJ_TARGET)
143156

144157
lapack-$(LAPACK_VER).tgz:
145-
$(DOWNLOAD) http://www.netlib.org/lapack/$@
158+
curl -O http://www.netlib.org/lapack/$@
146159
lapack-$(LAPACK_VER)/Makefile: lapack-$(LAPACK_VER).tgz
147160
tar zxf $<
148161
touch $@
149-
$(LAPACK_OBJ_SOURCE): lapack-$(LAPACK_VER)/Makefile $(OPENBLAS_OBJ_SOURCE)
162+
lapack-$(LAPACK_VER)/INSTALL/dlamch.o: lapack-$(LAPACK_VER)/Makefile
150163
cd lapack-$(LAPACK_VER) && \
151164
cp INSTALL/make.inc.gfortran ./make.inc && \
152-
make lapacklib NOOPT="-O0 -fPIC" OPTS="-O2 -fPIC" FORTRAN=$(FC) && \
165+
make lapacklib NOOPT="-O0 -fPIC" OPTS="-O2 -fPIC" FORTRAN=$(FC)
166+
$(LAPACK_OBJ_SOURCE): lapack-$(LAPACK_VER)/INSTALL/dlamch.o $(OPENBLAS_OBJ_SOURCE)
167+
cd lapack-$(LAPACK_VER) && \
153168
$(FC) -shared SRC/*.o INSTALL/dlamch.o INSTALL/dsecnd_INT_ETIME.o INSTALL/ilaver.o INSTALL/slamch.o ../$(OPENBLAS_OBJ_SOURCE) -o libLAPACK.$(SHLIB_EXT)
154169
$(LAPACK_OBJ_TARGET): $(LAPACK_OBJ_SOURCE)
155170
mkdir -p $(EXTROOTLIB)
@@ -170,9 +185,9 @@ compile-arpack: $(ARPACK_OBJ_SOURCE)
170185
install-arpack: $(ARPACK_OBJ_TARGET)
171186

172187
arpack$(ARPACK_VER).tar.gz:
173-
$(DOWNLOAD) http://www.caam.rice.edu/software/ARPACK/SRC/$@
188+
curl -O http://www.caam.rice.edu/software/ARPACK/SRC/$@
174189
arpack-patch.tar.gz:
175-
$(DOWNLOAD) http://www.caam.rice.edu/software/ARPACK/SRC/patch.tar.gz
190+
curl -O http://www.caam.rice.edu/software/ARPACK/SRC/patch.tar.gz
176191
mv patch.tar.gz $@
177192
ARPACK/Makefile: arpack$(ARPACK_VER).tar.gz arpack-patch.tar.gz
178193
for x in $^; do tar zxf $$x; done
@@ -201,7 +216,7 @@ compile-fftw: install-fftw
201216
install-fftw: $(FFTW_OBJ_TARGET)
202217

203218
fftw-$(FFTW_VER).tar.gz:
204-
$(DOWNLOAD) http://www.fftw.org/$@
219+
curl -O http://www.fftw.org/$@
205220
fftw-$(FFTW_VER)/configure: fftw-$(FFTW_VER).tar.gz
206221
tar zxf $<
207222
touch $@
@@ -226,7 +241,7 @@ compile-mongoose: mongoose/Makefile
226241
install-mongoose: compile-mongoose
227242

228243
mongoose-$(MONGOOSE_VER).tgz:
229-
$(DOWNLOAD) http://mongoose.googlecode.com/files/mongoose-$(MONGOOSE_VER).tgz
244+
curl -O http://mongoose.googlecode.com/files/mongoose-$(MONGOOSE_VER).tgz
230245
mongoose/Makefile: mongoose-$(MONGOOSE_VER).tgz
231246
tar zxf $<
232247
touch $@

test/bench/hpl_par.j

+13-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
# The matrix A is local to the first Worker, which allocates work to other Workers
66
# All updates to A are carried out by the first Worker. Thus A is not distributed
77

8-
function hpl_par(A::Matrix, b::Vector)
8+
hpl_par(A::Matrix, b::Vector) = hpl_par(A, b, true)
9+
10+
function hpl_par(A::Matrix, b::Vector, run_parallel::Bool)
911

1012
blocksize = 5
1113

@@ -53,15 +55,21 @@ function hpl_par(A::Matrix, b::Vector)
5355
J = (B_cols[j]+1):B_cols[j+1]
5456

5557
## Do the trailing update (Compute U, and DGEMM - all flops are here)
56-
depend[i+1,j] = @spawn trailing_update(L_II, A[I,J], A[K,I], A[K,J], depend[i+1,i], depend[i,j])
57-
#depend[i+1,j] = trailing_update(L_II, A[I,J], A[K,I], A[K,J], depend[i+1,i], depend[i,j])
58+
if run_parallel
59+
depend[i+1,j] = @spawn trailing_update(L_II, A[I,J], A[K,I], A[K,J], depend[i+1,i], depend[i,j])
60+
else
61+
depend[i+1,j] = trailing_update(L_II, A[I,J], A[K,I], A[K,J], depend[i+1,i], depend[i,j])
62+
end
5863
end
5964

6065
# Wait for all trailing updates to complete, and write back to A
6166
for j=(i+1):nB
6267
J = (B_cols[j]+1):B_cols[j+1]
63-
(A_IJ, A_KJ) = fetch(depend[i+1,j])
64-
#(A_IJ, A_KJ) = depend[i+1,j]
68+
if run_parallel
69+
(A_IJ, A_KJ) = fetch(depend[i+1,j])
70+
else
71+
(A_IJ, A_KJ) = depend[i+1,j]
72+
end
6573
A[I,J] = A_IJ
6674
A[K,J] = A_KJ
6775
depend[i+1,j] = true

0 commit comments

Comments
 (0)