Hello,

As a beginner Julia user I have the outlined problem and a peer review 
request if there is any implications of the proposed technique.   

The problem:
To have a matrix{T} shape continuous sub-view of a vector{T} store  the 
following code, using pointer to array,  seem to work:

myView{T,N}(a::Array{T}, dims::NTuple{N,Int};  start::Int64=1 ) =
      pointer_to_array(pointer(a, start),  dims, false )

v   = zeros(20) ## must not be garbage collected until A,B referenced; v is 
100M ~ 10G; in memory

#for i=0:large_number
     # scatter 
     A  = myView(v, (10,1), start=1)
     B  = myView(v, (10,1), start=11)

     # IO heavy updates
     A[:,:] = A[:,:] + 1; B[:,:] = B[:,:] + 5
#end

# implicit gather 
show( v ) ## 

Is this a correct Julian way to implement efficient large size shared 
data-store, where A,B preserve matrix properties [BLAS/LAPACK]? Are there 
any obvious impacts/alternatives to this approach that avoided my 
attention? (cost of contracting sub-view versus  BLAS.copy data back during 
gather)

thanks,
steve

Reply via email to