Difference between MATLAB 64-bit and 32-bit

  • Follow


Hi,

I had to move to a different PC which happened to have Windows Vista 64-bit and MATLAB 64-bit rather than XP 32-bit. (MATLAB R209b in both cases.)

I was surprised to see my simulation results change slightly.

Does this surprise anyone else?

I checked that I had moved the same model and input data files correctly but obviously it is always possible that I've done something stupid!

Large parts of the model use integer or fi math and most of the floating point is single precision.

Any comments greatly appreciated,
Matt
0
Reply Matt 11/25/2009 3:58:04 PM

Hi Matt,

Could you provide some code snippets that illustrate the differences 
that you are seeing?

Thanks!
Tom

Matt wrote:
> Hi,
> 
> I had to move to a different PC which happened to have Windows Vista 64-bit and MATLAB 64-bit rather than XP 32-bit. (MATLAB R209b in both cases.)
> 
> I was surprised to see my simulation results change slightly.
> 
> Does this surprise anyone else?
> 
> I checked that I had moved the same model and input data files correctly but obviously it is always possible that I've done something stupid!
> 
> Large parts of the model use integer or fi math and most of the floating point is single precision.
> 
> Any comments greatly appreciated,
> Matt
0
Reply Tom 11/25/2009 4:32:11 PM


Tom Bryan <tom.bryan@mathworks.com> wrote in message <hejm6b$h3$1@fred.mathworks.com>...
> Hi Matt,
> 
> Could you provide some code snippets that illustrate the differences 
> that you are seeing?
> 
> Thanks!
> Tom

Er... not easily. It is quite a big model, most of which wasn't created by me.

The fact that you've asked for an example suggests that you're surprised too.

If you are surprised I will check that I copied everything correctly to the other machine. If it still doesn't work I will investigate what part of the model is behaving differently and see if I can create an example.

I was wondering whether there are any settings outside of the model configuration parameters that could affect simulation results.

Thanks,
Matt
0
Reply Matt 11/25/2009 5:35:19 PM

On 25 Nov, 16:58, "Matt " <remove.this.matt_d...@hotmail.com> wrote:
> Hi,
>
> I had to move to a different PC which happened to have Windows Vista 64-bit and MATLAB 64-bit rather than XP 32-bit. (MATLAB R209b in both cases.)
>
> I was surprised to see my simulation results change slightly.
>
> Does this surprise anyone else?

It does not surprise me.

The results of numerical computations depend to some
extent on the hardware you use to do the computations.
There is also the question of different implementations
of libraries etc, which might cause slightly different
results.

While moving to a new platform would be expecetd to
change results *slightly* (on the order of, say, < 1e-12
for 64-bit floating point numbers), larger variations
might indicate that your numerical routines are sensitive
to numercial noise.

Which is bad, since this would raise serious questions
about the validity of your results.

Rune
0
Reply Rune 11/25/2009 6:14:31 PM

I have seen this on my own systems.  I have 32-bit and 64-bit 2007a running on two different machines.  The 64-bit system is a quad-core and the other is dual-core.  
My own hypothesis (completely a guess) is that some of the routines may be more parallelized on the quad-core and thus the order of operations (such as sums) may not be identical.  When dealing with floating points, this matters.

A question, In your first post you said the results were different, but not *how* (magnitude) different.  In your second post you seemed to indicate that the model didn't even work.  Which is it?
0
Reply Matt 11/25/2009 6:17:26 PM

"Matt Fig" <spamanon@yahoo.com> wrote in message <hejsbm$4i1$1@fred.mathworks.com>...
> 
> A question, In your first post you said the results were different, but not *how* (magnitude) different.  In your second post you seemed to indicate that the model didn't even work.  Which is it?

Oh, sorry, the wording is a bit poor!

The model *works* on both PCs.

When I was given the model the data types were mainly the default (double) with a smattering of built-in integer types. I've changed the model so that wherever I've got control it uses singles.

I've been converting sections of it to fixed-point and watching the results in long format to see what effect I've been having. Hence when I moved between PCs I noticed it the results weren't the same.

It's difficult to say what the magnitude of the change is because the model contains iterative code and the number of iterations has changed. In other words my results don't reflect the difference from a simple calculation.

I think it is now clearer to me that MATLAB is using (and has to) the floating-point hardware of the platform and hence changing the platform could cause differences. (And perhaps parallel processing could come into the mix as well.)

I guess fixed-point simulation is different, easier to predict and less likely to suffer from such problems. In various places the fixed-point documentation talks about being 'bit-true' which I take to mean it will not be affected by the platform.

Thanks,
Matt
0
Reply Matt 11/26/2009 10:51:03 AM

5 Replies
420 Views

(page loaded in 0.099 seconds)


Reply: