Re: [julia-users] create command with spaces without quoting

2016-11-04 Thread Andre Bieler
Excellent, thanks for both suggestions.

[julia-users] create command with spaces without quoting

2016-11-03 Thread Andre Bieler
I want to generate a command for imagemagick and use options loaded from a file. So the number of utilized options is not known beforehand. An example might look like: convert -density 300 somefile.pdf -depth 10 somefile.jpeg It is easy to generate the string above, but when interpolating it

Re: [julia-users] Can't overwrite some methods in 0.5.0

2016-10-20 Thread Andre Bieler
myfunc should return sum(abs(a)) to make actual sense, but this does not matter for the problem I have

Re: [julia-users] Can't overwrite some methods in 0.5.0

2016-10-20 Thread Andre Bieler
> > I guess I have a similar problem, when using Optim.jl in a IJulia notebook > using Optim function myfunc(a) println("Hey") return abs(a) end x0 = [1.,2.,3.] res = optimize(myfunc, x0, iterations=20, method=BFGS()) Now when I redefine myfun() the changes do not propagate through

[julia-users] Re: ANN: ParallelDataTransfer.jl

2016-10-03 Thread Andre Bieler
Thank you Sir! :) On Sunday, October 2, 2016 at 5:30:34 PM UTC+2, Chris Rackauckas wrote: > > ParallelDataTransfer.jl > is a library > for sending and receiving data among processes defined using Julia's > parallel computing

Re: [julia-users] Re: Apparently I need to rebuild Julia?

2016-09-02 Thread Andre Bieler
All works fine if I download the binary from http://julialang.org/downloads/

Re: [julia-users] Re: Apparently I need to rebuild Julia?

2016-09-02 Thread Andre Bieler
I have the same problem for v0.4.6. I have Julia running for a while on my machine (Mint 17.2 --> Ubuntu 14.04), but now I get this error message on startup: WARNING: Error during initialization of module GMP: ErrorException("The dynamically loaded GMP library (version 6.1.0 with

[julia-users] Re: parallel for loop for list of vectors

2016-08-04 Thread Andre Bieler
pmap(zeros, 1:10)

[julia-users] Re: parallel for loop for list of vectors

2016-08-04 Thread Andre Bieler
> > you can do: > > res = pmap(zeros, 1:10) > but probably you want to replace "zeros" with a more expensive function to take advantage of the parallelism.

[julia-users] Re: parallel for loop for list of vectors

2016-08-04 Thread Andre Bieler
Do you want something like this in the end? res = [zeros(i) for i in 1:10]

[julia-users] Re: parallel for loop for list of vectors

2016-08-04 Thread Andre Bieler
this does not work as serial code either. the hcat needs vectors of same length.

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Andre Bieler
Can you tell me what you will be doing with this tree after everything is set up correctly?

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Andre Bieler
Ahmed, is it necessary that the data is stored in all 3 levels? (root has data, child has data, leaf has data) Is it not good enough if the data is stored in the leafs only? Maybe you can explain what your "end goal" is?

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-04 Thread Andre Bieler
Well for 1) this is pretty much exactly what is being done in my example code. The difference is that it prints out the content of "data". (But I put the index of each child into that "data" varialbe) My suggestion is that you insert a new field in the MyNode type, this variable can then hold

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-03 Thread Andre Bieler
and maybe someday I will be smart enough for syntax highlighting... maybe..

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-03 Thread Andre Bieler
Hi Ahmed, sorry for the late answer, but it is a busy weekend... I am not sure I understand your question, but the following for loop connects the leafs to the children. for i in 1:nChildren root.child[i].child = all_leafs[i] end Here a full example code where some information is printed in the

[julia-users] Re: A naive benchmark

2016-07-01 Thread Andre Bieler
Also remember that the first time you execute a function you should not @time it because then it also measures the compilation time. You can test this by doing @time test(m,nbp) @time test(m,nbp) @time test(m,nbp) and probably see that the 2nd and 3rd time the timing is lower than for the first

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Andre Bieler
ah for &^%$@@ sake how do you enable syntax highlighting?? I thought ```julia would do the trick?? If you tell me the secret I can re-post my previous message more nicely :)

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Andre Bieler
I think I start seeing what you want. A few questions: 1) Can the leafs be of the same type as the root and child? 2) Does every child need to have one child at least? (= no child with zero leafs) you can do the following: ```julia # this generates a list of empty vectors that can hold MyNode

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Andre Bieler
Well the child can also have children, just like in your graph you attached. This is then one level down in your graph. Note that the root is of the same type as the children. (MyNode can be parent, child, grandchild etc.) The children are just put inside the root. Then you can continue and

Re: [julia-users] How to make a tree datastructure with vector data in JULIA ?

2016-07-01 Thread Andre Bieler
Hi Ahmed, the line *MyNode() = MyNode(0,0,MyNode[])* is just to make life easier. It means that when you call MyNode() without arguments it will set some default values for you, in this case 0, 0 and MyNode[] (MyNode[] is an empty Vector that can hold elements of type MyNode). Adapting your type

[julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-06-29 Thread Andre Bieler
Not very elegant, but maybe something like this? type MyNode level::Int nLeafs::Int leafs::Vector{MyNode} end MyNode() = MyNode(0,0,MyNode[]) N = 100 root = MyNode(0,N, [MyNode() for i in 1:N]) then you can go on and define the 1st level with a for loop and so on. Because it is

[julia-users] Re: juliabloggers.com: Using Julia’s Type System For Hidden Performance Gains

2016-06-08 Thread Andre Bieler
No big deal. I enjoyed the read very much!

[julia-users] Re: juliabloggers.com: Using Julia’s Type System For Hidden Performance Gains

2016-06-08 Thread Andre Bieler
"Switching Float to Int in `test2()` makes the vector of arrays faster than `test1()` and `test*3*()`" that is in my previous post. sorry for the typo... On Wednesday, June 8, 2016 at 4:08:52 PM UTC-4, Andre Bieler wrote: > > I am somewhat confused. > > When

[julia-users] juliabloggers.com: Using Julia’s Type System For Hidden Performance Gains

2016-06-08 Thread Andre Bieler
I am somewhat confused. When reading the blog post on: http://www.juliabloggers.com/using-julias-type-system-for-hidden-performance-gains/ the first benchmark says that: "*Notice that the vector of matrices is 300x slower on an i7 computer.*" Note that the Matrices in this vector (`test2()`)

Re: [julia-users] Plots.jl bar width and color

2016-06-01 Thread Andre Bieler
Great, what about the width of the bars?

[julia-users] Plots.jl bar width and color

2016-06-01 Thread Andre Bieler
How can I set the with of bars in a bar plot. say for ```julia bar([1,2,3], [4,6,3]) ``` Is it possible to pick colors that are not defined as keywords like :black, :grey. etc? Something like #BFBFBF Cheers, Andre

Re: [julia-users] Re: Plots problem ?

2016-05-23 Thread Andre Bieler
delete the readline if you run this in a notebook or in the julia REPL. leave it if you run it as a script.

[julia-users] Re: Plots problem ?

2016-05-23 Thread Andre Bieler
Oh now I see... Neat. But you then need to have different ranges for the x variable. using Plots x = linspace(-2, 2, 100) xh = linspace(0, 2, 50) xk = linspace(-2, 0, 50) f = sqrt(complex(4 .- x.^2)) g = -sqrt(complex(4 .- x.^2)) h = sqrt(complex(-xh.^2 .+ 2 * xh)) k = -sqrt(complex(-xk.^2

Re: [julia-users] Re: Plots problem ?

2016-05-23 Thread Andre Bieler
Not exactly sure what you want to do. But you take the square root of negative numbers, which then is a complex number. I dont think you can give plot a complex number to plot? The following code works, maybe you can work your way from there... ```julia using Plots x=linspace(-2,2,100) f(x) =

[julia-users] Re: [ANN & RFC] Measurements.jl: Uncertainty propagation library

2016-05-19 Thread Andre Bieler
As an experimental physicist I thank you very much for this package! :D On Tuesday, May 17, 2016 at 11:21:27 PM UTC+2, Mosè Giordano wrote: > > Hi Lucas, > > Looks great! >> >> How about overloading the ± operator? >> using Measurements >> >> ±(μ, σ) = Measurement(μ, σ) >> # => ± (generic

[julia-users] Re: Starting Julia with Julia -p 2 provides 1 worker

2016-04-19 Thread Andre Bieler
Huh.. I just tried julia -p 2 on version 0.4.5 and it actually starts with 3 processes and 2 workers. So the docs are correct. Sorry i cant help with the 0.5 version..

[julia-users] Re: Starting Julia with Julia -p 2 provides 1 worker

2016-04-19 Thread Andre Bieler
As Greg said, the total number of workers is one less than the number of available processes. There is always one master process (with id = 1, and not considered a worker) and the remaining workers. So for *julia -p 3 *you will get one master process and two workers. The documentation may be

[julia-users] Re: packages that depend on unregistered packages (also: pkg REQUIRE allow urls)?

2016-02-10 Thread Andre Bieler
+1 for allowing URLs in the REQUIRE file

[julia-users] Re: Julia vs Matlab: interpolation and looping

2016-02-02 Thread Andre Bieler
I found that reducing memory allocation in the loop does not do much in terms of speed. E.g. when doing something like xx = xprime[:] the timing difference between sql(xprime[:]) and sql(xx) is only about 5%. so my guess is most of the time is just spent inside the sql() function call and

[julia-users] yet another benchmark with numba and fortran

2016-01-29 Thread Andre Bieler
Someone posted a benchmark for Numba and Fortran https://www.reddit.com/r/Python/comments/431tsm/numba_applied_to_high_intensity_computations_a/ As a Friday afternoon project I ported the Python version to Julia https://github.com/abieler/LJSim.jl (please go to the reddit link above to also

[julia-users] Re: yet another benchmark with numba and fortran

2016-01-29 Thread Andre Bieler
fer Carlsson wrote: >> >> boxl3 is not defined >> >> On Friday, January 29, 2016 at 6:19:09 PM UTC+1, Andre Bieler wrote: >>> >>> Someone posted a benchmark for Numba and Fortran >>> >>> >>> https://www.reddit.com/r/Python/co

[julia-users] @workers

2015-12-30 Thread Andre Bieler
what about adding an *@workers* macro that does the same thing as *@everywhere* but only on the workers?

[julia-users] Re: Why is the order of these loops barely affects the time?

2015-12-21 Thread Andre Bieler
Hi Joaquim, First, you need to call the functions once before timing them, otherwise the compilation time is also included. Second, N is a global variable in your example, which is slow. If you want to use N as a global variable, make it a constant with const N = 100 this will increase the speed

[julia-users] Re: Using DataFrames

2015-12-09 Thread Andre Bieler
On Tuesday, December 8, 2015 at 11:27:34 PM UTC-5, Vishnu Raj wrote: > > This is my sample CSV. It is an extract from UCI SUSY dataset, only first > few were saved using an R script. > > > On Wednesday, December 9, 2015 at 3:26:19 AM UTC+5:30, Andre Bieler wrote: >> >

[julia-users] ARGS on workers

2015-12-08 Thread Andre Bieler
When having multiple workers (in my case on one machine) the ARGS variable only has the cmdline arguments on the proc with myid() == 1. For the other workers it is just an empty list. I don't know if this is intended or not. See below how I update the ARGS variable on the workers. The procedure

[julia-users] Re: Using DataFrames

2015-12-08 Thread Andre Bieler
separator. On Tuesday, December 8, 2015 at 4:56:19 PM UTC-5, Andre Bieler wrote: > > I cannot reproduce this. > Can you provide your data file? > > I attached a .cvs file and a .jl file to > read out the data. Seems all good to me > and the values are stored as Float64. > > >

[julia-users] Re: Using DataFrames

2015-12-08 Thread Andre Bieler
I cannot reproduce this. Can you provide your data file? I attached a .cvs file and a .jl file to read out the data. Seems all good to me and the values are stored as Float64. On Tuesday, December 8, 2015 at 7:24:26 AM UTC-5, Vishnu Raj wrote: > > Hi, > I have a CSV file with values

[julia-users] Re: @everywhere and memory allocation

2015-12-01 Thread Andre Bieler
I think you are looking for shared arrays? http://docs.julialang.org/en/latest/manual/parallel-computing/#id2 On Tuesday, December 1, 2015 at 2:55:59 PM UTC-5, Pieterjan Robbe wrote: > > does the @everywhere macro allocate extra memory to make local copies of a > matrix for every processor? >

[julia-users] Re: Ray tracing for complex geometry

2015-11-24 Thread Andre Bieler
@Simon GLVisualize looks great! I ll try using it as soon as there is an opportunity. (and then bother you with questions.. ;) ) @kleinsplash Not sure if those meshing libraries are the right place to put my stuff. I didnt even know about all these packages until I posted my answer here. I will

Re: [julia-users] Re: passing data by remotecall_fetch slower than writing & loading from disk

2015-11-23 Thread Andre Bieler
New issue opened #14106 https://github.com/JuliaLang/julia/issues/14106

Re: [julia-users] Re: passing data by remotecall_fetch slower than writing & loading from disk

2015-11-22 Thread Andre Bieler
So I did a more fair comparison. (file attached) Doing the same decomposition and re-assembly as for the hdf5 version. It is about a factor of 2 faster than the hdf5 version now. Tim, is this about what you would expect? (I thought it should be even faster than this) I ll open an issue on this.

[julia-users] passing data by remotecall_fetch slower than writing & loading from disk

2015-11-19 Thread Andre Bieler
I have an array (lets call it "data") containing composite types. something like type MyType x::Float64 y::Float64 end (basically just a collection of Floats and Ints..) Now sending this data to a worker by remotecall_fetch(iProc, someFunc, data) is about 100 times slower than the

[julia-users] Re: copy a local variable to all parallel workers

2015-10-31 Thread Andre Bieler
Thanks for the clarification. How do I make it available to pfunc.showData then? (without having to explicitly send it as an argument in the function call) The goal would be to have a large chunk of data having locally available to the workers which then can independently work on it and only

[julia-users] Re: copy a local variable to all parallel workers

2015-10-30 Thread Andre Bieler
I have a similar question about getting data to all workers. Consider the following code: ''' addprocs(2) using pfuncs #= @everywhere function showData() @show(data) end =# function pstep() @sync begin for p in workers() @async begin remotecall_fetch(p, showData)

[julia-users] Re: A grateful scientist

2015-10-27 Thread Andre Bieler
I +1 on the thanks from scientist. I changed 90% of my data analysis scripts from Python to Julia and never looked back. For what its worth: I have an upcoming paper in Nature on Thursday that of course credits the Julia language! :) (Its the least I could do) It really made my research

[julia-users] accessing local copies of variables on parallel workers

2015-10-20 Thread Andre Bieler
Hi, I have an Array (e.g. allCells = Array(Cell, nCells) ) of types. Now I want each processor to work on a different subset of those elements. If I do *remotecall_fetch(iProc, myFunction, allCells[idx])*with *function myFunction(cell) doSomethingTo(cell)end* it works as expected, but

Re: [julia-users] Re: example for ccall use and fortran

2015-06-01 Thread Andre Bieler
, May 31, 2015 at 3:17 AM, Andre Bieler andre.b...@gmail.com javascript: wrote: Ok so I have a few simple examples working for ccalling fortran functions and subroutines from Julia. Maybe someone will find this useful examples when first looking into calling fortran from julia. compile

[julia-users] Re: example for ccall use and fortran

2015-05-30 Thread Andre Bieler
Ok so I have a few simple examples working for ccalling fortran functions and subroutines from Julia. Maybe someone will find this useful examples when first looking into calling fortran from julia. compile the following fortran mod ``` !fileName = simplemodule.f95 module simpleModule implicit

[julia-users] Re: example for ccall use and fortran

2015-05-30 Thread Andre Bieler
Ok so I have a few simple examples working for ccalling fortran functions and subroutines from Julia. Maybe someone will find this useful examples when first looking into calling fortran from julia. compile the following fortran module with *gfortran simplemodule.f95 -o simplemodule.so -shared

[julia-users] unexpected if statement behavior

2015-04-03 Thread Andre Bieler
I have the following (for me) unexpected behavior for an if statement in the code below: It is not the same If I comment out the line data = readdlm(somefile.dat) or not. even if the if-statement is evaluated as false. The function takes much longer to execute when the line is not commented

Re: [julia-users] Re: julia vs cython benchmark

2014-12-07 Thread Andre Bieler
here without too much shenanigans. On Sat, Dec 6, 2014 at 5:50 PM, Andre Bieler andre.b...@gmail.com javascript: wrote: for completeness: with the inner loops now going through the first index as suggested by Jeff, there was another increase in speed. So now I stand at *16.8 s

[julia-users] Re: julia vs cython benchmark

2014-12-07 Thread Andre Bieler
vectorized numpy i dont know the result.. :) but not sure if it would be a good approach anyway as the outer loop can end after one iteration already.

[julia-users] Re: julia vs cython benchmark

2014-12-06 Thread Andre Bieler
for completeness: with the inner loops now going through the first index as suggested by Jeff, there was another increase in speed. So now I stand at *16.8 s* on average with julia. The same thing in python/numpy takes roughly *6800 s* to run (however not vectorized in numpy, using for loops as

[julia-users] Re: julia vs cython benchmark

2014-11-27 Thread Andre Bieler
alright! did the @inbounds and @simd and benchmarked again (for different light source position, thats why numbers dont match exactly with the ones above) cython original code: 27.5 s julia original code:28.3 s julia with @inbounds: 21.3 s julia with @inbounds @simd: 19.0 s Looks

[julia-users] julia vs cython benchmark

2014-11-26 Thread Andre Bieler
Did a benchmark for calculating shadowing of a triangulated surface mesh in julia and cython. It is basically a loop over all surface elements and checks if any other of the surface elements intersect with the line of sight pointing towards a light source. (see pic below, light source on the

[julia-users] example for ccall use and fortran

2014-11-14 Thread Andre Bieler
tried calling a simple fortran function from julia but did not succeed: this is the fortran code: !fileName = simplemodule.f95 module simpleModule contains function foo(x) integer :: foo, x foo = x * 2 end function foo end module simplemodule which is then compiled with: *gfortran

Re: [julia-users] example for ccall use and fortran

2014-11-14 Thread Andre Bieler
to be passed by reference, and not by value. So the final call is ``` juliaccall((:__simplemodule_MOD_foo, simplemodule.so), Int32, (Ptr{Int32},), 3) 6 ``` Regards, Guillaume Andre Bieler a écrit : tried calling a simple fortran function from julia but did not succeed

[julia-users] passing additional arguments to DArray init function

2014-10-06 Thread Andre Bieler
with the syntax defined in the user manual for distributed arrays: DArray(init, dims[, procs, dist]) is there a way to have the init function accept additional parameters? so instead of having function foo(I) do something end but function foo(I, a, b) do something end or should I

[julia-users] passing additional parameters to DArray init function

2014-10-06 Thread Andre Bieler
with the syntax defined in the user manual for distributed arrays: DArray(init, dims[, procs, dist]) is there a way to have the init function accept additional parameters? so instead of having function init(I) #do something end but function init(I, a, b) #do something end or should I

[julia-users] type generation

2014-09-10 Thread Andre Bieler
can anyone tell me why the following code does not work as (I) expected? I have a simple type Cell which only has an index and a origin array. When creating multiple instances of this Cell type in a loop and assigning different origin arrays to them, in the end all instances have the same origin