Hi Bruno,

Thanks for your quick response! You are right about the l2 vs max norm. 
However, the error is 1e-4 in the l2 norm too. Just a clarification to make 
sure I understand your response. I was indeed thinking of the condition 
number, that's why I checked it, but in my case the 1e-11 should lose up to 
5 more digits, which is still better than 1e-4. However, probably your 
point is that since I was using cg with tolerance of 1e-8, this is already 
a loss of accuracy that I did not take into account in the above 
calculation. Is this correct?

Thanks again,
Dimitris



On Monday, November 27, 2017 at 4:24:16 PM UTC-5, Bruno Turcksin wrote:
>
> Dimitris,
>
> The same implementation of CG will give you (slightly) different results 
> in serial an parallel because the round-off errors will be different. This 
> round-off errors will be amplified if you have a large condition number 
> (see https://en.wikipedia.org/wiki/Condition_number). So if you 
> precondition your system and the condition number decreases you can expect 
> better results. This explains why there is a difference between the serial 
> and the parallel run. Now about the maximum value of the change. I think 
> what you are doing is wrong. You are looking at the maximum difference, 
> i.e., at the L infinity norm but the tolerance is computed in the L2 norm. 
> A tolerance of 1e-8 in the L2 norm does not mean that you will also get a 
> tolerance of 1e-8 in the L infinity norm.
>
> Best,
>
> Bruno
>
> On Monday, November 27, 2017 at 3:31:07 PM UTC-5, Dimitris Ntogkas wrote:
>>
>> Dear all,
>>
>> I have a question with regards to the behavior of the Conjugate Gradient 
>> method in serial and parallel. I am using version 8.5 of dealii and I have 
>> a parallel implementation based on Trilinos. 
>> The system matrix is in a block format and sparse, with blocks A, B, B^T 
>> and 0. The right hand side has two blocks, f_0 and f_1 = 0. I am using a 
>> Schur complement similar to step 20 but in parallel to solve the system and 
>> I am facing an issue with the first step of the solve routine, where I use 
>> the conjugate gradient to solve for y_1. At this point I am not using any 
>> preconditioning. 
>>
>> I have exported and converted the matrices and vectors in appropriate 
>> format, so that I am able to work with them in Matlab too. When I compare 
>> the system matrix created serially and the one created in parallel (say 
>> mpirun -n2), their maximum difference in absolute value is of order 1e-11. 
>> The right hand sides created serially and in parallel are identical. 
>> However, the solution of the system with tolerance for CG 1e-8, has a 
>> maximum difference of order 1e-4. However, for this particular calculation 
>> the condition number of the Schur complement is of order 1e+5 (calculated 
>> in Matlab). Moreover, when I use Matlab to do the Schur solve with CG for 
>> those matrices and the same tolerance, the resulting solutions differ by an 
>> order of 1e-12. 
>>
>> The above discrepancy in the solution reduces by two orders if I make the 
>> tolerance for CG to be smaller, i.e. of order 1e-11, for both the serial 
>> and the parallel execution. 
>>
>> My question is why for this difference in the matrices and this condition 
>> number do I see such a difference in the solution? Could this be related to 
>> how CG is implemented in parallel and how the tolerance is guaranteed in 
>> parallel vs serially?
>>
>> Thanks,
>> Dimitris
>>
>>
>>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to