[julia-users] Re: ANN: PTools

2014-02-12 Thread Jim Christoff
I'm a little confused as to what functions are getting executed in your 
example. Is it mypid()?. Could you point out what is the function.

On Saturday, May 4, 2013 1:57:18 AM UTC-4, Amit Murthy wrote:
>
> Folks,
>
> Please do checkout PTools  . I 
> hope to grow it into a collection of utilities for parallel computation.
>
> Currently the following are available.
>
>- 
>
>ServerTasks - These are long running tasks that simply processes 
>incoming requests in a loop. Useful in situations where state needs to be 
>maintained across function calls. State can be maintained and retrieved 
>using the task_local_storage methods.
>- 
>
>SharedMemory - Useful in the event of parallel processing on a single 
>large multi-core machine. Avoids the overhead associated with 
>sending/recieving large data sets.
>
> Usage
>
> Typical usage pattern will be
>
>- 
>
>start_stasks - Start Server Tasks, optionally with shared memory 
>mappings.
>- 
>
>Execute a series of functions in parallel on these tasks using 
>multiple invocations of pmap_stasks
>- 
>
>SomeFunction
>- 
>
>SomeOtherFunction
>- 
>
>SomeOtherFunction . . .
>- 
>
>stop_stasks - Stop all Server Tasks and free shared memory if required.
>
> The user specified functions in pmap_stasks can store and retrieve state 
> information using the task_local_storage functions.
> Example
>
> The best way to understand what is available is by example:
>
>- specify shared memory configuration.
>
> using PTools
>
> shmcfg = [ShmCfg(:svar1, Int32, 64*1024), ShmCfg(:svar2, Uint8, (100,100))]
>
>
>- 
>
>the above line requests for a 64K Int32 array bound to svar1, and a 
>100x100 Uint8 array bound to svar2
>- 
>
>Start tasks.
>
>h = start_stasks(shmcfg)
>ntasks = count_stasks(h)
>
>- 
>
>The tasks are started and symbols pointing to shared memory segments 
>are added as task local storage. A handle is returned.
>- 
>
>The shared memory segments are also mapped in the current tasks local 
>storage.
>- 
>
>NOTE: If nprocs() > 1, then only the Worker Julia processes are used 
>to start the Server Tasks, i.e., if nprocs() == 5, then ntasks above would 
>be 4.
>- 
>
>Prepare arguments for our pmap call
>
>offset_list = [i for i in 1:ntasks]
>ntasks_list = [ntasks for i in 1:ntasks]
>
>- 
>
>Execute our function in parallel.
>
>resp = pmap_stasks(h, (offset, ntasks) -> begin
># get local refernces to shared memory mapped arrays
>svar1 = task_local_storage(:svar1)
>svar2 = task_local_storage(:svar2)
>
>mypid = myid()
>for x in offset:ntasks:64*1024
>svar1[x] = mypid
>end
>
>true
>
>end,
>
>offset_list, ntasks_list)
>
>- 
>
>Access shared memory segments and view changes
>
> svar1 = task_local_storage(:svar1)
> println(svar1)
>
> svar1 will print the values as updated by the Server Tasks.
>
>- Finally stop the tasks
>
> stop_stasks(h, shmcfg)
>
> This causes all tasks to be stopped and the shared memory unmapped.
>
>
>

[julia-users] updating an array

2015-04-06 Thread Jim Christoff
First, Julia is a great replacement for Octave and in most cases "C". I 
have used Octave for decades and Julia for a year or so. 
I still have problems making the conversions. Any assistance will be 
greatly appreciated.
This is short example of the modified Octave code that I have tried to 
convert. I realize there is a difference
in how Julia handles arrays, but I don't seem to be able to resolve this 
difference. 
The following code I use in Octave:

function  arburg1 (x, p)


  a = zeros(p)
  n = length(x)
  v = sum(x.*x)

  ## f and b are the forward and backward error sequences
  f = x[2:n]
  b = x[1:n-1]

  ## remaining stages i=2 to p
  for i=1:p

## get the i-th reflection coefficient
g = 2 * sum(f.*b)/(sum(f.*f)+sum(b.*b));
 

## generate next filter order
if i==1
  a =  g  
else
  a =   a-g*a[i-1:-1:1]    this is my problem area*
endif

## keep track of the error
v = v*(1-g^2);

## update the prediction error sequences
oldf = f
f = oldf[2:n-i]- g*b[2:n-i]
b = b[1:n-i-1] - g*oldf[1:n-i-1]

  end
  a =   -a[p:-1:1]

end


Thanks for any suggestions


[julia-users] Re: updating an array

2015-04-06 Thread Jim Christoff
That was not it

On Monday, April 6, 2015 at 9:05:16 AM UTC-4, Jim Christoff wrote:
>
> First, Julia is a great replacement for Octave and in most cases "C". I 
> have used Octave for decades and Julia for a year or so. 
> I still have problems making the conversions. Any assistance will be 
> greatly appreciated.
> This is short example of the modified Octave code that I have tried to 
> convert. I realize there is a difference
> in how Julia handles arrays, but I don't seem to be able to resolve this 
> difference. 
> The following code I use in Octave:
>
> function  arburg1 (x, p)
>
>
>   a = zeros(p)
>   n = length(x)
>   v = sum(x.*x)
>
>   ## f and b are the forward and backward error sequences
>   f = x[2:n]
>   b = x[1:n-1]
>
>   ## remaining stages i=2 to p
>   for i=1:p
>
> ## get the i-th reflection coefficient
> g = 2 * sum(f.*b)/(sum(f.*f)+sum(b.*b));
>  
>
> ## generate next filter order
> if i==1
>   a =  g  
> else
>   a =   a-g*a[i-1:-1:1]    this is my problem area*
> endif
>
> ## keep track of the error
> v = v*(1-g^2);
>
> ## update the prediction error sequences
> oldf = f
> f = oldf[2:n-i]- g*b[2:n-i]
> b = b[1:n-i-1] - g*oldf[1:n-i-1]
>
>   end
>   a =   -a[p:-1:1]
>
> end
>
>
> Thanks for any suggestions
>


[julia-users] Re: updating an array

2015-04-06 Thread Jim Christoff
Thank you very much for that clear description. That was the problem and it 
is producing the expected results. 

On Monday, April 6, 2015 at 10:53:40 AM UTC-4, g wrote:
>
> I suspect you want 
>
> ## generate next filter order
> if i==1
>   a[i] =  g  
> else
>   a[i-1:-1:1] =   a[i-1:-1:1]-g*a[i-1:-1:1]  #  this is my problem 
> area*
> end
>
> a is first assigned as a Vector{Float64} of length p.  Then you did a=g 
> which assigns a as a Float64 (this is bad for performance as well, since 
> it's not type stable). Then you try to a[1] when i=2, but in Julia (unlike 
> MATLAB, and I assume octave) that is not a valid access.  You want to make 
> sure a stays as a Vector{Float64} the whole time, and while you can change 
> the length if you want, you will probalby be better off if you keep it the 
> same length as well.
>


[julia-users] How to use plan_fft

2014-09-10 Thread Jim Christoff
I have used Jullia's default fft for several months and have had no 
problems. I recently decided to try  plan_fft to improve performance.
I seem to a problem using the plan_fft method. Any help would be 
appreciated.

data is a 2d complex Nu by Nt array
The following is one of many attempts:


p = plan_fft(data,Nu,Nt,MEASURE)
GG= p(data)


[julia-users] Re: How to use plan_fft

2014-09-11 Thread Jim Christoff
Thanks , that was the problem.

On Wednesday, September 10, 2014 3:45:28 PM UTC-4, Jim Christoff wrote:
>
> I have used Jullia's default fft for several months and have had no 
> problems. I recently decided to try  plan_fft to improve performance.
> I seem to a problem using the plan_fft method. Any help would be 
> appreciated.
>
> data is a 2d complex Nu by Nt array
> The following is one of many attempts:
>
>
> p = plan_fft(data,Nu,Nt,MEASURE)
> GG= p(data)
>


[julia-users] FFTW in parallel

2014-12-04 Thread Jim Christoff


Does Julia's implementation of FFTW use multi-core, if not how would I 
implement this. I need speed for realtime processing.


[julia-users] Re: FFTW in parallel

2014-12-08 Thread Jim Christoff
Thanks

That resulted in a 30% improvement

On Thursday, December 4, 2014 10:15:14 AM UTC-5, Jim Christoff wrote:
>
>
>
> Does Julia's implementation of FFTW use multi-core, if not how would I 
> implement this. I need speed for realtime processing.
>


[julia-users] Re: Almost at 500 packages!

2015-01-25 Thread Jim Christoff
All packages should meet minimum standards that clearly state its 
dependences and where they can be downloaded. There is nothing worse when 
trying to use a new package that has no docs that clearly explains its 
purpose and no examples. Every author should realize he/she is dealing with 
noobs that do not recognize all the buzz words. A good example with 
comments goes a long ways in clarifying its use.

On Tuesday, January 20, 2015 at 10:32:45 AM UTC-5, Iain Dunning wrote:
>
> Just noticed on http://pkg.julialang.org/pulse.html that we are at 499 
> registered packages with at least one version tagged that are Julia 0.4-dev 
> compatible (493 on Julia 0.3).
>
> Thanks to all the package developers for their efforts in growing the 
> Julia package ecosystem!
>
>