A strange case (different CPU but same matlab version, different calculated results)

Hi all,
Have there anyone encountered such a strange situation? Different CPUs calculate different results, I mean "0" value, one CPU calculates 10^-10 orders of magnitude, another 10^-19 orders of magnitude, they are the same, right? But after some of the same operations, the final result can be very different.
Note that the matlab version is the same on both CPUs and the code is the same.

7 件のコメント

Walter Roberson
Walter Roberson 2022 年 7 月 5 日
Is one AMD and the other is Intel?
ma Jack
ma Jack 2022 年 7 月 6 日
i7 7700k and i5 12400
Chunru
Chunru 2022 年 7 月 6 日
Do you have any code with parallel computing? If so, different order of computations or different number of workers avalable may cause different results (due to the different rounding error).
Walter Roberson
Walter Roberson 2022 年 7 月 6 日
I seem to recall that a difference between i5 and i7 is that the i7 has more vector calculation instructions.
ma Jack
ma Jack 2022 年 7 月 6 日
Thank you for your comment.I think I found the reason, I did use parfor in my code,does it have a big impact on the results? I have only found errors when the result is "0" so far.
ma Jack
ma Jack 2022 年 7 月 6 日
I don't think it had an impact on my calculations because there are several ways to determine if my results are correct, but still thanks to all, these discussions have enriched my knowledge about matlab.
Walter Roberson
Walter Roberson 2022 年 7 月 6 日
Given the same MATLAB version and the same kind of processor, the number of processors or order of parfor loops should not make a difference to the final result, unless
  • you are doing I/O to a device
  • you are using GPU and have a device selection going on
  • you are using a "reduction variable"
  • you are using parpool data queues and doing something with the data values
  • you have configured your local pool to permit more than one thread per worker
On the other hand, in non-parallel regions, the results of calling into the high speed libraries can potentially depend upon the number of processors or cache details for the processors.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParallel Computing Toolbox についてさらに検索

製品

リリース

R2018b

質問済み:

2022 年 7 月 5 日

コメント済み:

2022 年 7 月 6 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by