bigmemory icon indicating copy to clipboard operation
bigmemory copied to clipboard

portable matrix file

Open mikejiang opened this issue 6 years ago • 4 comments

Currently it is saved as a filebacked matrix file and the descriptor file. I assume the matrix file is written by boost interprocess, which should be portable across language as long as the language binding for interprocess lib is available. (e.g. https://github.com/ESSS/pyboost_ipc). But the descriptor file is saved as rds file, will it be more portable to save it as plain text so that the on-disk matrix can be loaded into other non-R environment? Also, How easy (or difficult) is it to write an equivalent python package to interchange the memory-mapped matrix file from bigmemory?

mikejiang avatar Aug 06 '18 21:08 mikejiang

Currently, the default is to write the descriptor as a plain text .desc file that basically contains the result of dput() of the descriptor. Don't know Python well, but that shouldn't be too hard to parse I guess.

privefl avatar Aug 06 '18 21:08 privefl

Great. So how about the binary matrix file itself? Does it contain bigmemory-specific information or simply the generic boost interprocess format and thus readable by other platform independent from bigmemory R package?

mikejiang avatar Aug 06 '18 22:08 mikejiang

The binary file containing the data is just nrow * ncol * sizeof(type) bytes.

privefl avatar Aug 06 '18 22:08 privefl

Thanks for the information!

mikejiang avatar Aug 06 '18 22:08 mikejiang