[julia-users] Julia v0.5.0 always killed on a memory limited cluster

2016-09-22 Thread Alan Crawford
I am using Julia v0.5.0 on a memory limited SGE cluster. In particular, to submit jobs on the cluster, both h_vmem and tmem resource flags need to be passed to in qsub command. However, all of Julia jobs keep on being killed because workers seem to be very hungry for virtual memory and ask for

[julia-users] Retrieving mutated fields from workers

2016-08-19 Thread Alan Crawford
Hi, I would like to retrieve an arbitrary object from an arbitrary process in a worker pool. After some digging I found the function getfrom(p::Int, nm::Symbol; mod=Main) = fetch(@spawnat(p, getfield(mod, nm))) in ParallelDataTransfer.jl

[julia-users] copy!() vs element-by-element copying

2015-10-14 Thread Alan Crawford
I have written the following test to see the difference between going copying element-by-element and using copy!(x,y): function test1(x,y) for i in eachindex(x) @inbounds x[i] = y[i] end end function test2(x,y) copy!(x,y) end function test() NumObs = 1000 x = rand(NumObs) y = rand(NumObs)

[julia-users] Re: Use preallocation, A[:] vs A, and wrapping and passing collections of variables as types

2015-10-07 Thread Alan Crawford
As a Matlab convert who had the same realisation recently +1 for this thread! On Wednesday, 7 October 2015 23:49:33 UTC+1, Patrick Kofod Mogensen wrote: > > Maybe I'm wrong but I think it's different in Matlab. If a variable exists > already, it will try to reuse it. I know Julia is not

Re: [julia-users] Passing Array{Array{T,N},1} to a function

2015-09-29 Thread Alan Crawford
ayPts] > Yinput = rand(InnerArrayPts) > > testfun2!(Xinput,tuple(Yinput...)) > > On Tue, 2015-09-29 at 13:20, Alan Crawford <a.r.crawf...@gmail.com> wrote: >> I would like to preallocate memory of an array of arrays and pass it to a >> function to be filled in. I

[julia-users] Passing Array{Array{T,N},1} to a function

2015-09-29 Thread Alan Crawford
I would like to preallocate memory of an array of arrays and pass it to a function to be filled in. I have created an example below that illustrates my question(s). Based on my (probably incorrect) understanding that it would be desirable to fix the type in my function, I would like to be

Re: [julia-users] Re: Passing Array{Array{T,N},1} to a function

2015-09-29 Thread Alan Crawford
Many thanks! alan On 29 Sep 2015, at 13:04, Tomas Lycken wrote: > makes a difference in this specific case is a little beyond me, but an > educated guess says that with that guarantee, it is possible to know what > type Array(Float64, InnerArrayPts) will return, making

[julia-users] Re: Passing Array{Array{T,N},1} to a function

2015-09-29 Thread Alan Crawford
array constructor you use, but > that shouldn’t matter - it’s just a question of style, which is subjective > :) ). > > Note that Vector{Float64} is just a type alias for Array{Float64, 1}. > > // T > > On Tuesday, September 29, 2015 at 1:20:02 PM UTC+2, Alan Crawford

[julia-users] Array of vectors of variable number and lengths

2015-09-21 Thread Alan Crawford
Hi, I'd like to be able to define an array of vectors where the number of vectors in the array is linked to the length of the vector. For example, I want to be define an array with say 10 scalars, 45 length 2 vectors, 120 length 3 vectors, and so on. Intuitively, I thought the following

[julia-users] Re: Array of vectors of variable number and lengths

2015-09-21 Thread Alan Crawford
nday, September 21, 2015 at 10:08:13 AM UTC+2, Alan Crawford wrote: > > Hi, >> >> I'd like to be able to define an array of vectors where the number of >> vectors in the array is linked to the length of the vector. For example, I >> want to be define an arr

Re: [julia-users] Re: Array of vectors of variable number and lengths

2015-09-21 Thread Alan Crawford
independent since otherwise you’d end up > >> producing an array with some rows/columns being of different length, > which > >> isn’t supported by Julia’s Array{T, N}. That’s fine for a loop since > for > >> i = 1:3, j = 1:i isn’t trying to fill up an array direc

Re: [julia-users] Re: Array of vectors of variable number and lengths

2015-09-21 Thread Alan Crawford
gt; producing an array with some rows/columns being of different length, which > isn’t supported by Julia’s Array{T, N}. That’s fine for a loop since for > i = 1:3, j = 1:i isn’t trying to fill up an array directly though. > > — Mike > ​ > > On Monday, 21 September 2015 10:59:31 UT

[julia-users] Re: Array of vectors of variable number and lengths

2015-09-21 Thread Alan Crawford
nday, September 21, 2015 at 10:18:31 AM UTC+2, Alan Crawford wrote: > > The lower case k is intentional. I didn't want such a 'large' array as the >> one created when I use K because large parts of that array would be >> redundant. Ideally, I want this array to be as small as po

[julia-users] Re: Array of vectors of variable number and lengths

2015-09-21 Thread Alan Crawford
e > ​ > On Monday, 21 September 2015 10:37:06 UTC+2, Alan Crawford wrote: >> >> >> Thanks Tomas. If I do: >> >> Y = [Array(Int64,n) for n in map(k -> binomial(J,k), 1:K)] >> >> Then Y[1] gives the desired result (i.e. Y[1][k] is a length 1 vector)

[julia-users] type for lufact()

2015-04-11 Thread Alan Crawford
I would like to setup a type stable function where one of the arguments is the result of lufact(A) where A::Array{Float64,2}. Here is code I wrote to test this out: A = rand(100,100); f = rand(100,1); luA = lufact(A); typeof(luA) function

[julia-users] Re: type for lufact()

2015-04-11 Thread Alan Crawford
Thanks! On Saturday, 11 April 2015 14:14:14 UTC+1, Kristoffer Carlsson wrote: It should work if you write using Base.LinAlg first On Saturday, April 11, 2015 at 2:29:57 PM UTC+2, Alan Crawford wrote: I would like to setup a type stable function where one of the arguments is the result

[julia-users] Type for lufact()

2015-04-11 Thread Alan Crawford
I would like to setup a type stable function where one of the arguments is the result of lufact(A) where A::Array{Float64,2}. Here is code I wrote to test this out: A = rand(100,100); f = rand(100,1); luA = lufact(A); typeof(luA) function

[julia-users] help with ccall example

2014-09-02 Thread Alan Crawford
hi! i'm trying to use ccall in the following example: julia x = zeros(10) 10-element Array{Float64,1}: 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 julia w = zeros(10) 10-element Array{Float64,1}: 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 julia n = 4 4 julia ccall( (:cc,

Re: [julia-users] help with ccall example

2014-09-02 Thread Alan Crawford
{Float64}),n,x,w) Med venlig hilsen Andreas Noack 2014-09-02 9:04 GMT-04:00 Alan Crawford a.r.cr...@gmail.com javascript: : hi! i'm trying to use ccall in the following example: julia x = zeros(10) 10-element Array{Float64,1}: 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0