[petsc-users] The question of the output from ksp/ex2.c

Tsung-Hsing Chen barrydog505 at gmail.com
Wed Feb 26 02:37:56 CST 2020


So, What should I do to use the correct mpiexec?
Am I configure petsc with the wrong way or something should be done?

Stefano Zampini <stefano.zampini at gmail.com> 於 2020年2月26日 週三 下午4:26寫道:

> This is what I get
>
> [szampini at localhost tutorials]$ mpiexec -n 2 ./ex2 -ksp_monitor_short -m
> 5 -n 5 -ksp_gmres_cgs_refinement_type refine_always
>   0 KSP Residual norm 2.73499
>   1 KSP Residual norm 0.795482
>   2 KSP Residual norm 0.261984
>   3 KSP Residual norm 0.0752998
>   4 KSP Residual norm 0.0230031
>   5 KSP Residual norm 0.00521255
>   6 KSP Residual norm 0.00145783
>   7 KSP Residual norm 0.000277319
> Norm of error 0.000292349 iterations 7
>
> When I sequentially, I get (same output as yours)
>
> [szampini at localhost tutorials]$ mpiexec -n 1 ./ex2 -ksp_monitor_short -m
> 5 -n 5 -ksp_gmres_cgs_refinement_type refine_always
>   0 KSP Residual norm 3.21109
>   1 KSP Residual norm 0.93268
>   2 KSP Residual norm 0.103515
>   3 KSP Residual norm 0.00787798
>   4 KSP Residual norm 0.000387275
> Norm of error 0.000392701 iterations 4
>
> This means you are using the wrong mpiexec
>
> Il giorno mer 26 feb 2020 alle ore 11:17 Tsung-Hsing Chen <
> barrydog505 at gmail.com> ha scritto:
>
>> Hi,
>>
>> I tried to run the example in ksp/examples/tutorials/ex2.
>> I run the code with : mpiexec -n 2 ./ex2 -ksp_monitor_short -m 5 -n 5
>> -ksp_gmres_cgs_refinement_type refine_always
>>
>> the output is :
>>   0 KSP Residual norm 3.21109
>>   1 KSP Residual norm 0.93268
>>   2 KSP Residual norm 0.103515
>>   3 KSP Residual norm 0.00787798
>>   4 KSP Residual norm 0.000387275
>> Norm of error 0.000392701 iterations 4
>>   0 KSP Residual norm 3.21109
>>   1 KSP Residual norm 0.93268
>>   2 KSP Residual norm 0.103515
>>   3 KSP Residual norm 0.00787798
>>   4 KSP Residual norm 0.000387275
>> Norm of error 0.000392701 iterations 4
>>
>> My output(above) is twice as the ksp/examples/tutorials/output/ex2_4.out.
>> Is this the right answer that should come out?
>>
>> Thanks in advance,
>>
>> Tsung-Hsing Chen
>>
>
>
> --
> Stefano
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200226/befcde26/attachment.html>


More information about the petsc-users mailing list