Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Confusing mismatched output when running script with batch versus non-batch

Subject: Confusing mismatched output when running script with batch versus non-batch

From: Matthew

Date: 6 Sep, 2013 20:01:12

Message: 1 of 2

I ran into a situation that has thoroughly confused me.

I have a script that I was setting up to run parallel, but I was getting different answers than I got when I was not running it in parallel. I eventually isolated the problem to the mldivide operation.

Given an A matrix and a B matrix (both 27x27 in my case), the result of A\B when run from a simple script differs from the result of A\B is the script is run using a batch command.

Any hints as to why this would be the case?

Subject: Confusing mismatched output when running script with batch versus non-batch

From: Edric M Ellis

Date: 9 Sep, 2013 08:53:13

Message: 2 of 2

"Matthew " <mcarter1@vt.edu> writes:

> I ran into a situation that has thoroughly confused me.
>
> I have a script that I was setting up to run parallel, but I was
> getting different answers than I got when I was not running it in
> parallel. I eventually isolated the problem to the mldivide
> operation.
>
> Given an A matrix and a B matrix (both 27x27 in my case), the result
> of A\B when run from a simple script differs from the result of A\B is
> the script is run using a batch command.
>
> Any hints as to why this would be the case?

Workers running in 'batch' mode run with a single computational
thread. This can cause slight numerical discrepancies, although the
properties of the result should still be mathematically valid. You can
try running your desktop MATLAB in single computational thread mode by
starting it with the -singleCompThread command-line argument and then
comparing results.

Cheers,

Edric.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us