From: James Tursa on 23 Apr 2010 18:08 "Ron Klein" <ron(a)xsights.com> wrote in message <hqstds$i7f$1(a)fred.mathworks.com>... > > I thought I can serialize the data structure to a simple in-memory representation, like a byte array, then send it to PC1 to PC5 using a TCP connection (this is the simple part), and then deserialize the whole thing to construct a valid mxArray pointer. No disk I/O needed, the whole process involves only memory and network traffic (which can't be avoided what so ever). > > So, the bottom line: I can't just keep the mxArray, I want to serialize it and reconstruct it. OK. Next question. Do you have any RAMdrive s/w available? The idea being to simply use the MATLAB API mat functions to do the work for you. Open a mat file on the RAMdrive, use matPutVariable etc to copy the variable(s) out to this memory file. When you are done you can copy the entire file to the other machine(s) that also have RAMdrives. Those machines again use the MATLAB API mat functions to extract the mxArray variables. All done in memory. No special serializing s/w needs to be written by you. Will something like that work for you? James Tursa
From: Ron Klein on 24 Apr 2010 02:11 "James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <hqt5o4$khb$1(a)fred.mathworks.com>... > "Ron Klein" <ron(a)xsights.com> wrote in message <hqstds$i7f$1(a)fred.mathworks.com>... > > > > I thought I can serialize the data structure to a simple in-memory representation, like a byte array, then send it to PC1 to PC5 using a TCP connection (this is the simple part), and then deserialize the whole thing to construct a valid mxArray pointer. No disk I/O needed, the whole process involves only memory and network traffic (which can't be avoided what so ever). > > > > So, the bottom line: I can't just keep the mxArray, I want to serialize it and reconstruct it. > > OK. Next question. Do you have any RAMdrive s/w available? The idea being to simply use the MATLAB API mat functions to do the work for you. Open a mat file on the RAMdrive, use matPutVariable etc to copy the variable(s) out to this memory file. When you are done you can copy the entire file to the other machine(s) that also have RAMdrives. Those machines again use the MATLAB API mat functions to extract the mxArray variables. All done in memory. No special serializing s/w needs to be written by you. Will something like that work for you? > > James Tursa Yes, I know that RAMDrive is a solution, but it's my least favorite one. Why? Because it has to be pre-installed on all machines involved (sometimes a reboot is needed to complete the installation), and I'd like my solution to be as portable as possible, with a simple xcopy deployment (Windows speaking, see http://en.wikipedia.org/wiki/XCOPY_deployment for more details). For a temp solution, RAMDrive can be OK, but for a long term solution, it's not acceptable. If you or any other person that reads this post have more ideas - please share them. Thanks again for the help so far. Ron
From: EBS on 24 Apr 2010 11:10 "Ron Klein" <ron(a)xsights.com> wrote in message <hqu22a$4i4$1(a)fred.mathworks.com>... > > If you or any other person that reads this post have more ideas - please share them. > > Thanks again for the help so far. > > Ron Ron, did you see the post I made earlier? Check this thread (beware of line wrapping breaking the link), they talk about the undocumented 'mxSerialize' function, and another method using an undocumented SAVE stdio argument: http://www.mathworks.com/matlabcentral/newsreader/view_thread/141797
From: Bruno Luong on 24 Apr 2010 11:19 "EBS " <ericDOTsampson(a)gmail.com> wrote in message <hqv1kv$3l0$1(a)fred.mathworks.com>... > > Ron, did you see the post I made earlier? > > Check this thread (beware of line wrapping breaking the link), they talk about the undocumented 'mxSerialize' function, and another method using an undocumented SAVE stdio argument: > http://www.mathworks.com/matlabcentral/newsreader/view_thread/141797 Ron also mentioned this thread in his first post, obviously he couldn't make it work. Bruno
From: Ron Klein on 24 Apr 2010 12:31 "EBS " <ericDOTsampson(a)gmail.com> wrote in message <hqv1kv$3l0$1(a)fred.mathworks.com>... > "Ron Klein" <ron(a)xsights.com> wrote in message <hqu22a$4i4$1(a)fred.mathworks.com>... > > > > If you or any other person that reads this post have more ideas - please share them. > > > > Thanks again for the help so far. > > > > Ron > > Ron, did you see the post I made earlier? > > Check this thread (beware of line wrapping breaking the link), they talk about the undocumented 'mxSerialize' function, and another method using an undocumented SAVE stdio argument: > http://www.mathworks.com/matlabcentral/newsreader/view_thread/141797 Yes, I entered the link you mention, but I couldn't find any code example. I'll investigate these undocumented functions, that's for sure. However, if there are some code examples out there (I tried google but nothing came up) - please post them here. And if, by any chance, somebody actually worked with these functions and could share his/her code - please do. Try pastebin ( http://pastebin.com/ ) for such sharing. Thanks all, your help is great and inspiring! Ron
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: combine two matrices Next: Timing of the inversion of a sparse matrix |