CG solvers make use of dot products and other loops whose results may not be 
exactly the same depending on how those operations are performed serially or in 
parallel.  As the solver iterates, those differences *may* stack up.  However 
it’s also really easy to write a subtle bug that causes the solver to converge 
to the wrong answer.  You need to have a very good validation process where you 
can check the result of your solution to understand whether it converges to the 
correct answer.

From: Diego Avesani [mailto:diego.aves...@gmail.com]
Sent: Wednesday, October 28, 2015 5:52 PM
To: Open MPI Users
Subject: Re: [OMPI users] single CPU vs four CPU result differences, is it 
normal?

dear Andreas, dear all,
The code is quite long. It is a conjugate gradient algorithm to solve a complex 
system.

I have noticed that when a do cycle is small, let's say
do i=1,3

enddo

the results are identical. If the cycle is big, let's say do i=1,20, the 
results are different and the difference increase with the number of iterations.

What do you think?



Diego

On 28 October 2015 at 22:32, Andreas Schäfer 
<gent...@gmx.de<mailto:gent...@gmx.de>> wrote:
On 22:03 Wed 28 Oct     , Diego Avesani wrote:
> When I use a single CPU a get a results, when I use 4 CPU I get another
> one. I do not think that very is a bug.

Sounds like a bug to me, most likely in your code.

> Do you think that these small differences are normal?

It depends on what small means. Floating point operations in a
computer are generally not commutative, so parallelization may in deed
lead to different results.

> Is there any way to get the same results? is some align problem?

Impossible to say without knowing your code.

Cheers
-Andreas


--
==========================================================
Andreas Schäfer
HPC and Grid Computing
Department of Computer Science 3
Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
+49 9131 85-27910<tel:%2B49%209131%2085-27910>
PGP/GPG key via keyserver
http://www.libgeodecomp.org
==========================================================

(\___/)
(+'.'+)
(")_(")
This is Bunny. Copy and paste Bunny into your
signature to help him gain world domination!

_______________________________________________
users mailing list
us...@open-mpi.org<mailto:us...@open-mpi.org>
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2015/10/27933.php

Reply via email to