Is there any difference in writing binary raw data files on Mac vs PC?
Ältere Kommentare anzeigen
I run code whose output is a data matrix which is fwrite() (floating point number, precision 4 bytes) out to a binary file. This code is run on a Mac (R2013b 64bit (maci64)) and Windows machine (R2014a 64bit). The resulting binary files e.g. data_mac.bin & data_win.bin are then fread() (floating point number, precision 4 bytes) into Matlab (on windows) as matrices e.g. data_mac & data_win. A subsequent function performed on these matrices take different amounts of time e.g. 100 s (win) and 250 s (mac).
So basically the code writes out two files in the exact same way with identical data on a Mac and PC. When I subsequently use those binary files, the calculations on the Mac file takes longer. Any ideas why this would be?
Thanks in advance for any ideas!
Anna
4 Kommentare
Geoff Hayes
am 1 Jul. 2014
Have you verified that the files are both the same size, and that the matrices, once loaded into MATLAB, are of the same dimension and (class) type?
If you try it the other way, and load the two files into MATLAB on the Mac, what behaviour do you observe?
dpb
am 1 Jul. 2014
It wouldn't seem there'd be any real bearing on the use of a file here--sounds like one machine is a better performer than the other.
Time the same function on both machines with rand(size(somesize)) as the inputs and would expect to see very similar results.
Geoff Hayes
am 1 Jul. 2014
The way I understood the question was that both the PC and the Mac produced a data file that was supposed to be identical. Using MATLAB on the PC, the PC version of the file was read and operated on, taking 100 seconds. The PC then did the same with the Mac version of the file, taking 250 seconds. There was no mention of performance, against either file, using the Mac.
@Anna - was the Mac file copied over to a local directory/folder on the PC?
dpb
am 1 Jul. 2014
...and the Mac produced a data file that was supposed to be identical.
Well, that's easy enough to check
diff fileA fileB
(presuming only a diff utility exists on the OP's machine (which actually, anymore may be a big if, I guess, mightn't it?))
Antworten (0)
Kategorien
Mehr zu Other Formats finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!