Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-23 Thread Patrick O'Leary
On Saturday, November 22, 2014 10:06:24 PM UTC-6, Joshua Adelman wrote: > > I just checked out StrPack and installed it. I think I have it working > properly in the case of a packed immutable type that just contains > numerical fields. I'm still not sure how to make things work to unpack > fixed

Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-22 Thread Joshua Adelman
On Saturday, November 22, 2014 6:31:27 PM UTC-5, Patrick O'Leary wrote: > > On Saturday, November 22, 2014 9:57:51 AM UTC-6, Isaiah wrote: >> >> Have you looked at StrPack.jl? It may have a packed option. Julia uses >> the platform ABI padding rules for easy interop with C. >> > > Yes, you can u

Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-22 Thread Patrick O'Leary
On Saturday, November 22, 2014 9:57:51 AM UTC-6, Isaiah wrote: > > Have you looked at StrPack.jl? It may have a packed option. Julia uses the > platform ABI padding rules for easy interop with C. > Yes, you can used the align_packed strategy.

Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-22 Thread Isaiah Norton
See also Base.fieldoffsets On Sat, Nov 22, 2014 at 10:57 AM, Isaiah Norton wrote: > Have you looked at StrPack.jl? It may have a packed option. Julia uses the > platform ABI padding rules for easy interop with C. > On Nov 22, 2014 7:17 AM, "Joshua Adelman" > wrote: > >> For testing/evaluation p

Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-22 Thread Isaiah Norton
Have you looked at StrPack.jl? It may have a packed option. Julia uses the platform ABI padding rules for easy interop with C. On Nov 22, 2014 7:17 AM, "Joshua Adelman" wrote: > For testing/evaluation purposes, it's actually the case that I don't need > to actually use any of the fixed length str

Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-22 Thread Joshua Adelman
For testing/evaluation purposes, it's actually the case that I don't need to actually use any of the fixed length string fields. They are in the data, but I have numerical encodings for most of the important ones in other fields. So in playing around I found that I could just create a bitstype

Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-21 Thread Joshua Adelman
Hi Tim, Thanks for pointing out my basic error. I can now get some test files read that don't contain any string components. Josh On Friday, November 21, 2014 3:11:32 PM UTC-5, Tim Holy wrote: > > You'll see why if you type `methods(mmap_array)`: the dims has to be > represented as a tuple.

Re: [julia-users] Memory mapping composite type + fixed length strings

2014-11-21 Thread Tim Holy
You'll see why if you type `methods(mmap_array)`: the dims has to be represented as a tuple. Currently, the only way I know of to create a fixed-sized buffer as an element of a "struct" in julia is via immutables with one field per object. Here's one example: https://github.com/JuliaGPU/CUDArt.

[julia-users] Memory mapping composite type + fixed length strings

2014-11-21 Thread Joshua Adelman
I'm playing around with Julia for the first time in an attempt to see if I can replace a Python + Cython component of a system I'm building. Basically I have a file of bytes representing a numpy structured/recarray (in memory this is an array of structs). This gets memory mapped into a numpy arr