Re: [julia-users] SharedArray, featuring another extreme newbie question
You are doing it right. In the non-shared array case, it is indeed moving data. But in the shared array case, only references to the system shared memory segments are sent over, not the array data. On Tue, Sep 30, 2014 at 9:17 AM, Travis Porco see.the.gal...@gmail.com wrote: Configuration: Version 0.3.0 (2014-08-20 20:43 UTC), x86_64-apple-darwin13.3.0 julia -p 1 Make a shared array, no problem: julia S = SharedArray(Int, (5,11), init = S - S[localindexes(S)] = myid(),pids=[1, 2]) A similar nonshared array, also no problem: julia nonshared = zeros(5,11) Toy function, no problem: @everywhere function ssq(x) sum(x .^ 2) end Test ability to do something on the workers, seems to work fine: julia for ww in workers() remotecall(ww,println,ww) end julia From worker 2:2 I don't expect the nonshared object to be visible: julia @sync for ww in workers() remotecall_fetch(ww, x-println(ssq(nonshared[myid()-1,:])),ww) end exception on 2: ERROR: nonshared not defined in anonymous at none:2 in anonymous at multi.jl:855 in run_work_thunk at multi.jl:621 in anonymous at task.jl:855 Try to reference the shared array on the workers: julia for ww in workers() remotecall_fetch(ww, x-println(ssq(S[myid()-1,:])),ww) # I know the ww does nothing here end exception on 2: ERROR: S not defined in anonymous at none:2 in anonymous at multi.jl:855 in run_work_thunk at multi.jl:621 in anonymous at task.jl:855 S was supposed to be a shared array, but it can't find it; I expected S to be visible, since it's supposed to be a shared array. I can call the function on S: julia for ww in workers() remotecall_fetch(ww, x-println(ssq(x[myid()-1,:])),S) end From worker 2:26 but then again, the nonshared version works in this context too, and so I have to think it's moving the data from pid 1 over to 2, and then doing the computation. This makes me think the operation above with S is actually doing the same thing--moving the data in S from pid 1 to 2 rather than having 2 just having access to it. However, I don't fully understand the issues. julia for ww in workers() remotecall_fetch(ww, x-println(ssq(x[myid()-1,:])),nonshared) end From worker 2:0 So the question: is this normal behavior? If so, what is the right way to access S on the workers, avoiding moving data? The manual describes the SharedArray as experimental, so I have to check... I've looked around for some very elementary examples of this sort but must have missed them. Thanks.
[julia-users] Re: Label vector components
Hi again, Thanks for all the suggestions. I'm a bit ashamed I overlooked the part of the documentation about types. I skimmed through the DataFrames documentation and I don't think there's a way to access data via keys. As far as the two other solutions are concerned, I compared their performance on a very simple test case, here it is if it can be of any interest : n = 10 # Method 1: Type type parameters p1::Float64 p2::Float64 p3::Float64 end p_method_1 = parameters(3.6, 0.6, 600.0) function f1(p) for i = 1:n p.p1 += 0.1 p.p2 += 0.1 p.p3 += 0.1 end end # Method 2: Dictionnary p_method_2 = {p1 = 3.6, p2 = 0.6, p3 = 600.0} function f2(p) for i = 1:n p[p1] += 0.1 p[p2] += 0.1 p[p3] += 0.1 end end println(Method 1) println(p_method_1) @time f1(p_method_1) println(p_method_1) println(Method 2) println(p_method_2) @time f2(p_method_2) println(p_method_2) Here are the results: Method 1 parameters(3.6,0.6,600.0) elapsed time: 0.020289272 seconds (6610188 bytes allocated) parameters(10003.60018861,1.6001885,10600.00020964) Method 2 {p3=600.0,p2=0.6,p1=3.6} elapsed time: 0.120914516 seconds (16193368 bytes allocated) {p3=10600.00020964,p2=1.6001885,p1=10003.60018861} The first method is by far the most efficient.
[julia-users] curl: (22) The requested URL returned error: 403
Hi. I am installing julia on SUSE linux through SSH. I met this problem: :~/julia make Submodule 'deps/Rmath' () registered for path 'deps/Rmath' Submodule 'deps/libmojibake' () registered for path 'deps/libmojibake' Submodule 'deps/libuv' () registered for path 'deps/libuv' Submodule 'deps/openlibm' () registered for path 'deps/openlibm' Submodule 'deps/openspecfun' () registered for path 'deps/openspecfun' Submodule 'doc/juliadoc' () registered for path 'doc/juliadoc' % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- 0:00:14 --:--:-- 0curl: (28) SSL connection timeout % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 403 make[2]: *** [patchelf-0.8.tar.gz] Error 22 make[1]: *** [julia-release] Error 2 make: *** [release] Error 2 How to fix this problem? Or how to skip this to complete the make process? Thank you.
[julia-users] Re: Nested functions - maximize over integrals
Thanks for this, should have thought of this myself. I made some progress by defining the functions as follows: for y = 1:Y function f2(x, y_now = y) y_l = y_now-1 y_h = y_now+1 f(y) = f3(x, y)*pdf(LogNormal(mu_y, sig_y), y) quadgk(f, y_l, y_h) end end With this, I get back one single-valued function f2 for each value of y in the loop, that I can evaluate at x: f2(5) 1-element Array{Float64,1}: 134.112 However, the optimization fails, since the function I construct seems to be incorrectly specified for the Optim package to work: using Optim fminbox(f2, 1, 0, 2) # minimize over interval [0, 2], start at 1 `fminbox` has no method matching fminbox(::Function) optimize(f2, 0, 2) # minimize over interval [0, 2] using Brent's method `eps` has no method matching eps(::Type{Int64}) I believe the second way of doing it would be the correct one, however I can't interpret the error being thrown here. The only place eps appears in the source code of Optim is when the tolerance levels for convergence of Brent's method are set (both in optimize.jl https://github.com/JuliaOpt/Optim.jl/blob/master/src/optimize.jl and brent.jl), https://github.com/JuliaOpt/Optim.jl/blob/master/src/brent.jl but I can't figure out what this error means or how I could fix it. https://github.com/JuliaOpt/Optim.jl/blob/master/src/brent.jl
[julia-users] Re: Label vector components
While it is certainly expected that a custom type will be more performant, you cannot really trust your timings. You should not time with variables defined in global scope, and you should add a warm-up phase to compile your functions. Defining all of this: # Method 1: Type type parameters p1::Float64 p2::Float64 p3::Float64 end function f1(n,p) for i = 1:n p.p1 += 0.1 p.p2 += 0.1 p.p3 += 0.1 end end # Method 2: Dictionary function f2(n,p) for i = 1:n p[p1] += 0.1 p[p2] += 0.1 p[p3] += 0.1 end end # Time function function correcttime() p_method_1 = parameters(3.6, 0.6, 600.0) p_method_2 = {p1 = 3.6, p2 = 0.6, p3 = 600.0} f1(10,p_method_1) f2(10,p_method_2) println(Method 1) println(p_method_1) @time f1(10,p_method_1) println(p_method_1) println(Method 2) println(p_method_2) @time f2(10,p_method_2) println(p_method_2) end and then running correcttime() gives Method 1 parameters(4.598,1.6003,601.2) elapsed time: 0.000275517 seconds (0 bytes allocated) parameters(10004.60018865,10001.60018854,10601.00020967) Method 2 {p3=601.2,p2=1.6003,p1=4.598} elapsed time: 0.079420021 seconds (960 bytes allocated) {p3=10601.00020967,p2=10001.60018854,p1=10004.60018865} Op dinsdag 30 september 2014 11:09:38 UTC+2 schreef ami...@gmail.com: Hi again, Thanks for all the suggestions. I'm a bit ashamed I overlooked the part of the documentation about types. I skimmed through the DataFrames documentation and I don't think there's a way to access data via keys. As far as the two other solutions are concerned, I compared their performance on a very simple test case, here it is if it can be of any interest : n = 10 # Method 1: Type type parameters p1::Float64 p2::Float64 p3::Float64 end p_method_1 = parameters(3.6, 0.6, 600.0) function f1(p) for i = 1:n p.p1 += 0.1 p.p2 += 0.1 p.p3 += 0.1 end end # Method 2: Dictionnary p_method_2 = {p1 = 3.6, p2 = 0.6, p3 = 600.0} function f2(p) for i = 1:n p[p1] += 0.1 p[p2] += 0.1 p[p3] += 0.1 end end println(Method 1) println(p_method_1) @time f1(p_method_1) println(p_method_1) println(Method 2) println(p_method_2) @time f2(p_method_2) println(p_method_2) Here are the results: Method 1 parameters(3.6,0.6,600.0) elapsed time: 0.020289272 seconds (6610188 bytes allocated) parameters(10003.60018861,1.6001885,10600.00020964) Method 2 {p3=600.0,p2=0.6,p1=3.6} elapsed time: 0.120914516 seconds (16193368 bytes allocated) {p3=10600.00020964,p2=1.6001885,p1=10003.60018861} The first method is by far the most efficient.
[julia-users] Module issues
Hello All, I am trying to define and use a module. I have the following code. module TestModule export test_func function test_func(val) println(val) end end --- #!/usr/bin/julia using TestModule println(LOAD_PATH) test_func(TestVal) I have put the module source file under the path LOAD_PATH/TestModule/src/TestModule.jl. I've tried a variety of other variations, but to no avail. Is there something that I am doing wrong? I get Warning: requiring TestModule did not define a corresponding module. when I try to use (using) the module. Thanks, Gerry
Re: [julia-users] Package installation directory: dealing with multiple Julia version
Wouldn't this also change the behavior of my Julia?
Re: [julia-users] Package installation directory: dealing with multiple Julia version
On Tuesday, September 30, 2014 02:48:23 AM Giulio Valentino Dalla Riva wrote: Wouldn't this also change the behavior of my Julia? Not if you have different aliases, `myjulia` and `centraljulia`. You can define each one to do something different. --Tim
Re: [julia-users] Re: Nested functions - maximize over integrals
Hi Tim, Thanks so much for your answer, indeed this was the issue here. Specifying the function the way you said indeed gets rid of the error (and raises a new one, namely `isless` has no method matching isless(::Array{Float64,1}, ::Array{Float64,1}), I'll try to figure this one out later...). Can I bother you with one related but general question: How do I interpret the first curly brackets in the function definition? The function definition says optimize{T:Real}(f::Function, lower::T:Real,upper::T:Real), where I understand the f::Function, lower::T:Real, upper::T:Real give the expected inputs and their respective types, but what exactly does the {T:Real} tell me? You can tell I'm coming from Matlab and even though I've been doing data analysis in Python for a while, object oriented programming still doesn't come naturally to me... Best, Nils
Re: [julia-users] Re: Nested functions - maximize over integrals
There's some difference in how `methods` prints the signature and how it looks in code. The version in code is usually clearer, so let's focus on that. The `lower::T` means `lower` has type `T`. The `{T:Real}` means that T has to be a real number. This could have been written optimize(f::Function, lower::Real, upper::Real, ...) except that, later on, there's a default value provided for `rel_tol` and `abs_tol` which depends on the number type `T`. The intention behind that construct is that, for example, you want to use a different tolerence for convergence depending on whether you're optimizing a function of a Float32 or a Float64. The issue is that if you pass `0` and `2`, these are both Ints. And `eps(Int)` doesn't exist. Since you're obviously still pretty new to Julia, I'm just going to do this for you. Here's the commit: https://github.com/JuliaOpt/Optim.jl/commit/2c812c9cbdbca95aaf00e703289f1297844698d4 You can study how it works and see how to fix such things in the future. (Studying how people fix bugs that bit you is a great way to learn more about Julia.) Best, --Tim On Tuesday, September 30, 2014 03:30:01 AM nils.gu...@gmail.com wrote: Hi Tim, Thanks so much for your answer, indeed this was the issue here. Specifying the function the way you said indeed gets rid of the error (and raises a new one, namely `isless` has no method matching isless(::Array{Float64,1}, ::Array{Float64,1}), I'll try to figure this one out later...). Can I bother you with one related but general question: How do I interpret the first curly brackets in the function definition? The function definition says optimize{T:Real}(f::Function, lower::T:Real,upper::T:Real), where I understand the f::Function, lower::T:Real, upper::T:Real give the expected inputs and their respective types, but what exactly does the {T:Real} tell me? You can tell I'm coming from Matlab and even though I've been doing data analysis in Python for a while, object oriented programming still doesn't come naturally to me... Best, Nils
Re: [julia-users] Re: Nested functions - maximize over integrals
Oh, and to get the fix, you're going to have to say `Pkg.checkout(Optim)` until a new release gets tagged. --Tim On Tuesday, September 30, 2014 03:30:01 AM nils.gu...@gmail.com wrote: Hi Tim, Thanks so much for your answer, indeed this was the issue here. Specifying the function the way you said indeed gets rid of the error (and raises a new one, namely `isless` has no method matching isless(::Array{Float64,1}, ::Array{Float64,1}), I'll try to figure this one out later...). Can I bother you with one related but general question: How do I interpret the first curly brackets in the function definition? The function definition says optimize{T:Real}(f::Function, lower::T:Real,upper::T:Real), where I understand the f::Function, lower::T:Real, upper::T:Real give the expected inputs and their respective types, but what exactly does the {T:Real} tell me? You can tell I'm coming from Matlab and even though I've been doing data analysis in Python for a while, object oriented programming still doesn't come naturally to me... Best, Nils
Re: [julia-users] All packages for numerical math
Sorry for reviving an old thread. I got interested in timings for vectorized vs. unvectorized versions of functions in MATLAB. So I wrote MATLAB versions of the `trapz` functions mentioned in this thread, and measured their running times by applying the `timeit` macro several hundred times. The results did surprise me: trapz1 (vectorized) : ~ 35 µs trapz2 (unvectorized): ~ 12 µs -- per loop for evaluating the trapezoidal rule on `x=linspace(0,pi); y=sin(x)`. I know one should not draw conclusions from such simple benchmarks. Still, does this comparison imply the old myth to *vectorize MATLAB functions to make them faster* is not true any more? The JIT compiler that MATLAB is equipped with is not as powerful as Julia's LLVM-based compiler, but it seems to be at work. Have others had similar experiences, or am I on a wrong path here? On Wednesday, April 23, 2014 11:20:50 PM UTC+2, Tomas Lycken wrote: On Wednesday, April 23, 2014 11:10:15 PM UTC+2, Cameron McBride wrote: Or you can use the non-vectorized version and save the overhead of the temporary arrays being created by the addition and multiplication steps. There's really no way I can hide that I learnt scientific computing in Matlab, is there? :P On Wed, Apr 23, 2014 at 7:52 AM, Tomas Lycken tomas@gmail.com wrote: The trapezoidal rule (http://en.wikipedia.org/wiki/Trapezoidal_rule) would probably be almost trivial to implement. function trapz{T:Real}(x::Vector{T}, y::Vector{T}) if (length(y) != length(x)) error(Vectors must be of same length) end sum( (x[2:end] .- x[1:end-1]).*(y[2:end].+y[1:end-1]) ) / 2 end x = [0:0.01:pi] y = sin(x) trapz(x,y) # 1.820650436642 This, of course, only currently works on vectors of real numbers, but it's easy to extend it if you want. And there might be more accurate methods as well, of course (see e.g. http://en.wikipedia.org/wiki/Simpson%27s_rule) but this one's often good enough. // T On Wednesday, April 23, 2014 8:43:48 AM UTC+2, Evgeny Shevchenko wrote: Hi, John. No, I didn't. I didn't find it and it seems to be not what i need: no method quadgk(Array{Float64,1}, Array{Float64,1}) quadgk(f,a,b,...) expects a function as its first argument but I mean the case when y = f(x), but i don't have f, e.g. obtained experimental data, so x and y are 1-D arrays of floats. On Tue, Apr 22, 2014 at 7:49 PM, John Myles White johnmyl...@gmail.com wrote: Have you tried the quadgk function? -- John On Apr 22, 2014, at 7:32 AM, Evgeny Shevchenko eu...@ya.ru wrote: Hi Is there a package for numeric integration of obtained arrays, say x and y? Couldn't find one, the led me to use @pyimport and numpy.trapz. -- pupoque@IRC
Re: [julia-users] Re: Calling Julia from .NET
I should mention that it is necessary to change the project target CPU from the default Any to x64 or x86 to match the libjulia architecture. On Sep 29, 2014 11:58 PM, Isaiah Norton isaiah.nor...@gmail.com wrote: I tried this some time ago during 0.2, so to make sure it still works I made a minimal translation of the embedding example to C#: ``` using System; using System.Runtime.InteropServices; namespace ConsoleApplication2 { class Program { [DllImport(libjulia.dll)] static extern void jl_init(); [DllImport(libjulia.dll)] static extern void jl_eval_string(string message); static void Main(string[] args) { jl_init(); jl_eval_string(print(sqrt(2.0))); } } } ``` I compiled this, copied the binary into `Julia-0.3.0\bin`, and it works: ``` C:\cmn\Julia-0.3.0bin\ConsoleApplication2.exe 1.4142135623730951 ``` On Mon, Sep 29, 2014 at 4:11 PM, Tobias Knopp tobias.kn...@googlemail.com wrote: yep, I have done this (mostly for fun) before and it works. One needs some experience with P/Invoke of course but this is no magic but similar to our ccall. Cheers, Tobi Am Montag, 29. September 2014 20:52:10 UTC+2 schrieb Stefan Karpinski: I assume that you can call C libraries from .NET, right? The C library for Julia is libjulia – how to call it from C is explained in the embedding docs, calling it from .NET should be similar. On Sep 29, 2014, at 12:37 PM, Guido De Bouver guido.d...@telenet.be wrote: I have not found the C# examples, but I have not looked for them. Sorry for that. So, any help on this, how could we call Julia from .NET
[julia-users] Re: Module issues
Your code should work fine if you put the module in a directory that can be accessed. If you running julia in the directory where the module is located, you can recall the full path with: joinpath(pwd(), TestModule.jl) *j*ulia using TestModule julia println(LOAD_PATH) Union(UTF8String,ASCIIString)[/Users/maximilianosuster/julia/usr/local/share/julia/site/v0.3,/Users/maximilianosuster/julia/usr/share/julia/site/v0.3] julia test_func test_func (generic function with 1 method) julia test_func(TestVal) TestVal On Tuesday, September 30, 2014 11:45:38 AM UTC+2, Gerry Weaver wrote: Hello All, I am trying to define and use a module. I have the following code. module TestModule export test_func function test_func(val) println(val) end end --- #!/usr/bin/julia using TestModule println(LOAD_PATH) test_func(TestVal) I have put the module source file under the path LOAD_PATH/TestModule/src/TestModule.jl. I've tried a variety of other variations, but to no avail. Is there something that I am doing wrong? I get Warning: requiring TestModule did not define a corresponding module. when I try to use (using) the module. Thanks, Gerry
Re: [julia-users] Re: Benchmarking julia parallel computing
There is a package MPI.jl that allows calling MPI from Julia. With this, any MPI-based algorithm can be translated to Julia, and the speed of MPI should be the same as for any other language. -erik On Tue, Sep 30, 2014 at 12:12 AM, Tony Kelman t...@kelman.net wrote: I'm not aware of any such data comparing Julia on large-scale parallel tasks with nontrivial communication patterns vs a more conventional HPC cluster approach using MPI. There are some benchmark problems (generally intended for serial or small-scale parallel execution, I believe) under test/perf, but it might be more interesting if you have your own parallel application you want to test with. Keep us posted as you get further into this. On Monday, September 29, 2014 11:58:33 AM UTC-7, Kapil Agarwal wrote: Hi I am looking to benchmark some standard parallel algorithms using Julia. I am thinking of comparing its performance with MPI and other parallel programming paradigms. Although I couldn't find much on any existing benchmarks, I was looking forward to any benchmarks that may have been done by the julia-dev team or in case any one is aware of any such benchmarks that could help me go about it. Thanks Kapil -- Erik Schnetter schnet...@cct.lsu.edu http://www.perimeterinstitute.ca/personal/eschnetter/
[julia-users] Re: Label vector components
Thanks Jutho for this warning, I will be more careful as of now.
[julia-users] Reflection, access members of a defined type
Dear all, This is somewhat the following of a previous topic: https://groups.google.com/forum/#!topic/julia-users/CvQMwq2rN9I but since the two issues have little in common, I thought it was better to create a new topic. I'd like to access the members of a type via a string, i.e. if I define: type parameters p1::Float64 p2::Float64 p3::Float64 end p = parameters(3.6, 0.6, 600.0) label = p1 is there a way to access p.p1 through something like: p.names(label) I guess this has to do with reflection in julia. I know there is a way to get the names through names(p) but there's nothing in the documentation about what I'm looking for. I did some research and I came across this reflection.jl file: https://github.com/JuliaLang/julia/blob/master/base/reflection.jl that I tried to decypher, but with little success. (Incidentally, I'd be interested in understanding what happens here if there's some resource helping to do so.) Thanks a lot, AS
[julia-users] Re: Reflection, access members of a defined type
julia type parameters p1::Float64 p2::Float64 p3::Float64 end julia params = parameters(1,2,3) parameters(1.0,2.0,3.0) julia label = p1 p1 julia params.(symbol(label)) 1.0 On Tuesday, September 30, 2014 2:43:57 PM UTC+2, ami...@gmail.com wrote: Dear all, This is somewhat the following of a previous topic: https://groups.google.com/forum/#!topic/julia-users/CvQMwq2rN9I but since the two issues have little in common, I thought it was better to create a new topic. I'd like to access the members of a type via a string, i.e. if I define: type parameters p1::Float64 p2::Float64 p3::Float64 end p = parameters(3.6, 0.6, 600.0) label = p1 is there a way to access p.p1 through something like: p.names(label) I guess this has to do with reflection in julia. I know there is a way to get the names through names(p) but there's nothing in the documentation about what I'm looking for. I did some research and I came across this reflection.jl file: https://github.com/JuliaLang/julia/blob/master/base/reflection.jl that I tried to decypher, but with little success. (Incidentally, I'd be interested in understanding what happens here if there's some resource helping to do so.) Thanks a lot, AS
[julia-users] Re: Reflection, access members of a defined type
Wonderful, many thanks Max.
Re: [julia-users] Re: Calling Julia from .NET
Hi Isaiah. I tried and got this error: System image file ?l\../lib/julia/sys.ji not found System Image sys.ji looks to be on his place and I have no problem running Julia. Thanks. On Tuesday, September 30, 2014 2:03:42 PM UTC+2, Isaiah wrote: I should mention that it is necessary to change the project target CPU from the default Any to x64 or x86 to match the libjulia architecture. On Sep 29, 2014 11:58 PM, Isaiah Norton isaiah...@gmail.com javascript: wrote: I tried this some time ago during 0.2, so to make sure it still works I made a minimal translation of the embedding example to C#: ``` using System; using System.Runtime.InteropServices; namespace ConsoleApplication2 { class Program { [DllImport(libjulia.dll)] static extern void jl_init(); [DllImport(libjulia.dll)] static extern void jl_eval_string(string message); static void Main(string[] args) { jl_init(); jl_eval_string(print(sqrt(2.0))); } } } ``` I compiled this, copied the binary into `Julia-0.3.0\bin`, and it works: ``` C:\cmn\Julia-0.3.0bin\ConsoleApplication2.exe 1.4142135623730951 ``` On Mon, Sep 29, 2014 at 4:11 PM, Tobias Knopp tobias...@googlemail.com javascript: wrote: yep, I have done this (mostly for fun) before and it works. One needs some experience with P/Invoke of course but this is no magic but similar to our ccall. Cheers, Tobi Am Montag, 29. September 2014 20:52:10 UTC+2 schrieb Stefan Karpinski: I assume that you can call C libraries from .NET, right? The C library for Julia is libjulia – how to call it from C is explained in the embedding docs, calling it from .NET should be similar. On Sep 29, 2014, at 12:37 PM, Guido De Bouver guido.d...@telenet.be wrote: I have not found the C# examples, but I have not looked for them. Sorry for that. So, any help on this, how could we call Julia from .NET
[julia-users] cannot add any packages - Julia on Windows7 x64
Hello, maybe somebody face same problem? I cannot add any Julia packages. The error message is always different, but result is the same. What I'm doing wrong? julia Pkg.add(Gadfly) ERROR: key not found: StatsBase in wait at task.jl:51 julia Pkg.add(Jewel) ERROR: key not found: WinRPM in wait at task.jl:51 in add at pkg/entry.jl:319 julia Pkg.add(Curl) INFO: Cloning cache of Curl from git://github.com/forio/Curl.jl.git INFO: Installing Curl v0.0.3 error: internal error: refs/remotes/origin/master is not a valid packed reference! error: internal error: refs/tags/v0.0.2 is not a valid packed reference! error: Trying to write ref refs/heads/master with nonexistent object fd0e393f4f3b5c78f4174ccc2d62b239a8370ad4 fatal: Cannot update the ref 'HEAD'. fatal: The remote end hung up unexpectedly ERROR: failed process: Process(`git clone -q 'S:\.julia\.cache\Curl' Curl`, ProcessExited(128)) [128] in wait at task.jl:284 julia Pkg.add(Example) fatal: Not a git repository: 'S:\.julia\Curl\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\Curl' '--git-dir=S:\.julia\Curl\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in add at pkg/entry.jl:319 julia Pkg.add(GZip) fatal: Not a git repository: 'S:\.julia\Curl\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\Curl' '--git-dir=S:\.julia\Curl\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in add at pkg/entry.jl:319 julia Pkg.add(Helpme) fatal: Not a git repository: 'S:\.julia\Curl\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\Curl' '--git-dir=S:\.julia\Curl\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in add at pkg/entry.jl:319 julia Bst regards, Igor.
Re: [julia-users] Re: Control system library for Julia?
I'm looking forward to some sort of flag or option to turn on the incremental GC, and trying to understand a bit more about the design space. My naive thought process goes something like this: 1. The total time to collect garbage probably grows with number of objects and total size to be freed (though maybe size doesn't matter much here?) 2. An incremental GC will collect until it runs out of time, then hand control back to the application until it's time to run again 3. It seems like there's a rate of garbage generation where you're building up garbage faster than the GC can collect it without missing its deadline 4. It seems like if you stay below this rate you can consider your maximum pause time to be bounded and memory won't be leaking. We hold hands and sing songs. 5. So the issue is what to do when you're above that rate. Either you: 1. make sure memory consumption doesn't grow indefinitely by having some heuristic for when the GC decides to give up on the deadline, OR 2. make sure the GC never violates its deadline and run the risk of running out of memory Are there other options besides those two? I would definitely welcome an actual hard-realtime bounded-pause-time GC, but it also seems valuable (and possibly more feasible) to have a GC where the pause time is bounded with caveats and more careful programming. I'm not sure whether this qualifies as *hard *realtime, though it seems like it might if you can make those guarantees about your application code. It's also worth mentioning for other folks interested in latency that that JIT compilation is a killer as well, so you need to guarantee that you're pre-compiled all the possible methods that might get dispatched to. peace, s On Mon, Sep 29, 2014 at 4:25 PM, Stefan Karpinski ste...@karpinski.org wrote: On Mon, Sep 29, 2014 at 4:21 PM, Uwe Fechner uwe.fechner@gmail.com wrote: Jeff Bezanson suggested in the following discussion ( https://github.com/JuliaLang/julia/pull/5227 ): It would be great to have the option to build with a low-pause GC for users who might want that. This is exactly what I am looking for: To have two different garbage collectors for Julia, a fast collector for non-real-time applications and a low-latency GC for real-time applications. Uwe Yeah, that would be great.
[julia-users] NEAT / HyperNEAT
Hi, is anyone working on a NEAT / HyperNEAT package for julia? Cheers, Keyan
Re: [julia-users] cannot add any packages - Julia on Windows7 x64
What do you get from versioninfo()? Med venlig hilsen Andreas Noack 2014-09-30 3:06 GMT-04:00 xaph...@ymail.com: Hello, maybe somebody face same problem? I cannot add any Julia packages. The error message is always different, but result is the same. What I'm doing wrong? julia Pkg.add(Gadfly) ERROR: key not found: StatsBase in wait at task.jl:51 julia Pkg.add(Jewel) ERROR: key not found: WinRPM in wait at task.jl:51 in add at pkg/entry.jl:319 julia Pkg.add(Curl) INFO: Cloning cache of Curl from git://github.com/forio/Curl.jl.git INFO: Installing Curl v0.0.3 error: internal error: refs/remotes/origin/master is not a valid packed reference! error: internal error: refs/tags/v0.0.2 is not a valid packed reference! error: Trying to write ref refs/heads/master with nonexistent object fd0e393f4f3b5c78f4174ccc2d62b239a8370ad4 fatal: Cannot update the ref 'HEAD'. fatal: The remote end hung up unexpectedly ERROR: failed process: Process(`git clone -q 'S:\.julia\.cache\Curl' Curl`, ProcessExited(128)) [128] in wait at task.jl:284 julia Pkg.add(Example) fatal: Not a git repository: 'S:\.julia\Curl\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\Curl' '--git-dir=S:\.julia\Curl\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in add at pkg/entry.jl:319 julia Pkg.add(GZip) fatal: Not a git repository: 'S:\.julia\Curl\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\Curl' '--git-dir=S:\.julia\Curl\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in add at pkg/entry.jl:319 julia Pkg.add(Helpme) fatal: Not a git repository: 'S:\.julia\Curl\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\Curl' '--git-dir=S:\.julia\Curl\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in add at pkg/entry.jl:319 julia Bst regards, Igor.
[julia-users] Re: Reflection, access members of a defined type
It’s worth noting this open issue https://github.com/JuliaLang/julia/issues/6268 when using the syntax params.(symbol(label)). You could use getfield(params, symbol(label)) instead. — Mike
[julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)
Hello guys, Indeed, www.junolab.org makes me want to go with Julia farther too :). I was asking about debugging because I implemented a custom type (in a module) of which constructor is failing somewhere but I just get an error about some array multiplication in some julia file instead of a concrete line number in the constructor function. Any idea how to get through this ? Thanks a lot, Jan Dňa pondelok, 29. septembra 2014 12:27:07 UTC+2 Viral Shah napísal(-a): The light table work that Mike Innes has done is now packaged and available at http://www.junolab.org/ We are hoping to work towards making self-sufficient binaries and getting it to a point where it is usable with a single download. The real fun is to then try and do more interesting things. I don't know what those are, but I do feel that we are setting ourselves up with a good base. -viral On Saturday, September 27, 2014 12:38:39 PM UTC+5:30, colint...@gmail.com wrote: No, I don't think it has debugging a la the Matlab IDE or R-Studio (yet). My understanding is that for now the Debug package is all that is available. Personally I make do with sending blocks of code to a console in Sublime-IJulia (you can do this with shift+enter, just like in R-Studio). Cheers, Colin On Friday, September 26, 2014 7:00:09 PM UTC+10, Ján Dolinský wrote: Hello, I cloned the master branch of Julia Studio and compiled it. I am however getting this error when running ./JuliaStudio : libExtensionSystem.so.1: cannot open shared object file: No such file or directory however when running using ./julia-studio.sh it runs but fails to open a console with the following errors: Error: Failed to start Julia. Expected location: /usr/local/Julia_Studio/julia I am little bit lost here but exploring the Julia Studio menu I assume that it doe not provide debugging capability (I had an impression that it does). Thanks, Jan Dňa piatok, 19. septembra 2014 11:57:47 UTC+2 Uwe Fechner napísal(-a): I think that this branch is already merged into the master branch: https://github.com/forio/julia-studio/tree/julia-0.3-compatibility On Friday, September 19, 2014 11:54:41 AM UTC+2, Uwe Fechner wrote: If you compile Julia Studio from source it should work with Julia 0.3. See: https://github.com/forio/julia-studio/issues/241 Regards: Uwe On Friday, September 19, 2014 10:58:26 AM UTC+2, Ján Dolinský wrote: Hello guys, After upgrading to Julia 0.3.0 Julia Studio stopped working (I changed the symbolic links in Julia Studio directory but nevertheless ...). Can somebody suggest any workaround ? Is it true that Julia Studio will not support newer versions of Julia ? What are you guys using now ? Thanks a lot, Jan
[julia-users] Re: Reflection, access members of a defined type
Thanks for the warning Mike.
[julia-users] Re: Reflection, access members of a defined type
Mike, Thank you for pointing this out. I am wondering, should I drop using params.(symbol(label))? Is there an easy way to keep updated on changes that are imminent in Julia syntax (e.g., in 0.4) vs personal preferences? Thanks, Max On Tuesday, September 30, 2014 3:36:32 PM UTC+2, Michael Hatherly wrote: It’s worth noting this open issue https://github.com/JuliaLang/julia/issues/6268 when using the syntax params.(symbol(label)). You could use getfield(params, symbol(label)) instead. — Mike
Re: [julia-users] Re: Calling Julia from .NET
Try running it from the Julia directory as `bin\CommandLine2.exe`. This is very much a minimal example; for general use, the bin directory should be passed as an argument to `jl_init`: https://github.com/JuliaLang/julia/blob/1ee440bee5035ccb33f82b8a45febddd2f973baa/src/jlapi.c#L70-L73 To go much further than this will really require to dig in to both jlapi.c and the general Julia source code. Be aware that dealing with type translation and garbage collection are both non-trivial. See also `examples/embedding.c` in the julia tree, and several previous discussion on the mailing list. On Tue, Sep 30, 2014 at 9:08 AM, Stefan Babinec sysli...@gmail.com wrote: Hi Isaiah. I tried and got this error: System image file ?l\../lib/julia/sys.ji not found System Image sys.ji looks to be on his place and I have no problem running Julia. Thanks. On Tuesday, September 30, 2014 2:03:42 PM UTC+2, Isaiah wrote: I should mention that it is necessary to change the project target CPU from the default Any to x64 or x86 to match the libjulia architecture. On Sep 29, 2014 11:58 PM, Isaiah Norton isaiah...@gmail.com wrote: I tried this some time ago during 0.2, so to make sure it still works I made a minimal translation of the embedding example to C#: ``` using System; using System.Runtime.InteropServices; namespace ConsoleApplication2 { class Program { [DllImport(libjulia.dll)] static extern void jl_init(); [DllImport(libjulia.dll)] static extern void jl_eval_string(string message); static void Main(string[] args) { jl_init(); jl_eval_string(print(sqrt(2.0))); } } } ``` I compiled this, copied the binary into `Julia-0.3.0\bin`, and it works: ``` C:\cmn\Julia-0.3.0bin\ConsoleApplication2.exe 1.4142135623730951 ``` On Mon, Sep 29, 2014 at 4:11 PM, Tobias Knopp tobias...@googlemail.com wrote: yep, I have done this (mostly for fun) before and it works. One needs some experience with P/Invoke of course but this is no magic but similar to our ccall. Cheers, Tobi Am Montag, 29. September 2014 20:52:10 UTC+2 schrieb Stefan Karpinski: I assume that you can call C libraries from .NET, right? The C library for Julia is libjulia – how to call it from C is explained in the embedding docs, calling it from .NET should be similar. On Sep 29, 2014, at 12:37 PM, Guido De Bouver guido.d...@telenet.be wrote: I have not found the C# examples, but I have not looked for them. Sorry for that. So, any help on this, how could we call Julia from .NET
Re: [julia-users] Re: Nested functions - maximize over integrals
Hi Tim, thanks again for your detailed reply, I understood what was going wrong now. And another thank you for fixing the issue, after doing the Pkg.checkout the optimization now works with integers as well. However, I still can't get a result because I'm still getting the error alluded to above: optimize(f, 0, 2) `isless` has no method matching isless(::Array{Float64,1}, ::Array{Float64,1}) while loading In[15], in expression starting on line 1 in = at operators.jl:34 If I understand correctly, this means that two arrays are being passed to the isless function, which doesn't support arrays. I figured out that isless is contained in operators.jl, which in itself is part of the julia base, so it's probably not a bug in the function here. How can I figure out where the arrays being passed to isless are created? Sorry for bombarding you with questions here, but my debugging skills in julia are pretty much non-existant and I have to get used to the logic of the julia error messages!
Re: [julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)
Maybe you could start a new julia-users thread, and post the code and the error message so we can help? It's hard to make specific recommendations without seeing the code/error. -- Leah On Tue, Sep 30, 2014 at 9:27 AM, Ján Dolinský jan.dolin...@2bridgz.com wrote: Hello guys, Indeed, www.junolab.org makes me want to go with Julia farther too :). I was asking about debugging because I implemented a custom type (in a module) of which constructor is failing somewhere but I just get an error about some array multiplication in some julia file instead of a concrete line number in the constructor function. Any idea how to get through this ? Thanks a lot, Jan Dňa pondelok, 29. septembra 2014 12:27:07 UTC+2 Viral Shah napísal(-a): The light table work that Mike Innes has done is now packaged and available at http://www.junolab.org/ We are hoping to work towards making self-sufficient binaries and getting it to a point where it is usable with a single download. The real fun is to then try and do more interesting things. I don't know what those are, but I do feel that we are setting ourselves up with a good base. -viral On Saturday, September 27, 2014 12:38:39 PM UTC+5:30, colint...@gmail.com wrote: No, I don't think it has debugging a la the Matlab IDE or R-Studio (yet). My understanding is that for now the Debug package is all that is available. Personally I make do with sending blocks of code to a console in Sublime-IJulia (you can do this with shift+enter, just like in R-Studio). Cheers, Colin On Friday, September 26, 2014 7:00:09 PM UTC+10, Ján Dolinský wrote: Hello, I cloned the master branch of Julia Studio and compiled it. I am however getting this error when running ./JuliaStudio : libExtensionSystem.so.1: cannot open shared object file: No such file or directory however when running using ./julia-studio.sh it runs but fails to open a console with the following errors: Error: Failed to start Julia. Expected location: /usr/local/Julia_Studio/julia I am little bit lost here but exploring the Julia Studio menu I assume that it doe not provide debugging capability (I had an impression that it does). Thanks, Jan Dňa piatok, 19. septembra 2014 11:57:47 UTC+2 Uwe Fechner napísal(-a): I think that this branch is already merged into the master branch: https://github.com/forio/julia-studio/tree/julia-0.3-compatibility On Friday, September 19, 2014 11:54:41 AM UTC+2, Uwe Fechner wrote: If you compile Julia Studio from source it should work with Julia 0.3. See: https://github.com/forio/julia-studio/issues/241 Regards: Uwe On Friday, September 19, 2014 10:58:26 AM UTC+2, Ján Dolinský wrote: Hello guys, After upgrading to Julia 0.3.0 Julia Studio stopped working (I changed the symbolic links in Julia Studio directory but nevertheless ...). Can somebody suggest any workaround ? Is it true that Julia Studio will not support newer versions of Julia ? What are you guys using now ? Thanks a lot, Jan
Re: [julia-users] Re: Nested functions - maximize over integrals
Is that really all the backtrace you get from your error? My guess is you have a problem with your function definition. You may need `.=` rather than `=` (note the dot out front, just like .* in Matlab). Anyway, to help more we'd need a more complete example. In your first post, most of the variables (at least Y,mu_y, sig_y, x_l, x_h, y_l, y_h) are undefined. --Tim On Tuesday, September 30, 2014 08:57:38 AM nils.gu...@gmail.com wrote: Hi Tim, thanks again for your detailed reply, I understood what was going wrong now. And another thank you for fixing the issue, after doing the Pkg.checkout the optimization now works with integers as well. However, I still can't get a result because I'm still getting the error alluded to above: optimize(f, 0, 2) `isless` has no method matching isless(::Array{Float64,1}, ::Array{Float64,1}) while loading In[15], in expression starting on line 1 in = at operators.jl:34 If I understand correctly, this means that two arrays are being passed to the isless function, which doesn't support arrays. I figured out that isless is contained in operators.jl, which in itself is part of the julia base, so it's probably not a bug in the function here. How can I figure out where the arrays being passed to isless are created? Sorry for bombarding you with questions here, but my debugging skills in julia are pretty much non-existant and I have to get used to the logic of the julia error messages!
Re: [julia-users] Re: Nested functions - maximize over integrals
Hi Tim, Good that you asked for the backtrace, I did indeed miss a line; specifically, the issue arises in Optim\src\brent.jl:117 You're also right that my question gets increasingly specific and hard to answer, so I've put together a minimum working example that does what I'm trying to do in my original code and reproduces the issue: using Distributions using Optim z1 = 1.7 z2 = 0.1 z3 = 1.9 z4 = 0.1 z5 = 0.2 z6 = 40 stdz = 0.22 coeffz = rand(7,1) expz1 = LogNormal(2, 0.3) expand(x, z1, z2, z3, z4, z5, z6) = [x^2, z1^2, z2^2, z3^2, z4^2, z5^2, z6^2] function f2(x, z1=z1, z2=z2, z3=z3, z4=z4, z5=z5, z6=z6) z1_l = z1 - 3*stdz z1_h = z1 + 3*stdz f(z1) = expand(x, z1, z2, z3, z4, z5, z6)'*coeffz*pdf(expz1, z1) quadgk(f, z1_l, z1_h)[1] end f2(5) 1x1 Array{Float64,2}: 0.0683061 optimize(f2, 0, 2) `isless` has no method matching isless(::Array{Float64,2}, ::Array{Float64,2}) while loading In[4], in expression starting on line 1 in = at operators.jl:34 in brent at C:\Users\tew207\.julia\v0.3\Optim\src\brent.jl:117 Let me know if this works for you in producing the same output!
Re: [julia-users] All packages for numerical math
Quite interesting indeed. Thanks for sharing. --Tim On Tuesday, September 30, 2014 04:52:22 AM Hans W Borchers wrote: Sorry for reviving an old thread. I got interested in timings for vectorized vs. unvectorized versions of functions in MATLAB. So I wrote MATLAB versions of the `trapz` functions mentioned in this thread, and measured their running times by applying the `timeit` macro several hundred times. The results did surprise me: trapz1 (vectorized) : ~ 35 µs trapz2 (unvectorized): ~ 12 µs -- per loop for evaluating the trapezoidal rule on `x=linspace(0,pi); y=sin(x)`. I know one should not draw conclusions from such simple benchmarks. Still, does this comparison imply the old myth to *vectorize MATLAB functions to make them faster* is not true any more? The JIT compiler that MATLAB is equipped with is not as powerful as Julia's LLVM-based compiler, but it seems to be at work. Have others had similar experiences, or am I on a wrong path here? On Wednesday, April 23, 2014 11:20:50 PM UTC+2, Tomas Lycken wrote: On Wednesday, April 23, 2014 11:10:15 PM UTC+2, Cameron McBride wrote: Or you can use the non-vectorized version and save the overhead of the temporary arrays being created by the addition and multiplication steps. There's really no way I can hide that I learnt scientific computing in Matlab, is there? :P On Wed, Apr 23, 2014 at 7:52 AM, Tomas Lycken tomas@gmail.com wrote: The trapezoidal rule (http://en.wikipedia.org/wiki/Trapezoidal_rule) would probably be almost trivial to implement. function trapz{T:Real}(x::Vector{T}, y::Vector{T}) if (length(y) != length(x)) error(Vectors must be of same length) end sum( (x[2:end] .- x[1:end-1]).*(y[2:end].+y[1:end-1]) ) / 2 end x = [0:0.01:pi] y = sin(x) trapz(x,y) # 1.820650436642 This, of course, only currently works on vectors of real numbers, but it's easy to extend it if you want. And there might be more accurate methods as well, of course (see e.g. http://en.wikipedia.org/wiki/Simpson%27s_rule) but this one's often good enough. // T On Wednesday, April 23, 2014 8:43:48 AM UTC+2, Evgeny Shevchenko wrote: Hi, John. No, I didn't. I didn't find it and it seems to be not what i need: no method quadgk(Array{Float64,1}, Array{Float64,1}) quadgk(f,a,b,...) expects a function as its first argument but I mean the case when y = f(x), but i don't have f, e.g. obtained experimental data, so x and y are 1-D arrays of floats. On Tue, Apr 22, 2014 at 7:49 PM, John Myles White johnmyl...@gmail.com wrote: Have you tried the quadgk function? -- John On Apr 22, 2014, at 7:32 AM, Evgeny Shevchenko eu...@ya.ru wrote: Hi Is there a package for numeric integration of obtained arrays, say x and y? Couldn't find one, the led me to use @pyimport and numpy.trapz. -- pupoque@IRC
Re: [julia-users] Re: Nested functions - maximize over integrals
f2 is returning a matrix, not a scalar. (Try running f2(5).) brent needs a scalar. --Tim On Tuesday, September 30, 2014 09:38:00 AM nils.gu...@gmail.com wrote: Hi Tim, Good that you asked for the backtrace, I did indeed miss a line; specifically, the issue arises in Optim\src\brent.jl:117 You're also right that my question gets increasingly specific and hard to answer, so I've put together a minimum working example that does what I'm trying to do in my original code and reproduces the issue: using Distributions using Optim z1 = 1.7 z2 = 0.1 z3 = 1.9 z4 = 0.1 z5 = 0.2 z6 = 40 stdz = 0.22 coeffz = rand(7,1) expz1 = LogNormal(2, 0.3) expand(x, z1, z2, z3, z4, z5, z6) = [x^2, z1^2, z2^2, z3^2, z4^2, z5^2, z6^2] function f2(x, z1=z1, z2=z2, z3=z3, z4=z4, z5=z5, z6=z6) z1_l = z1 - 3*stdz z1_h = z1 + 3*stdz f(z1) = expand(x, z1, z2, z3, z4, z5, z6)'*coeffz*pdf(expz1, z1) quadgk(f, z1_l, z1_h)[1] end f2(5) 1x1 Array{Float64,2}: 0.0683061 optimize(f2, 0, 2) `isless` has no method matching isless(::Array{Float64,2}, ::Array{Float64,2}) while loading In[4], in expression starting on line 1 in = at operators.jl:34 in brent at C:\Users\tew207\.julia\v0.3\Optim\src\brent.jl:117 Let me know if this works for you in producing the same output!
[julia-users] Pkg.add fail
Under Windows, in the Julia 0.3.1 REPL I get a weird Pkg.add() error: ...Version 0.3.1 (2014-09-21 21:30 UTC) ...x86_64-w64-mingw32 julia Pkg.add(Jewel) ERROR: IJulia can't be installed because it has no versions that support 0.3.1 of julia in wait at task.jl:284 in wait at task.jl:194 in wait at task.jl:48 in sync_end at task.jl:311 in add at pkg/entry.jl:319 in add at pkg/entry.jl:71 in anonymous at pkg/dir.jl:28 in cd at file.jl:30 in cd at pkg/dir.jl:28 in add at pkg.jl:20 It is weird, because IJulia is installed and works well, and I wanted to add Jewel, not IJulia again. Here is the same thing from IJulia: Python 2.7.7 |Anaconda 2.0.1 (64-bit)| (default, Jun 11 2014, 10:40:02) [MSC v.1500 64 bit (AMD64)] Type copyright, credits or license for more information. IPython 2.1.0 -- An enhanced Interactive Python... In [3]: Pkg.add(Jewel) IJulia can't be installed because it has no versions that support 0.3.1 of julia while loading In[3], in expression starting on line 1 in wait at task.jl:284 in wait at task.jl:194 in wait at task.jl:48 in sync_end at task.jl:311 in add at pkg/entry.jl:319 in add at pkg/entry.jl:71 in anonymous at pkg/dir.jl:28 in cd at file.jl:30 in cd at pkg/dir.jl:28 in add at pkg.jl:20 Because of this error Juno (LightTable) cannot connect to Julia. What can I do?
[julia-users] Re: Reflection, access members of a defined type
Hi Max, If you have a GitHub account then you could watch the julia repo, otherwise there’s also https://github.com/JuliaLang/julia/pulse/weekly that should be viewable even without an account. There’s also the “breaking” label on the issues list that probably covers important changes https://github.com/JuliaLang/julia/issues?q=is%3Aopen+is%3Aissue+label%3Abreaking The NEWS file https://github.com/JuliaLang/julia/blob/master/NEWS.md gets updated quite regularly from the looks of things as well. With regards to stopping using that syntax: I’ve not used it for a while and getfield isn’t that much longer to write. I’ll leave it to one of the core devs to clarify whether it is *really* deprecated, but I’d assume it is. — Mike
[julia-users] Re: Reflection, access members of a defined type
Hi Mike, Thanks for the clarification. I will have a close eye on the one with the “breaking” label from now on. . . Max On Tuesday, September 30, 2014 7:27:29 PM UTC+2, Michael Hatherly wrote: Hi Max, If you have a GitHub account then you could watch the julia repo, otherwise there’s also https://github.com/JuliaLang/julia/pulse/weekly https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FJuliaLang%2Fjulia%2Fpulse%2Fweeklysa=Dsntz=1usg=AFQjCNGTJ5dU7XZOkEOceOQN96ebhGS8lA that should be viewable even without an account. There’s also the “breaking” label on the issues list that probably covers important changes https://github.com/JuliaLang/julia/issues?q=is%3Aopen+is%3Aissue+label%3Abreaking https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FJuliaLang%2Fjulia%2Fissues%3Fq%3Dis%253Aopen%2Bis%253Aissue%2Blabel%253Abreakingsa=Dsntz=1usg=AFQjCNHZfWAHoZLyubSBk-wuhvnp_7OwmA The NEWS file https://github.com/JuliaLang/julia/blob/master/NEWS.md gets updated quite regularly from the looks of things as well. With regards to stopping using that syntax: I’ve not used it for a while and getfield isn’t that much longer to write. I’ll leave it to one of the core devs to clarify whether it is *really* deprecated, but I’d assume it is. — Mike
[julia-users] Re: Module issues
Hi Max, I was trying to figure out where to put modules, so that Julia would be able to use them by default. In my case, /usr/share/julia/site/v3.0 is in LOAD_PATH. However, when I put my code there Julia can't see it. Is there something that I'm missing? Thanks, Gerry On Tuesday, September 30, 2014 7:07:07 AM UTC-5, Max Suster wrote: Your code should work fine if you put the module in a directory that can be accessed. If you running julia in the directory where the module is located, you can recall the full path with: joinpath(pwd(), TestModule.jl) *j*ulia using TestModule julia println(LOAD_PATH) Union(UTF8String,ASCIIString)[/Users/maximilianosuster/julia/usr/local/share/julia/site/v0.3,/Users/maximilianosuster/julia/usr/share/julia/site/v0.3] julia test_func test_func (generic function with 1 method) julia test_func(TestVal) TestVal On Tuesday, September 30, 2014 11:45:38 AM UTC+2, Gerry Weaver wrote: Hello All, I am trying to define and use a module. I have the following code. module TestModule export test_func function test_func(val) println(val) end end --- #!/usr/bin/julia using TestModule println(LOAD_PATH) test_func(TestVal) I have put the module source file under the path LOAD_PATH/TestModule/src/TestModule.jl. I've tried a variety of other variations, but to no avail. Is there something that I am doing wrong? I get Warning: requiring TestModule did not define a corresponding module. when I try to use (using) the module. Thanks, Gerry
[julia-users] Re: SharedArray, featuring another extreme newbie question
I assume pmap works the same way...? References to a SharedArray within the call of a pmap are treated as references, not copied and transferred? I suppose @profile is the only way to measure the amount of communications overhead going on; it is hard to fix what you can't measure! Thanks much. On Monday, September 29, 2014 8:47:57 PM UTC-7, Travis Porco wrote: Configuration: Version 0.3.0 (2014-08-20 20:43 UTC), x86_64-apple-darwin13.3.0 julia -p 1 Make a shared array, no problem: julia S = SharedArray(Int, (5,11), init = S - S[localindexes(S)] = myid(),pids=[1, 2]) A similar nonshared array, also no problem: julia nonshared = zeros(5,11) Toy function, no problem: @everywhere function ssq(x) sum(x .^ 2) end Test ability to do something on the workers, seems to work fine: julia for ww in workers() remotecall(ww,println,ww) end julia From worker 2:2 I don't expect the nonshared object to be visible: julia @sync for ww in workers() remotecall_fetch(ww, x-println(ssq(nonshared[myid()-1,:])),ww) end exception on 2: ERROR: nonshared not defined in anonymous at none:2 in anonymous at multi.jl:855 in run_work_thunk at multi.jl:621 in anonymous at task.jl:855 Try to reference the shared array on the workers: julia for ww in workers() remotecall_fetch(ww, x-println(ssq(S[myid()-1,:])),ww) # I know the ww does nothing here end exception on 2: ERROR: S not defined in anonymous at none:2 in anonymous at multi.jl:855 in run_work_thunk at multi.jl:621 in anonymous at task.jl:855 S was supposed to be a shared array, but it can't find it; I expected S to be visible, since it's supposed to be a shared array. I can call the function on S: julia for ww in workers() remotecall_fetch(ww, x-println(ssq(x[myid()-1,:])),S) end From worker 2:26 but then again, the nonshared version works in this context too, and so I have to think it's moving the data from pid 1 over to 2, and then doing the computation. This makes me think the operation above with S is actually doing the same thing--moving the data in S from pid 1 to 2 rather than having 2 just having access to it. However, I don't fully understand the issues. julia for ww in workers() remotecall_fetch(ww, x-println(ssq(x[myid()-1,:])),nonshared) end From worker 2:0 So the question: is this normal behavior? If so, what is the right way to access S on the workers, avoiding moving data? The manual describes the SharedArray as experimental, so I have to check... I've looked around for some very elementary examples of this sort but must have missed them. Thanks.
Re: [julia-users] Package installation directory: dealing with multiple Julia version
Gotcha! I'll try that now. Thanks!
[julia-users] curl: (22) The requested URL returned error: 403
Try again later and check your Internet connection.
[julia-users] Concurrent programming in Julia
Hi! I'm new to Julia and I find it wonderful (especially for maths programming), but I have difficulties writing concurrent programs in it - it seems that I don't understand some basic concepts here. I usually work with languages which support thread-based concurrency and allow spawning a number of threads/tasks sharing the same memory space (e.g. Scala, Rust, etc.). However, now I need to write a few math programs in Julia. The algorithms are quite CPU-heavy but can easily be parallelized (most of them boil down to for loops with independent iterations), and Julia does have an ability to write parallel programs. However, I just don't understand *how* to write them properly. Here is an outline of one of the programs (not in any particular language): (1) coeffs - compute approximation of function (2) f(s) = a function which uses coeffs (3) data - compute some data using f (4) plot data My current implementation (partially working) can be found here https://gist.github.com/netvl/8cfc0fb8dc487b0f536c: (1), (2), (3) and (4) must obviously be executed in order because each step depends on the results of previous step. However, algorithms in (1) and (3), which are the most time-consuming ones, can easily be parallelized (they are two big for loops filling one-dimensional and two-dimensional arrays, correspondingly). In conventional language I would just spawn a bunch of threads or start a thread pool which will compute these arrays in parallel, and then just use their data directly in the main thread. This is the most straightforward and easiest way with regular thread-based concurrency. The thread pool is only used locally in steps (1) and (3), and spawned threads are not concerned with the rest of the program *at all*. Julia, however, does not have thread abstraction. Instead it provides workers, which are separate processes, and it also provides means to transfer data between processes. Unfortunately, I couldn't find proper documentation on how to use these tools in nontrivial situations (official Julia documentation is just not sufficient), and this is a big problem - conventional approach just doesn't work here. The biggest problem, as far as I can see, is that these workers are not local - they must know about other parts of the program to work correctly, even if they are used only for several specific computations locally. First of all, `f` must be available on all workers in order for (3) to work at all. The suggested approach is to use `@everywhere` macro: coeffs = approx(...) @everywhere function f(s) # coeffs are used here end But `f` uses `coeffs` computed on the previous step, so `coeffs` should also be `@everywhere`'d - otherwise step (3) fails in workers. But this means that approximation will be computed multiple times, one on each worker, correct? I have some text printed in step (1), and if I write something like @everywhere coeffs = approx(...) I can see that `approx()` is called from all of the workers (though for some reason their output is only printed after step (4), just before the program ends). So, the first problem is that I don't know how to define a piece of data which should only be computed once, probably in parallel, and then shared among all workers. `@everywhere` is close, as it defines a binding in all workers, but it invokes the computation multiple times. I couldn't come up with simple workaround for this. Second, by extension of the above I have put `@everywhere` literally everywhere. You can see in the gist that the main script contains @everywhere on almost every line. It looks weird and I just don't believe that this is the right way, but without all of these `@everywhere`s workers will fail with various kinds of undefined errors. This *may* be expected as the workers are independent programs, but this is rather surprising from thread-based point of view. And finally, when I rewrote my program to run in parallel, plotting on step (4) just stopped working. I mean, when I run my program, it just hangs in `plot()` function after writing done. and the plot window is not displayed. It looks like some kind of interference with PyPlot, but I don't know the exact reason and I don't know how to debug it. So, my question is: how do I write a program which has multiple local parallel sections which should be executed sequentially due to data dependencies between them? As a subquestion, how to transfer data between workers if it should only be computed once and if this data is used indirectly through other definitions? As an another subquestion, how do you avoid writing `@everywhere` everywhere when there is a lot of definitions which should be available for all workers? And why plotting stopped working? Thanks in advance, Vladimir.
[julia-users] Pkg.add fail
A good start would be to post the output from Pkg.status() here. That makes it easier to see how packages might interact to cause this situation.
Re: [julia-users] curl: (22) The requested URL returned error: 403
Looks like patchelf-0.8.tar.gz didn't have the right permissions on our mirror. Should be fixed now. -Mike On Tue, Sep 30, 2014 at 4:49 PM, Ivar Nesje iva...@gmail.com wrote: Try again later and check your Internet connection.
[julia-users] Re: cannot add any packages - Julia on Windows7 x64
Seems like you are self compiling on Windows? I think I heard something about git being broken in one of the Unix like environments on Windows. Did you follow the instructions in README.md and README.windows?
[julia-users] Re: Module issues
To be able to access your modules by default, you can simply place the TestModule.jl file in /Users/username/.julia/v0.3 This folder should contain all the Julia packages/modules. Then type using TestModule to use your function in the Julia console. Max On Tuesday, September 30, 2014 9:18:15 PM UTC+2, Gerry Weaver wrote: Hi Max, I was trying to figure out where to put modules, so that Julia would be able to use them by default. In my case, /usr/share/julia/site/v3.0 is in LOAD_PATH. However, when I put my code there Julia can't see it. Is there something that I'm missing? Thanks, Gerry On Tuesday, September 30, 2014 7:07:07 AM UTC-5, Max Suster wrote: Your code should work fine if you put the module in a directory that can be accessed. If you running julia in the directory where the module is located, you can recall the full path with: joinpath(pwd(), TestModule.jl) *j*ulia using TestModule julia println(LOAD_PATH) Union(UTF8String,ASCIIString)[/Users/maximilianosuster/julia/usr/local/share/julia/site/v0.3,/Users/maximilianosuster/julia/usr/share/julia/site/v0.3] julia test_func test_func (generic function with 1 method) julia test_func(TestVal) TestVal On Tuesday, September 30, 2014 11:45:38 AM UTC+2, Gerry Weaver wrote: Hello All, I am trying to define and use a module. I have the following code. module TestModule export test_func function test_func(val) println(val) end end --- #!/usr/bin/julia using TestModule println(LOAD_PATH) test_func(TestVal) I have put the module source file under the path LOAD_PATH/TestModule/src/TestModule.jl. I've tried a variety of other variations, but to no avail. Is there something that I am doing wrong? I get Warning: requiring TestModule did not define a corresponding module. when I try to use (using) the module. Thanks, Gerry
[julia-users] Re: Pkg.add fail
julia Pkg.status() 7 required packages: - CUDA 0.1.0 2caa0935 (dirty) - Cairo 0.2.12 f2f8203f (dirty) - Gaston0.0.0 3ac1410f (dirty) - IJulia0.1.12 - Quaternions 0.0.4 - Tk0.2.13 - Winston 0.11.2 28 additional packages: - BinDeps 0.2.14 - Calculus 0.1.4 - Cartesian 0.2.2 - Color 0.2.10 - DualNumbers 0.1.0 - GLAbstraction 0.0.0- master (unregistered) - GLFW 1.0.0-alpha.1 - GLPlot0.0.0- master (unregistered, dirty) - GLWindow 0.0.0- master (unregistered) - HTTPClient0.1.4 - Images0.2.47 - ImmutableArrays 0.0.6 - IniFile 0.2.2 - JSON 0.3.7 - LibCURL 0.1.3 - LibExpat 0.0.4 - ModernGL 0.0.0- master (unregistered) - Mustache 0.0.3 - Nettle0.1.4 - REPLCompletions 0.0.1 - React 0.1.3 - SIUnits 0.0.2 - TexExtensions 0.0.1 - URIParser 0.0.2 - URLParse 0.0.0 - WinRPM0.1.1 - ZMQ 0.1.13 - Zlib 0.1.7 On Tuesday, September 30, 2014 2:57:05 PM UTC-6, Ivar Nesje wrote: A good start would be to post the output from Pkg.status() here. That makes it easier to see how packages might interact to cause this situation.
[julia-users] Re: Pkg.add fail
...and Pkg.update() lists thousands of errors, finishing with: WARNING: Images and Cairo had build errors... After these Jewel can be added. Strange...
Re: [julia-users] Re: Calling Julia from .NET
The indicates the cmd prompt working directory: ``` C:\cmn\Julia-0.3.0bin\ConsoleApplication2.exe 1.4142135623730951 ``` Otherwise, try passing the bin path as a char* to jl_init as suggested. On Tue, Sep 30, 2014 at 11:24 AM, Stefan Babinec sysli...@gmail.com wrote: I've copied exe file directly to julia's bin directory Isaiah. And I get the above mentioned error when I try to run it in the bin directory. On Tuesday, September 30, 2014 4:57:41 PM UTC+2, Isaiah wrote: Try running it from the Julia directory as `bin\CommandLine2.exe`. This is very much a minimal example; for general use, the bin directory should be passed as an argument to `jl_init`: https://github.com/JuliaLang/julia/blob/1ee440bee5035ccb33f82b8a45febd dd2f973baa/src/jlapi.c#L70-L73 To go much further than this will really require to dig in to both jlapi.c and the general Julia source code. Be aware that dealing with type translation and garbage collection are both non-trivial. See also `examples/embedding.c` in the julia tree, and several previous discussion on the mailing list. On Tue, Sep 30, 2014 at 9:08 AM, Stefan Babinec sysl...@gmail.com wrote: Hi Isaiah. I tried and got this error: System image file ?l\../lib/julia/sys.ji not found System Image sys.ji looks to be on his place and I have no problem running Julia. Thanks. On Tuesday, September 30, 2014 2:03:42 PM UTC+2, Isaiah wrote: I should mention that it is necessary to change the project target CPU from the default Any to x64 or x86 to match the libjulia architecture. On Sep 29, 2014 11:58 PM, Isaiah Norton isaiah...@gmail.com wrote: I tried this some time ago during 0.2, so to make sure it still works I made a minimal translation of the embedding example to C#: ``` using System; using System.Runtime.InteropServices; namespace ConsoleApplication2 { class Program { [DllImport(libjulia.dll)] static extern void jl_init(); [DllImport(libjulia.dll)] static extern void jl_eval_string(string message); static void Main(string[] args) { jl_init(); jl_eval_string(print(sqrt(2.0))); } } } ``` I compiled this, copied the binary into `Julia-0.3.0\bin`, and it works: ``` C:\cmn\Julia-0.3.0bin\ConsoleApplication2.exe 1.4142135623730951 ``` On Mon, Sep 29, 2014 at 4:11 PM, Tobias Knopp tobias...@googlemail.com wrote: yep, I have done this (mostly for fun) before and it works. One needs some experience with P/Invoke of course but this is no magic but similar to our ccall. Cheers, Tobi Am Montag, 29. September 2014 20:52:10 UTC+2 schrieb Stefan Karpinski: I assume that you can call C libraries from .NET, right? The C library for Julia is libjulia – how to call it from C is explained in the embedding docs, calling it from .NET should be similar. On Sep 29, 2014, at 12:37 PM, Guido De Bouver guido.d...@telenet.be wrote: I have not found the C# examples, but I have not looked for them. Sorry for that. So, any help on this, how could we call Julia from .NET
Re: [julia-users] change location of .julia folderd on windows xp
Thanks Isaiah, I created a system variable JULIA_PKGDIR with the path I wanted. Restarted Julia and ran Pkg.init() On Tuesday, 30 September 2014 12:32:01 UTC+10, Isaiah wrote: That batch file doesn't start Julia. You will need to add JULIA_PKGDIR to your environment, or set it via a batch file that does start julia.exe. On Mon, Sep 29, 2014 at 10:09 PM, Adrian Torrie adrian...@gmail.com javascript: wrote: Hi, Current location of the .julia folder is not appropriate due to size limitations of roaming profile set by corporate domain admins. I cannot change the size of my roaming profile as I do not have domain admin rights. I would like to be able to change the package install directory to another place on my C:\ drive. I have local admin rights. I have installed julia to: C:\Julia\Julia-0.3.1\ I tried changing C:\Julia\Julia-0.3.1\bin\prepare-julia-env.bat by adding the line set JULIA_PKGDIR=C:\Julia\Julia-0.3.1\share\packages without any success (it still initialises in %APPDATA%\.julia): @rem @rem This file attempts to auto detect and configure the environment @rem for starting julia and julia-web-server @rem @rem It sets the path as needed to reference various lib and bin @rem files, and builds sys.ji if needed. @rem set JULIA_PKGDIR=C:\Julia\Julia-0.3.1\share\packages set SYS_PATH=%PATH% set PATH=%~dp0;%~dp0bin;%~dp0usr\bin;%~dp0..\usr\bin;%~dp0..\..\usr\bin;% SYS_PATH% set JULIA_EXE=julia.exe for %%A in (%JULIA_EXE%) do set JULIA_HOME=%%~dp$PATH:A set JULIA=%JULIA_HOME%%JULIA_EXE% set PATH=%SYS_PATH% set private_libdir=bin if not exist %JULIA_HOME%..\lib\julia\sys.ji ( ^ echo Preparing Julia for first launch. This may take a while ^ echo You may see two git related errors. This is completely normal ^ cd %JULIA_HOME%..\share\julia\base ^ %JULIA% --build %JULIA_HOME%..\lib\julia\sys0 sysimg.jl ^ %JULIA% --build %JULIA_HOME%..\lib\julia\sys -J sys0.ji sysimg.jl ^ popd pushd %cd% ) Unsure of how to proceed to put the package installs into a custom location, any help would be appreciated. Regards, Adrian
Re: [julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)
If anyone can get Julia Studio to work with Julia 0.3, that would great, but I have had no luck. You can read here https://groups.google.com/forum/#!searchin/julia-users/julia$20studio/julia-users/N-__nw3Wd04/eHshKzndRqgJ about Forio discontinuing support for Julia Studio. Best, Bradley On Tuesday, September 30, 2014 10:58:42 AM UTC-5, Leah Hanson wrote: Maybe you could start a new julia-users thread, and post the code and the error message so we can help? It's hard to make specific recommendations without seeing the code/error. -- Leah On Tue, Sep 30, 2014 at 9:27 AM, Ján Dolinský jan.do...@2bridgz.com javascript: wrote: Hello guys, Indeed, www.junolab.org makes me want to go with Julia farther too :). I was asking about debugging because I implemented a custom type (in a module) of which constructor is failing somewhere but I just get an error about some array multiplication in some julia file instead of a concrete line number in the constructor function. Any idea how to get through this ? Thanks a lot, Jan Dňa pondelok, 29. septembra 2014 12:27:07 UTC+2 Viral Shah napísal(-a): The light table work that Mike Innes has done is now packaged and available at http://www.junolab.org/ We are hoping to work towards making self-sufficient binaries and getting it to a point where it is usable with a single download. The real fun is to then try and do more interesting things. I don't know what those are, but I do feel that we are setting ourselves up with a good base. -viral On Saturday, September 27, 2014 12:38:39 PM UTC+5:30, colint...@gmail.com wrote: No, I don't think it has debugging a la the Matlab IDE or R-Studio (yet). My understanding is that for now the Debug package is all that is available. Personally I make do with sending blocks of code to a console in Sublime-IJulia (you can do this with shift+enter, just like in R-Studio). Cheers, Colin On Friday, September 26, 2014 7:00:09 PM UTC+10, Ján Dolinský wrote: Hello, I cloned the master branch of Julia Studio and compiled it. I am however getting this error when running ./JuliaStudio : libExtensionSystem.so.1: cannot open shared object file: No such file or directory however when running using ./julia-studio.sh it runs but fails to open a console with the following errors: Error: Failed to start Julia. Expected location: /usr/local/Julia_Studio/julia I am little bit lost here but exploring the Julia Studio menu I assume that it doe not provide debugging capability (I had an impression that it does). Thanks, Jan Dňa piatok, 19. septembra 2014 11:57:47 UTC+2 Uwe Fechner napísal(-a): I think that this branch is already merged into the master branch: https://github.com/forio/julia-studio/tree/julia-0.3-compatibility On Friday, September 19, 2014 11:54:41 AM UTC+2, Uwe Fechner wrote: If you compile Julia Studio from source it should work with Julia 0.3. See: https://github.com/forio/julia-studio/issues/241 Regards: Uwe On Friday, September 19, 2014 10:58:26 AM UTC+2, Ján Dolinský wrote: Hello guys, After upgrading to Julia 0.3.0 Julia Studio stopped working (I changed the symbolic links in Julia Studio directory but nevertheless ...). Can somebody suggest any workaround ? Is it true that Julia Studio will not support newer versions of Julia ? What are you guys using now ? Thanks a lot, Jan
[julia-users] Simple benchmark improvement question
Greetings, I'm a reasonably proficient user of MATLAB and Python/NumPy/SciPy doing computational physics. Since Julia appears to be designed to be very well suited to many such applications, I was curious to test its performance before investing much time in converting any research code. To start out, I wrote up the classic 2D regular finite difference Laplace benchmark in Julia, Python and MATLAB in both vectorized and loop versions and tested them all. The results shown in the following Google spreadsheet (all results obtained using a 5000x5000 grid and doing 100 iterations for a reasonable sample using a Haswell i7-4710HQ CPU on Windows 8.1, using Julia 0.3.1, Anaconda 2.0.1 and MATLAB R2014a): https://docs.google.com/spreadsheets/d/1mJ8wNiyYVszkVapRVHvRJZG9j9XQhLLPvaUJwiWrJXY/pubhtml The code itself is published as follows: Julia: http://pastebin.com/AAdXXYZC Python: http://pastebin.com/5hqi9xzf As can be clearly seen, Julia does handily beat both MATLAB and basic Python/NumPy. It does however lose by a factor of 1.65 to a Numba-jitted version of the same Python code (obtained by simply adding a @jit(target='cpu') decorator on top of the appropriate function in naive Python code), which compiles to the same LLVM stack Julia uses. I deliberately avoided using more complex JIT techniques for Python (such as using Pythran to compile to OpenMP-enabled C code by specifying function signatures) to stick to single core performance only. Given these results and the virtual given that my Julia code is naive, non-idiomatic and just plain bad, I'd like to know if there's anything I could improve to match or (if possible) beat JIT-compiled Python.
Re: [julia-users] Simple benchmark improvement question
Your code looks quite good – and the devectorized version avoids creating copies of slices, which is currently one of the major performance issues with this kind of code (to be fixed in the next major release). You can see the inferred types of all the local variables like this: (@code_typed laplace_unvectorized())[1].args[2][2] – and everything has a concrete type, so there's nothing to improve in terms of typing. Adding the @inbounds annotation to the innermost for loop was one of the first things I thought to try, but that doesn't seem to have any benefit – I think the array accesses are all inlined and LLVM can hoist the bounds checks out of the loop (or eliminate them entirely). What does end up making a big difference is swapping the iteration order of i and j. Instead of doing `for i=2:nx-1, j=2:ny-1` do `for j=2:ny-1, i=2:nx-1` – I don't recall whether NumPy arrays are row-major (I think they are) but Julia is column-major like Fortran and you want to iterate along columns innermost. On my machine, doing it in the original order is 1.61x slower, which may be exactly the explanation of the difference you're seeing between Julia and Numba. On Tue, Sep 30, 2014 at 7:08 PM, dextori...@gmail.com wrote: Greetings, I'm a reasonably proficient user of MATLAB and Python/NumPy/SciPy doing computational physics. Since Julia appears to be designed to be very well suited to many such applications, I was curious to test its performance before investing much time in converting any research code. To start out, I wrote up the classic 2D regular finite difference Laplace benchmark in Julia, Python and MATLAB in both vectorized and loop versions and tested them all. The results shown in the following Google spreadsheet (all results obtained using a 5000x5000 grid and doing 100 iterations for a reasonable sample using a Haswell i7-4710HQ CPU on Windows 8.1, using Julia 0.3.1, Anaconda 2.0.1 and MATLAB R2014a): https://docs.google.com/spreadsheets/d/1mJ8wNiyYVszkVapRVHvRJZG9j9XQhLLPvaUJwiWrJXY/pubhtml The code itself is published as follows: Julia: http://pastebin.com/AAdXXYZC Python: http://pastebin.com/5hqi9xzf As can be clearly seen, Julia does handily beat both MATLAB and basic Python/NumPy. It does however lose by a factor of 1.65 to a Numba-jitted version of the same Python code (obtained by simply adding a @jit(target='cpu') decorator on top of the appropriate function in naive Python code), which compiles to the same LLVM stack Julia uses. I deliberately avoided using more complex JIT techniques for Python (such as using Pythran to compile to OpenMP-enabled C code by specifying function signatures) to stick to single core performance only. Given these results and the virtual given that my Julia code is naive, non-idiomatic and just plain bad, I'd like to know if there's anything I could improve to match or (if possible) beat JIT-compiled Python.
[julia-users] ANN: ValidatedNumerics.jl 0.0.1 -- interval arithmetic for Julia
This is an announcement of a preliminary version of ValidatedNumerics.jl, a Julia package for performing validated floating-point calculations via interval arithmetic. Currently, the package consists of a pure-Julia implementation of interval arithmetic. It uses macros extensively to produce intervals that are rigorously guaranteed to enclose the user's input. These can then be manipulated using standard arithmetic operations and elementary functions: julia a = @interval(π) [3.1415926535897931e+00, 3.1415926535897936e+00] with 53 bits of precision julia b = @interval(0.1+pi, pi^2) [3.2415926535897928e+00, 9.8696044010893615e+00] with 53 bits of precision julia a * b [1.0183763666448336e+01, 3.1006276680299834e+01] with 53 bits of precision julia exp(a-b) [1.196910353930426e-03, 9.0483741803596041e-01] with 53 bits of precision Further examples are given in the README at https://github.com/dpsanders/ValidatedNumerics.jl Functionality building on top of this base, such as root-finding methods, are currently in active development. A comparison and/or tests with the MPFI.jl wrapper around the MPFI interval library is also planned. Suggestions and contributions are warmly welcomed. The authors of the package are Luis Benet and David P. Sanders.
[julia-users] Geometry package
A Geometry package has been discussed here https://groups.google.com/d/topic/julia-dev/vZpZ8NBX_z8/discussion and here https://groups.google.com/d/topic/julia-dev/fqwnyOojRdg/discussion (Spherical, Geographic, Homogeneous coordinate systems in 1 to 4 dimensions and more). I'm in need of something significantly simpler: a Geometry module for a Cartesian coordinate system in 3D with Point, Direction, and Line types. Has anyone written something like that? Maybe that ambitious Geometry package is further along or been announced and I missed it? Thanks a bunch!
Re: [julia-users] ANN: ValidatedNumerics.jl 0.0.1 -- interval arithmetic for Julia
This is super cool. On Tue, Sep 30, 2014 at 8:01 PM, David P. Sanders dpsand...@gmail.com wrote: This is an announcement of a preliminary version of ValidatedNumerics.jl, a Julia package for performing validated floating-point calculations via interval arithmetic. Currently, the package consists of a pure-Julia implementation of interval arithmetic. It uses macros extensively to produce intervals that are rigorously guaranteed to enclose the user's input. These can then be manipulated using standard arithmetic operations and elementary functions: julia a = @interval(π) [3.1415926535897931e+00, 3.1415926535897936e+00] with 53 bits of precision julia b = @interval(0.1+pi, pi^2) [3.2415926535897928e+00, 9.8696044010893615e+00] with 53 bits of precision julia a * b [1.0183763666448336e+01, 3.1006276680299834e+01] with 53 bits of precision julia exp(a-b) [1.196910353930426e-03, 9.0483741803596041e-01] with 53 bits of precision Further examples are given in the README at https://github.com/dpsanders/ValidatedNumerics.jl Functionality building on top of this base, such as root-finding methods, are currently in active development. A comparison and/or tests with the MPFI.jl wrapper around the MPFI interval library is also planned. Suggestions and contributions are warmly welcomed. The authors of the package are Luis Benet and David P. Sanders.
Re: [julia-users] ANN: ValidatedNumerics.jl 0.0.1 -- interval arithmetic for Julia
El martes, 30 de septiembre de 2014 19:11:56 UTC-5, Stefan Karpinski escribió: This is super cool. Glad you like it! :) I have to get round to adding the cute `..` syntax from your notebook (which is great, by the way! And probably still mineable for more useful tidbits) On Tue, Sep 30, 2014 at 8:01 PM, David P. Sanders dpsa...@gmail.com javascript: wrote: This is an announcement of a preliminary version of ValidatedNumerics.jl, a Julia package for performing validated floating-point calculations via interval arithmetic. Currently, the package consists of a pure-Julia implementation of interval arithmetic. It uses macros extensively to produce intervals that are rigorously guaranteed to enclose the user's input. These can then be manipulated using standard arithmetic operations and elementary functions: julia a = @interval(π) [3.1415926535897931e+00, 3.1415926535897936e+00] with 53 bits of precision julia b = @interval(0.1+pi, pi^2) [3.2415926535897928e+00, 9.8696044010893615e+00] with 53 bits of precision julia a * b [1.0183763666448336e+01, 3.1006276680299834e+01] with 53 bits of precision julia exp(a-b) [1.196910353930426e-03, 9.0483741803596041e-01] with 53 bits of precision Further examples are given in the README at https://github.com/dpsanders/ValidatedNumerics.jl Functionality building on top of this base, such as root-finding methods, are currently in active development. A comparison and/or tests with the MPFI.jl wrapper around the MPFI interval library is also planned. Suggestions and contributions are warmly welcomed. The authors of the package are Luis Benet and David P. Sanders.
Re: [julia-users] curl: (22) The requested URL returned error: 403
Thanks a lot. On Wednesday, October 1, 2014 4:57:06 AM UTC+8, Mike Nolta wrote: Looks like patchelf-0.8.tar.gz didn't have the right permissions on our mirror. Should be fixed now. -Mike On Tue, Sep 30, 2014 at 4:49 PM, Ivar Nesje iva...@gmail.com javascript: wrote: Try again later and check your Internet connection.
Re: [julia-users] ANN: ValidatedNumerics.jl 0.0.1 -- interval arithmetic for Julia
We may actually end up using that for real field access and allowing a.b to be overloaded, so it may be ill advised to use a..b. I think that a ± b should be safe though. On Tue, Sep 30, 2014 at 8:21 PM, David P. Sanders dpsand...@gmail.com wrote: El martes, 30 de septiembre de 2014 19:11:56 UTC-5, Stefan Karpinski escribió: This is super cool. Glad you like it! :) I have to get round to adding the cute `..` syntax from your notebook (which is great, by the way! And probably still mineable for more useful tidbits) On Tue, Sep 30, 2014 at 8:01 PM, David P. Sanders dpsa...@gmail.com wrote: This is an announcement of a preliminary version of ValidatedNumerics.jl, a Julia package for performing validated floating-point calculations via interval arithmetic. Currently, the package consists of a pure-Julia implementation of interval arithmetic. It uses macros extensively to produce intervals that are rigorously guaranteed to enclose the user's input. These can then be manipulated using standard arithmetic operations and elementary functions: julia a = @interval(π) [3.1415926535897931e+00, 3.1415926535897936e+00] with 53 bits of precision julia b = @interval(0.1+pi, pi^2) [3.2415926535897928e+00, 9.8696044010893615e+00] with 53 bits of precision julia a * b [1.0183763666448336e+01, 3.1006276680299834e+01] with 53 bits of precision julia exp(a-b) [1.196910353930426e-03, 9.0483741803596041e-01] with 53 bits of precision Further examples are given in the README at https://github.com/dpsanders/ValidatedNumerics.jl Functionality building on top of this base, such as root-finding methods, are currently in active development. A comparison and/or tests with the MPFI.jl wrapper around the MPFI interval library is also planned. Suggestions and contributions are warmly welcomed. The authors of the package are Luis Benet and David P. Sanders.
Re: [julia-users] ANN: ValidatedNumerics.jl 0.0.1 -- interval arithmetic for Julia
On Tue, Sep 30, 2014 at 7:27 PM, Stefan Karpinski ste...@karpinski.org wrote: We may actually end up using that for real field access and allowing a.b to be overloaded, so it may be ill advised to use a..b. I think that a ± b should be safe though. OK, good to know, thanks; I'll hold off for now, then. On Tue, Sep 30, 2014 at 8:21 PM, David P. Sanders dpsand...@gmail.com wrote: El martes, 30 de septiembre de 2014 19:11:56 UTC-5, Stefan Karpinski escribió: This is super cool. Glad you like it! :) I have to get round to adding the cute `..` syntax from your notebook (which is great, by the way! And probably still mineable for more useful tidbits) On Tue, Sep 30, 2014 at 8:01 PM, David P. Sanders dpsa...@gmail.com wrote: This is an announcement of a preliminary version of ValidatedNumerics.jl, a Julia package for performing validated floating-point calculations via interval arithmetic. Currently, the package consists of a pure-Julia implementation of interval arithmetic. It uses macros extensively to produce intervals that are rigorously guaranteed to enclose the user's input. These can then be manipulated using standard arithmetic operations and elementary functions: julia a = @interval(π) [3.1415926535897931e+00, 3.1415926535897936e+00] with 53 bits of precision julia b = @interval(0.1+pi, pi^2) [3.2415926535897928e+00, 9.8696044010893615e+00] with 53 bits of precision julia a * b [1.0183763666448336e+01, 3.1006276680299834e+01] with 53 bits of precision julia exp(a-b) [1.196910353930426e-03, 9.0483741803596041e-01] with 53 bits of precision Further examples are given in the README at https://github.com/dpsanders/ValidatedNumerics.jl Functionality building on top of this base, such as root-finding methods, are currently in active development. A comparison and/or tests with the MPFI.jl wrapper around the MPFI interval library is also planned. Suggestions and contributions are warmly welcomed. The authors of the package are Luis Benet and David P. Sanders. -- Dr. David P. Sanders Profesor Titular A / Associate Professor Departamento de Física, Facultad de Ciencias Universidad Nacional Autónoma de México (UNAM) dpsand...@ciencias.unam.mx http://sistemas.fciencias.unam.mx/~dsanders Cubículo / office: #414, 4o. piso del Depto. de Física Tel.: +52 55 5622 4965
[julia-users] Re: cannot add any packages - Julia on Windows7 x64
Try Pkg.clone(https://github.com/JuliaLang/WinRPM.jl.git;) for WinRPM, it might fail because it needs Zlib so Pkg.clone(https://github.com/dcjones/Zlib.jl.git;) first. it worked for me on windows
[julia-users] JuliaBox early users
Folks, We are almost ready to accommodate more users on JuliaBox. It is already being used in a couple of classes. It is not yet ready to be thrown open publicly, but we need early users who will help us make it better, test it out, and demand interesting new things! If you would like to use it in a class, let us know and we will send you a code and help out in any way we can to support teaching Julia in the classroom. If you would just like to try it out, we will send you a code. However, you have to promise us that you will file lots of issues to help make it better. :-) We hope that it should be generally available in a few weeks, and that we will magically get compute time grants! -viral
[julia-users] JuliaBox early users
Great! How do I get an invitation code?
[julia-users] Re: JuliaBox early users
Just write to me or @Shashi (https://github.com/shashi). -viral On Wednesday, October 1, 2014 10:00:13 AM UTC+5:30, Thomas Covert wrote: Great! How do I get an invitation code?
[julia-users] Re: JuliaBox early users
And here's the mailing list: https://groups.google.com/forum/#!forum/julia-box -viral On Wednesday, October 1, 2014 8:49:27 AM UTC+5:30, Viral Shah wrote: Folks, We are almost ready to accommodate more users on JuliaBox. It is already being used in a couple of classes. It is not yet ready to be thrown open publicly, but we need early users who will help us make it better, test it out, and demand interesting new things! If you would like to use it in a class, let us know and we will send you a code and help out in any way we can to support teaching Julia in the classroom. If you would just like to try it out, we will send you a code. However, you have to promise us that you will file lots of issues to help make it better. :-) We hope that it should be generally available in a few weeks, and that we will magically get compute time grants! -viral
[julia-users] Re: cannot add any packages - Julia on Windows7 x64
Thanks for the information. I installed another Julia version, but still cannot use packages; now error messages are different: julia versioninfo() Julia Version 0.3.1 Commit c03f413* (2014-09-21 21:30 UTC) Platform Info: System: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge) LAPACK: libopenblas LIBM: libopenlibm LLVM: libLLVM-3.3 julia Pkg.clone(https://github.com/dcjones/Zlib.jl.git;) ERROR: stat: unknown error (UNKNOWN) in stat at stat.jl:40 julia Pkg.clone(https://github.com/JuliaLang/WinRPM.jl.git;) ERROR: stat: unknown error (UNKNOWN) in stat at stat.jl:40 julia Pkg.add(Example) INFO: Cloning cache of Example from git://github.com/JuliaLang/Example.jl.git INFO: Installing Example v0.3.3 error: internal error: refs/remotes/origin/master is not a valid packed reference! error: internal error: refs/tags/v0.0.1 is not a valid packed reference! error: internal error: refs/tags/v0.0.2 is not a valid packed reference! error: internal error: refs/tags/v0.1 is not a valid packed reference! error: internal error: refs/tags/v0.1.0 is not a valid packed reference! error: internal error: refs/tags/v0.2.0 is not a valid packed reference! error: internal error: refs/tags/v0.2.1 is not a valid packed reference! error: internal error: refs/tags/v0.3.0 is not a valid packed reference! error: internal error: refs/tags/v0.3.1 is not a valid packed reference! error: internal error: refs/tags/v0.3.2 is not a valid packed reference! error: internal error: refs/tags/v0.3.3 is not a valid packed reference! error: Trying to write ref refs/heads/master with nonexistent object 98f978a0c5276e0df5445f0a3891380adda788bc fatal: Cannot update the ref 'HEAD'. fatal: The remote end hung up unexpectedly ERROR: failed process: Process(`git clone -q 'S:\.julia\v0.3\.cache\Example' Example`, ProcessExited(128)) [128] in wait at task.jl:51 julia julia Pkg.add(Gadfly) fatal: Not a git repository: 'S:\.julia\v0.3\Example\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\v0.3\Example' '--git-dir=S:\.julia\v0.3\Example\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in cmd_gen at process.jl:608 in add at pkg/entry.jl:319 in add at pkg/entry.jl:44 julia julia Pkg.add(Helpme) fatal: Not a git repository: 'S:\.julia\v0.3\Example\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\v0.3\Example' '--git-dir=S:\.julia\v0.3\Example\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in cmd_gen at process.jl:608 in add at pkg/entry.jl:319 in add at pkg/entry.jl:44 julia What else can I try? Regards, Igor
Re: [julia-users] Re: cannot add any packages - Julia on Windows7 x64
Try renaming or removing your .julia directory, and then run `Pkg.init()` first followed by the add steps. On Wed, Oct 1, 2014 at 12:48 AM, xaph...@ymail.com wrote: Thanks for the information. I installed another Julia version, but still cannot use packages; now error messages are different: julia versioninfo() Julia Version 0.3.1 Commit c03f413* (2014-09-21 21:30 UTC) Platform Info: System: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge) LAPACK: libopenblas LIBM: libopenlibm LLVM: libLLVM-3.3 julia Pkg.clone(https://github.com/dcjones/Zlib.jl.git;) ERROR: stat: unknown error (UNKNOWN) in stat at stat.jl:40 julia Pkg.clone(https://github.com/JuliaLang/WinRPM.jl.git;) ERROR: stat: unknown error (UNKNOWN) in stat at stat.jl:40 julia Pkg.add(Example) INFO: Cloning cache of Example from git:// github.com/JuliaLang/Example.jl.git INFO: Installing Example v0.3.3 error: internal error: refs/remotes/origin/master is not a valid packed reference! error: internal error: refs/tags/v0.0.1 is not a valid packed reference! error: internal error: refs/tags/v0.0.2 is not a valid packed reference! error: internal error: refs/tags/v0.1 is not a valid packed reference! error: internal error: refs/tags/v0.1.0 is not a valid packed reference! error: internal error: refs/tags/v0.2.0 is not a valid packed reference! error: internal error: refs/tags/v0.2.1 is not a valid packed reference! error: internal error: refs/tags/v0.3.0 is not a valid packed reference! error: internal error: refs/tags/v0.3.1 is not a valid packed reference! error: internal error: refs/tags/v0.3.2 is not a valid packed reference! error: internal error: refs/tags/v0.3.3 is not a valid packed reference! error: Trying to write ref refs/heads/master with nonexistent object 98f978a0c5276e0df5445f0a3891380adda788bc fatal: Cannot update the ref 'HEAD'. fatal: The remote end hung up unexpectedly ERROR: failed process: Process(`git clone -q 'S:\.julia\v0.3\.cache\Example' Example`, ProcessExited(128)) [128] in wait at task.jl:51 julia julia Pkg.add(Gadfly) fatal: Not a git repository: 'S:\.julia\v0.3\Example\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\v0.3\Example' '--git-dir=S:\.julia\v0.3\Example\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in cmd_gen at process.jl:608 in add at pkg/entry.jl:319 in add at pkg/entry.jl:44 julia julia Pkg.add(Helpme) fatal: Not a git repository: 'S:\.julia\v0.3\Example\.git' ERROR: failed process: Process(`git '--work-tree=S:\.julia\v0.3\Example' '--git-dir=S:\.julia\v0.3\Example\.git' rev-parse HEAD`, ProcessExited(128)) [128] in wait at task.jl:51 in cmd_gen at process.jl:608 in add at pkg/entry.jl:319 in add at pkg/entry.jl:44 julia What else can I try? Regards, Igor
[julia-users] ANN: Instruments.jl
BBN Technologies has released v0.0.1 of Instruments.jl, a package for controlling laboratory instruments through Julia over TCPIP/GPIB/USB/Serial. https://github.com/BBN-Q/Instruments.jl https://github.com/BBN-Q/Cliffords.jl The package is wrapper around the NI-VISA library (which needs to be separately installed) similar to PyVISA and has some starts towards making it easier to write custom instrument drivers. We've successfully used it for a few simple data taking runs in the lab. You'll need some instruments to talk to play with the package but we'd love to hear from other experimental physicists or engineers who have suggestions for what they'd like to see.
[julia-users] Re: Geometry package
Here is a start: module Geometry export Point, Direction, Ray using ImmutableArrays typealias Vec Vector3 type Point c::Vec end Point(a::Array) = Point(Vec(a)) type Direction v::Vec Direction(v) = new(unit(v)) end Direction(a::Array) = Direction(Vec(a)) type Ray pos::Point dir::Direction end Ray(a::Array,b::Array) = Ray(Point(a),Direction(b)) step(a::Point,b::Number,c::Direction) = Point(a.c + b*c.v) end Let me know what you guys think. On Wednesday, October 1, 2014 10:05:51 AM UTC+10, Yakir Gagnon wrote: A Geometry package has been discussed here https://groups.google.com/d/topic/julia-dev/vZpZ8NBX_z8/discussion and here https://groups.google.com/d/topic/julia-dev/fqwnyOojRdg/discussion (Spherical, Geographic, Homogeneous coordinate systems in 1 to 4 dimensions and more). I'm in need of something significantly simpler: a Geometry module for a Cartesian coordinate system in 3D with Point, Direction, and Line types. Has anyone written something like that? Maybe that ambitious Geometry package is further along or been announced and I missed it? Thanks a bunch!
[julia-users] Re: cannot add any packages - Julia on Windows7 x64
What I changed: 1. re install Julia 2. remove .julia folder 3. remove my git program from path But still not working Now I have following: C:\programs\j031\binjulia _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help() for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.1 (2014-09-21 21:30 UTC) _/ |\__'_|_|_|\__'_| | |__/ | x86_64-w64-mingw32 julia Pkg.init() INFO: Initializing package repository S:\.julia\v0.3 INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl julia julia julia Pkg.add(ArrayViews) INFO: Cloning cache of ArrayViews from git://github.com/lindahua/ArrayViews.jl.git INFO: Installing ArrayViews v0.4.6 error: internal error: refs/remotes/origin/master is not a valid packed reference! error: internal error: refs/tags/v0.1.0 is not a valid packed reference! error: internal error: refs/tags/v0.1.1 is not a valid packed reference! error: internal error: refs/tags/v0.2.0 is not a valid packed reference! error: internal error: refs/tags/v0.2.1 is not a valid packed reference! error: internal error: refs/tags/v0.2.2 is not a valid packed reference! error: internal error: refs/tags/v0.2.3 is not a valid packed reference! error: internal error: refs/tags/v0.2.4 is not a valid packed reference! error: internal error: refs/tags/v0.2.5 is not a valid packed reference! error: internal error: refs/tags/v0.3.0 is not a valid packed reference! error: internal error: refs/tags/v0.4.0 is not a valid packed reference! error: internal error: refs/tags/v0.4.1 is not a valid packed reference! error: internal error: refs/tags/v0.4.2 is not a valid packed reference! error: internal error: refs/tags/v0.4.3 is not a valid packed reference! error: internal error: refs/tags/v0.4.4 is not a valid packed reference! error: internal error: refs/tags/v0.4.5 is not a valid packed reference! error: internal error: refs/tags/v0.4.6 is not a valid packed reference! error: Trying to write ref refs/heads/master with nonexistent object 932408e39dafe7fda46c503dddfec985992dcb90 fatal: Cannot update the ref 'HEAD'. fatal: The remote end hung up unexpectedly ERROR: failed process: Process(`git clone -q 'S:\.julia\v0.3\.cache\ArrayViews' ArrayViews`, ProcessExited(128)) [128] in wait at task.jl:51 julia Best regards, Igor.