OK, thanks for the answer, it would be preferable to have access to the full array, there are many other options to overcome the problem. I was initially looking to the recarray system as it is a superfast way to construct the array in the first place and the field names make it perfect for intuitive access. but maybe going line by line using the more conventional indexing method will be preferable. FYI, I managed to use...
m = mmap(-1,13000000000, MAP_PRIVATE)
m.write(myrecarray)
and "top" showed the correct increase in RAM in the "virt" column but a lesser increase in the "res" column, however the loop time did not not decrease, suggesting that that RAM had been been reserved for the proccess but the object had not fully been mapped to it. Time try a different approach I think. Thanks a lot for your time
This is a hardcore programming question, definitely there are python cracks around here, but I think you are better served with asking this on stackoverflow. Also, if you want to keep this question open here, please construct a plausible sounding ;) connection to bioinformatics.
Thanks for your response. I have already asked it on the stack, but so far received no response, so i thought I'd try Biostars as we are often dealing with large amounts of data, so maybe someone had previously come across a similar issue. To relate it to biology, this recarray is a local genome build, to which I am mapping millions of mutations and carrying out quantitative genetic analyses. I hope that clears things up.
So here is the link to the cross post: http://stackoverflow.com/questions/21637414/is-it-possible-to-mmap-a-recarray-in-python-2-7 It is always a good idea to provide this information from the beginning.
Thanks Michael, hopefully someone out there has some experience with locking objects into RAM.
afaik, the mmap POSIX system call can map files and devices to memory, but then they are just a pointer to a vector of bytes, nothing high level like a python data structure.