Skip to content

Commit 8890288

Browse files
committed
---
yaml --- r: 301322 b: refs/heads/anj/transpose c: 5287930 h: refs/heads/master
1 parent 47b4473 commit 8890288

16 files changed

Lines changed: 183 additions & 48 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ refs/heads/kf/uvint32: eaeee720ed1d4109801549813c7bdbe5d16c75e4
3535
"refs/heads/sjk/return_type": bea6a57566034aaf880b7f380e9e4e7cea9733a3
3636
refs/heads/tan/sparse: 27e4b6914cdc5ef685cb832dd194348164caec10
3737
refs/heads/kf/mmap: 64facb8fd791faf0a5f0768be2e2e2f320e1f2eb
38-
refs/heads/anj/transpose: d61a09ad8ae6c5d3f9f2a9902f638f3eafdae938
38+
refs/heads/anj/transpose: 5287930780545fba8a05a53970f5ddf49cd1e053
3939
"refs/heads/jn/cond_module": 687ae19896c164292399bb73c19154bf68976ee5
4040
refs/heads/teh/multiprocloading: eabdd0f2c48ad31007266c46fe3aad7f987c6d41
4141
refs/heads/kf/replfixes: 1c345c7d9598b0ae5d4818ecdba1eb25a170bd77

branches/anj/transpose/base/complex.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ reim(z) = (real(z), imag(z))
3737
real{T<:Real}(::Type{T}) = T
3838
real{T<:Real}(::Type{Complex{T}}) = T
3939

40+
complex{T<:Real}(::Type{T}) = Complex{T}
41+
complex{T<:Real}(::Type{Complex{T}}) = Complex{T}
42+
4043
isreal(x::Real) = true
4144
isreal(z::Complex) = imag(z) == 0
4245
isimag(z::Number) = real(z) == 0

branches/anj/transpose/base/inference.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,6 +2721,14 @@ function inlineable(f::ANY, e::Expr, atype::ANY, sv::StaticVarInfo, enclosing_as
27212721
expr = lastexpr.args[1]
27222722
end
27232723

2724+
if length(stmts) == 1
2725+
# remove line number when inlining a single expression. see issue #13725
2726+
s = stmts[1]
2727+
if isa(s,Expr)&&is(s.head,:line) || isa(s,LineNumberNode)
2728+
pop!(stmts)
2729+
end
2730+
end
2731+
27242732
if isa(expr,Expr)
27252733
old_t = e.typ
27262734
if old_t <: expr.typ

branches/anj/transpose/base/loading.jl

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ end
138138

139139
# returns an array of modules loaded, or nothing if failed
140140
function _require_from_serialized(node::Int, mod::Symbol, path_to_try::ByteString, toplevel_load::Bool)
141+
if JLOptions().use_compilecache == 0
142+
return nothing
143+
end
141144
restored = nothing
142145
if toplevel_load && myid() == 1 && nprocs() > 1
143146
recompile_stale(mod, path_to_try)
@@ -177,6 +180,9 @@ function _require_from_serialized(node::Int, mod::Symbol, path_to_try::ByteStrin
177180
end
178181

179182
function _require_from_serialized(node::Int, mod::Symbol, toplevel_load::Bool)
183+
if JLOptions().use_compilecache == 0
184+
return nothing
185+
end
180186
if node == myid()
181187
paths = find_all_in_cache_path(mod)
182188
else
@@ -234,8 +240,10 @@ precompilableerror(ex, c) = false
234240
# to be prevent it from being precompiled (false). __precompile__(true) is
235241
# ignored except within "require" call.
236242
function __precompile__(isprecompilable::Bool=true)
237-
if myid() == 1 && isprecompilable != (0 != ccall(:jl_generating_output, Cint, ())) &&
238-
!(isprecompilable && toplevel_load::Bool)
243+
if (myid() == 1 &&
244+
JLOptions().use_compilecache != 0 &&
245+
isprecompilable != (0 != ccall(:jl_generating_output, Cint, ())) &&
246+
!(isprecompilable && toplevel_load::Bool))
239247
throw(PrecompilableError(isprecompilable))
240248
end
241249
end
@@ -246,19 +254,21 @@ function require_modname(name::AbstractString)
246254
# While we could also strip off the absolute path, the user may be
247255
# deliberately directing to a different file than what got
248256
# cached. So this takes a conservative approach.
249-
if endswith(name, ".jl")
250-
tmp = name[1:end-3]
251-
for prefix in LOAD_CACHE_PATH
252-
path = joinpath(prefix, tmp*".ji")
253-
if isfile(path)
254-
return tmp
257+
if Bool(JLOptions().use_compilecache)
258+
if endswith(name, ".jl")
259+
tmp = name[1:end-3]
260+
for prefix in LOAD_CACHE_PATH
261+
path = joinpath(prefix, tmp*".ji")
262+
if isfile(path)
263+
return tmp
264+
end
255265
end
256266
end
257267
end
258-
name
268+
return name
259269
end
260270

261-
doc"""
271+
"""
262272
reload(name::AbstractString)
263273
264274
Force reloading of a package, even if it has been loaded before. This is intended for use
@@ -305,7 +315,6 @@ function require(mod::Symbol)
305315
end
306316
return
307317
end
308-
309318
name = string(mod)
310319
path = find_in_node_path(name, nothing, 1)
311320
if path === nothing
@@ -347,9 +356,8 @@ include_string(txt::ByteString, fname::ByteString) =
347356
ccall(:jl_load_file_string, Any, (Ptr{UInt8},Csize_t,Ptr{UInt8},Csize_t),
348357
txt, sizeof(txt), fname, sizeof(fname))
349358

350-
include_string(txt::AbstractString, fname::AbstractString) = include_string(bytestring(txt), bytestring(fname))
351-
352-
include_string(txt::AbstractString) = include_string(txt, "string")
359+
include_string(txt::AbstractString, fname::AbstractString="string") =
360+
include_string(bytestring(txt), bytestring(fname))
353361

354362
function source_path(default::Union{AbstractString,Void}="")
355363
t = current_task()
@@ -436,9 +444,7 @@ function create_expr_cache(input::AbstractString, output::AbstractString)
436444
serialize(io, :(Base._track_dependencies[1] = true))
437445
serialize(io, :(Base.include($(abspath(input)))))
438446
if source !== nothing
439-
serialize(io, quote
440-
delete!(task_local_storage(), :SOURCE_PATH)
441-
end)
447+
serialize(io, :(delete!(task_local_storage(), :SOURCE_PATH)))
442448
end
443449
close(io)
444450
wait(pobj)

branches/anj/transpose/base/options.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ immutable JLOptions
2828
worker::Int8
2929
handle_signals::Int8
3030
use_precompiled::Int8
31+
use_compilecache::Int8
3132
bindto::Ptr{UInt8}
3233
outputbc::Ptr{UInt8}
3334
outputo::Ptr{UInt8}
@@ -36,3 +37,17 @@ immutable JLOptions
3637
end
3738

3839
JLOptions() = unsafe_load(cglobal(:jl_options, JLOptions))
40+
41+
function show(io::IO, opt::JLOptions)
42+
println(io, "JLOptions(")
43+
fields = fieldnames(opt)
44+
nfields = length(fields)
45+
for (i,f) in enumerate(fieldnames(opt))
46+
v = getfield(opt,f)
47+
if isa(v, Ptr{UInt8})
48+
v = v != C_NULL ? bytestring(v) : ""
49+
end
50+
println(io, " ", f, " = ", repr(v), i < nfields ? "," : "")
51+
end
52+
print(io,")")
53+
end

branches/anj/transpose/base/pkg/entry.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ function build!(pkgs::Vector, errs::Dict, seen::Set=Set())
543543
end
544544
"""
545545
io, pobj = open(detach(`$(Base.julia_cmd())
546+
--compilecache=$(Bool(Base.JLOptions().use_compilecache) ? "yes" : "no")
546547
--history-file=no
547548
--color=$(Base.have_color ? "yes" : "no")
548549
--eval $code`), "w", STDOUT)

branches/anj/transpose/deps/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ ifeq ($(BUILD_LLDB),1)
645645
(cd $(LLVM_SRC_DIR)/tools/lldb && \
646646
git pull --ff-only)
647647
ifneq ($(LLVM_GIT_VER_LLDB),)
648-
(cd $(LLVM_SRC_DIR)/tools/LLDB && \
648+
(cd $(LLVM_SRC_DIR)/tools/lldb && \
649649
git checkout $(LLVM_GIT_VER_LLDB))
650650
endif # LLVM_GIT_VER_CLANG
651651
endif # BUILD_LLDB

branches/anj/transpose/doc/man/julia.1

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ If a Julia source file is given as a \fIprogram\fP (optionally followed by
5454

5555
.\" This section was taken nearly verbatim from the output of `julia --help`
5656
.SH "COMMAND-LINE OPTIONS"
57-
.TP 25
5857

5958
.TP
6059
-v, --version
@@ -65,13 +64,25 @@ Display version information
6564
Print help message
6665

6766
.TP
68-
-q, --quiet
69-
Quiet startup without banner
67+
-J, --sysimage <file>
68+
Start up with the given system image file
69+
70+
.TP
71+
-precompiled={yes|no}
72+
Use precompiled code from system image if available
7073

7174
.TP
7275
-H, --home <dir>
7376
Set location of julia executable
7477

78+
.TP
79+
--startup-file={yes|no}
80+
Load ~/.juliarc.jl
81+
82+
.TP
83+
--handle-signals={yes|no}
84+
Enable or disable Julia's default signal handlers
85+
7586
.TP
7687
-e, --eval <expr>
7788
Evaluate <expr>
@@ -88,14 +99,6 @@ Evaluate <expr>, but don't disable interactive mode
8899
-L, --load <file>
89100
Load <file> immediately on all processors
90101

91-
.TP
92-
-J, --sysimage <file>
93-
Start up with the given system image file
94-
95-
.TP
96-
-C, --cpu-target <target>
97-
Limit usage of cpu features up to <target>
98-
99102
.TP
100103
-p, --procs <n>
101104
Run n local processes
@@ -108,6 +111,10 @@ Run processes on hosts listed in <file>
108111
-i
109112
Force isinteractive() to be true
110113

114+
.TP
115+
-q, --quiet
116+
Quiet startup without banner
117+
111118
.TP
112119
--color={yes|no}
113120
Enable or disable color text
@@ -117,45 +124,57 @@ Enable or disable color text
117124
Load or save history
118125

119126
.TP
120-
--startup-file={yes|no}
121-
Load ~/.juliarc.jl
122-
123-
.TP
124-
--compile={yes|no|all}
127+
--compile={yes|no|all}
125128
Enable or disable compiler, or request exhaustive compilation
126129

127130
.TP
128-
--code-coverage={none|user|all}, --code-coverage
129-
Count executions of source lines (omitting setting is equivalent to 'user')
130-
131-
.TP
132-
--track-allocation={none|user|all}, --track-allocation
133-
Count bytes allocated by each source line
131+
-C, --cpu-target <target>
132+
Limit usage of cpu features up to <target>
134133

135134
.TP
136135
-O, --optimize
137136
Run time-intensive code optimizations
138137

138+
.TP
139+
--inline={yes|no}
140+
Control whether inlining is permitted (overrides functions declared as @inline)
141+
139142
.TP
140143
--check-bounds={yes|no}
141144
Emit bounds checks always or never (ignoring declarations)
142145

143146
.TP
144-
--dump-bitcode={yes|no}
145-
Dump bitcode for the system image (used with --build)
147+
--math-mode={ieee|user}
148+
Always use IEEE semantics for math (ignoring declarations),
149+
or adhere to declarations in source code
146150

147151
.TP
148152
--depwarn={yes|no|error}
149153
Enable or disable syntax and method deprecation warnings ('error' turns warnings into errors)
150154

151155
.TP
152-
--inline={yes|no}
153-
Control whether inlining is permitted (overrides functions declared as @inline)
156+
--output-o name
157+
Generate an object file (including system image data)
154158

155159
.TP
156-
--math-mode={ieee|user}
157-
Always use IEEE semantics for math (ignoring declarations),
158-
or adhere to declarations in source code
160+
--output-ji name
161+
Generate a system image data file (.ji)
162+
163+
.TP
164+
--output-bc name
165+
Generate LLVM bitcode (.bc)
166+
167+
.TP
168+
--output-incremental=no
169+
Generate an incremental output file (rather than complete)
170+
171+
.TP
172+
--code-coverage={none|user|all}, --code-coverage
173+
Count executions of source lines (omitting setting is equivalent to 'user')
174+
175+
.TP
176+
--track-allocation={none|user|all}, --track-allocation
177+
Count bytes allocated by each source line
159178

160179
.SH FILES
161180
.I ~/.juliarc.jl

branches/anj/transpose/doc/manual/getting-started.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ those available for the ``perl`` and ``ruby`` programs::
112112

113113
-J, --sysimage <file> Start up with the given system image file
114114
--precompiled={yes|no} Use precompiled code from system image if available
115+
--compilecache={yes|no} Enable/disable incremental precompilation of modules\n"
115116
-H, --home <dir> Set location of julia executable
116117
--startup-file={yes|no} Load ~/.juliarc.jl
117118
-f, --no-startup Don't load ~/.juliarc (deprecated, use --startup-file=no)

branches/anj/transpose/doc/manual/modules.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,3 +419,9 @@ A few other points to be aware of:
419419

420420
4. WeakRef objects and finalizers are not currently handled properly by the serializer
421421
(this will be fixed in an upcoming release).
422+
423+
It is sometimes helpful during module development to turn off incremental precompilation.
424+
The command line flag ``--compilecache={yes|no}`` enables you to toggle module precompilation on and off.
425+
When Julia is started with ``--compilecache=no`` the serialized modules in the compile cache are ignored when loading modules and module dependencies.
426+
``Base.compilecache()`` can still be called manually and it will respect ``__precompile__()`` directives for the module.
427+
The state of this command line flag is passed to ``Pkg.build()`` to disable automatic precompilation triggering when installing, updating, and explicitly building packages.

0 commit comments

Comments
 (0)