[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange save load issue
From: |
Daniel J Sebald |
Subject: |
Re: strange save load issue |
Date: |
Tue, 04 Mar 2014 20:54:34 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
On 03/04/2014 02:01 PM, Muhali wrote:
I have a large double array of about ~500M elements. (Binary) saving and
loading can be done without problems. But when I convert it to single the
saving happens in less than a second, and loading returns (of course) the
'trouble reading binary file' error message.
Please provide better detail about commands and actual error messages.
It makes searching the code and finding a starting point much easier.
What can I do to identify what's going on?
Look around file ./libinterp/corefcn/load-save.cc for any issues. In
particular start at the function "do_save". I'm guessing you did normal
MAT binary format, so that would be
case LS_MAT_BINARY:
save_mat_binary_data (os, tc, name);
break;
So, grep for that function in the same directory:
[corefcn]$ grep save_mat_binary_data *.h
ls-mat4.h:save_mat_binary_data (std::ostream& os, const octave_value& tc,
OK, then edit ls-mat4.cc and look for save_mat_binary_data...
It looks to me that the function is stepping through all the possible
types and when the matching type is found the data is written to file in
the proper format. My guess would be that when convert to 'single'
class one of the tests that should be passing, isn't. (Or a test is
missing that should be there.) I would say
else if (tc.is_real_matrix ())
should be the case when your data is a double matrix. Perhaps that is
not passing when single.
To test out the theory, print something to standard error or standard
out within that case and try your commands again.
Dan