Re: [julia-users] Re: Parallel computing and type-stability

2016-09-10 Thread Sleort
I see. Thanks for the information! 


Re: [julia-users] Re: Parallel computing and type-stability

2016-09-10 Thread Yichao Yu
On Fri, Sep 9, 2016 at 11:16 PM, Sleort  wrote:

> @Yichao Yu: Sure. I'm aware that there is a lot of overhead in the inter
> process communication. This was just a minimal test case, not something I
> expect to run fast(er). (A silly nworker() implementation indeed;-)) I was
> just curious if it is possible to reduce the type instability showing up in
> parallel programming situations like this (and others). One reason is that
> such a type instability seem to "mask" @time results (number of allocations
> and memory usage is typically much larger for type unstable code, right?),
> making it harder to get a quick idea of the performance/type stability of
> parts of the code that really matters...
>
> @Richard Dennis: That's interesting! Do you (or anyone else) have an idea
> why? What is updated/changed in 0.5.0-rc4 compared to 0.4.6?
>

Inlining an printing. No type instability is changed and it doesn't matter.


[julia-users] Re: Parallel computing and type-stability

2016-09-09 Thread Sleort
@Yichao Yu: Sure. I'm aware that there is a lot of overhead in the inter 
process communication. This was just a minimal test case, not something I 
expect to run fast(er). (A silly nworker() implementation indeed;-)) I was 
just curious if it is possible to reduce the type instability showing up in 
parallel programming situations like this (and others). One reason is that 
such a type instability seem to "mask" @time results (number of allocations 
and memory usage is typically much larger for type unstable code, right?), 
making it harder to get a quick idea of the performance/type stability of 
parts of the code that really matters...

@Richard Dennis: That's interesting! Do you (or anyone else) have an idea 
why? What is updated/changed in 0.5.0-rc4 compared to 0.4.6?


[julia-users] Re: Parallel computing and type-stability

2016-09-09 Thread Richard Dennis
When I run this code in Julia 0.5.0-rc4 the code is much shorter and most 
of the red indicating type instability is gone.

Cheers.


[julia-users] Re: Parallel computing: SharedArrays not updating on cluster

2016-06-24 Thread Matthew Pearce
As the others have said, it won't work like that. I found a few options:

   1. DistributedArrays. Message passing handled in the background. Some 
   limitations, but I've not used much.
   2. SharedArrays on each machine. You can share memory between all the 
   pids on a single machine, and then pass messages between one process from 
   each machine to updated.
   3. Regular Arrays on each machine. Swap messages between all processes.
   
Which one works for you will depend on how big your arrays are and the 
access patterns of the code you're trying to run on them.





[julia-users] Re: Parallel computing

2016-05-22 Thread Chris Rackauckas
You need to use @everywhere to have the function defined on the workers. 
Can we see some code?

On Saturday, May 21, 2016 at 6:33:17 PM UTC-7, SHORE SHEN wrote:
>
> Hi
>
> Im running a loop, and system shows that only 20% of CPU were used. I then 
> think that due to the fact that my CPU is 4 core 8 thread, parallel 
> computing might help on getting the full potential.
>
> I used addprocs() to add processes to my computer, and follow the 
> instructions to use remotecall.
>
> however, that doesnt work, only the main processors are working, others 
> just taking memory.
>
> For more, I if I use my own function, it will show errors that function 
> not defined on processor n.
>
> Please help me on allocating tasks to different processor, using the full 
> potential of CPU and define functions in different processors. Im new to 
> julia, if you can make it easy to understand, thank you.
>


[julia-users] Re: Parallel computing

2016-05-22 Thread Nils Gudat
This is a rather broad question, and I would suggest that you have 
(another?) close look at the parallel documentation. 
The 
errors about functions not defined on worker processes e.g. suggest that 
you aren't using the @everywhere macro when defining functions (or using it 
incorrectly).

Without knowing more about what exactly you are trying to do this question 
is impossible to answer.


[julia-users] Re: parallel computing in julia

2016-05-20 Thread Andrei Zh
In addition to what Fred said, `addprocs()` adds new workers, i.e. 
processes, which are not necessary bound to your CPU cores. 

On Friday, May 20, 2016 at 6:05:05 AM UTC+3, SHORE SHEN wrote:
>
> Hi
>
> Im doing a loop and need parallel computing.
>
> from the doc, it is said to "julia -p n" command to start n processor in 
> local mashine
>
> however here's the result:
>
> julia> julia -p 2
> ERROR: syntax: extra token "2" after end of expression
>
> also I tried addprocs(n), my computer is 4 core 8 threads, but I can add 9 
> processors.
>
>
> so if anyone can tell me how i should start all 4 core in my computer and 
> what is the difference between julia -p n and addprocs(n).
>
> thanks a lot
>


[julia-users] Re: parallel computing in julia

2016-05-20 Thread Fred
To start 4 cpus :

$ julia -p 3
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
|__/   |  x86_64-linux-gnu


julia> nprocs()
4






[julia-users] Re: parallel computing in julia

2016-05-20 Thread Fred
Hi,

You have started julia and then you try to start it again with julia -p 2.

just type julia -p 2 in a terminal before starting julia :)


$ julia -p 2
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
|__/   |  x86_64-linux-gnu