[petsc-users] Réf. : Re: Unreproducible number of iterations for consecutives solves (GCR + ML)

Thomas DE-SOZA thomas.de-soza at edf.fr
Thu Jun 27 11:30:20 CDT 2013


Dear PETSc developers,

As usual your answers are concise and precise. Thanks a lot for the 
explanation !
Browsing the mailing list archive a bit has made me aware of the native 
PCGAMG, so we'll update PETSc and give it a try.

Keep up the fantastic work,
Thomas





jedbrown at mcs.anl.gov
Envoyé par : five9a2 at gmail.com
27/06/2013 18:13
 
        Pour :  rupp at mcs.anl.gov, thomas.de-soza at edf.fr
        cc :    petsc-users at mcs.anl.gov
        Objet : Re: [petsc-users] Unreproducible number of iterations for 
consecutives solves (GCR + ML)




NOTE : La(les) pièce(s) jointe(s) a(ont) été supprimée(s) du message 
initial. Le nom est conservé pour information.
Le : 27/06/2013, à 18:18
Par : Thomas DE-SOZA
Nom(s) du(des) fichiers(s) : 
C.DTF


Karl Rupp <rupp at mcs.anl.gov> writes:

> Thus, it seems that there is a little share of randomness involved,
> which may only be significant when the solver needs to run a large
> number of iterations. So, the fluctuation of iterations when using ML
> does not seem to be something you need to be worried about.

Yes, ML has some randomness.  It sets a deterministic seed so the first
solve is reproducible, but multiple solves will vary some:

diff --git i/src/ksp/ksp/examples/tutorials/ex56.c 
w/src/ksp/ksp/examples/tutorials/ex56.c
index 91fad9d..fa8860c 100644
--- i/src/ksp/ksp/examples/tutorials/ex56.c
+++ w/src/ksp/ksp/examples/tutorials/ex56.c
@@ -284,7 +284,7 @@ int main(int argc,char **args)
PetscReal emax, emin;
ierr = MaybeLogStagePush(stage[2]);CHKERRQ(ierr);
/* PC setup basically */
-    ierr = MatScale(Amat, 100000.0);CHKERRQ(ierr);
+    //ierr = MatScale(Amat, 100000.0);CHKERRQ(ierr);
ierr = KSPSetOperators(ksp, Amat, Amat, 
SAME_NONZERO_PATTERN);CHKERRQ(ierr);
ierr = KSPSetUp(ksp);CHKERRQ(ierr);

@@ -297,7 +297,7 @@ int main(int argc,char **args)
ierr = MaybeLogStagePush(stage[4]);CHKERRQ(ierr);

/* 3rd solve */
-    ierr = MatScale(Amat, 100000.0);CHKERRQ(ierr);
+    //ierr = MatScale(Amat, 100000.0);CHKERRQ(ierr);
ierr = KSPSetOperators(ksp, Amat, Amat, 
SAME_NONZERO_PATTERN);CHKERRQ(ierr);
ierr = KSPSetUp(ksp);CHKERRQ(ierr);

$ mpiexec -n 8 ./ex56 -ne 19 -alpha 1.e-3 -ksp_monitor -ksp_type cg 
-ksp_max_it 50 -pc_type ml -ksp_converged_reason -mg_levels_ksp_type 
chebyshev -mg_levels_ksp_chebyshev_estimate_eigenvalues 0,0.05,0,1.05 
-mg_levels_pc_type jacobi -two_solves -ksp_norm_type unpreconditioned
0 KSP Residual norm 3.916254888964e+00
1 KSP Residual norm 2.881812838115e+01
2 KSP Residual norm 1.275966743250e+01
3 KSP Residual norm 4.773599170045e+00
4 KSP Residual norm 1.935268484585e+00
5 KSP Residual norm 4.209580628708e-01
6 KSP Residual norm 8.134351555855e-02
7 KSP Residual norm 2.105221695641e-02
8 KSP Residual norm 6.251570402725e-03
9 KSP Residual norm 1.693062086081e-03
10 KSP Residual norm 4.088111376292e-04
11 KSP Residual norm 8.282470497154e-05
12 KSP Residual norm 2.910468516666e-05
Linear solve converged due to CONVERGED_RTOL iterations 12
0 KSP Residual norm 3.916254888964e+00
1 KSP Residual norm 2.884447434423e+01
2 KSP Residual norm 1.279637972963e+01
3 KSP Residual norm 4.778606784425e+00
4 KSP Residual norm 1.945306501447e+00
5 KSP Residual norm 4.252458287438e-01
6 KSP Residual norm 8.200469618341e-02
7 KSP Residual norm 2.128564125382e-02
8 KSP Residual norm 6.325422255484e-03
9 KSP Residual norm 1.722774707230e-03
10 KSP Residual norm 4.155306725796e-04
11 KSP Residual norm 8.432468795266e-05
12 KSP Residual norm 2.965043662043e-05
Linear solve converged due to CONVERGED_RTOL iterations 12
0 KSP Residual norm 3.916254888964e+00
1 KSP Residual norm 2.884581541125e+01
2 KSP Residual norm 1.281469034767e+01
3 KSP Residual norm 4.787719947229e+00
4 KSP Residual norm 1.954021039200e+00
5 KSP Residual norm 4.286214813381e-01
6 KSP Residual norm 8.267288000027e-02
7 KSP Residual norm 2.150072898753e-02
8 KSP Residual norm 6.392547836067e-03
9 KSP Residual norm 1.749098960784e-03
10 KSP Residual norm 4.214004987050e-04
11 KSP Residual norm 8.561869518870e-05
12 KSP Residual norm 3.013123608130e-05
Linear solve converged due to CONVERGED_RTOL iterations 12
[0]main |b-Ax|/|b|=7.693890e-06, |b|=3.916255e+00, emax=9.962246e-01




Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.
____________________________________________________

This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or virus-free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130627/69702c6c/attachment.html>


More information about the petsc-users mailing list