Commits

Peter Brune committed fe34226 Merge

Merge branch 'prbrune/dmda-subdomains-per-process'

Comments (0)

Files changed (5)

src/dm/impls/da/dadd.c

   ierr = DMDASubDomainDA_Private(dm,&n,&sdm);CHKERRQ(ierr);
   if (names) {
     ierr = PetscMalloc(n*sizeof(char*),names);CHKERRQ(ierr);
-    for (i=0;i<n;i++) names[i] = 0;
+    for (i=0;i<n;i++) (*names)[i] = 0;
   }
   ierr = DMDASubDomainIS_Private(dm,n,sdm,iis,ois);CHKERRQ(ierr);
   if (subdm) *subdm = sdm;
+  else {
+    for (i=0;i<n;i++) {
+      ierr = DMDestroy(&sdm[i]);CHKERRQ(ierr);
+    }
+  }
   if (len) *len = n;
   PetscFunctionReturn(0);
 }

src/ksp/pc/impls/gasm/gasm.c

           if (subdomain_names)    {ierr = PetscFree(subdomain_names[d]);CHKERRQ(ierr);}
           if (inner_subdomain_is) {ierr = ISDestroy(&inner_subdomain_is[d]);CHKERRQ(ierr);}
           if (outer_subdomain_is) {ierr = ISDestroy(&outer_subdomain_is[d]);CHKERRQ(ierr);}
+          if (subdomain_dm)       {ierr = DMDestroy(&subdomain_dm[d]);CHKERRQ(ierr);}
         }
         ierr = PetscFree(subdomain_names);CHKERRQ(ierr);
         ierr = PetscFree(inner_subdomain_is);CHKERRQ(ierr);
         ierr = PetscFree(outer_subdomain_is);CHKERRQ(ierr);
+        ierr = PetscFree(subdomain_dm);CHKERRQ(ierr);
       }
       if (osm->n == PETSC_DECIDE) { /* still no subdomains; use one per processor */
         osm->nmax = osm->n = 1;

src/snes/examples/tutorials/makefile

 	   else  echo  ${PWD} "\nPossible problem with with ex5_5_nasm, diffs above \n========================================="; fi; \
 	   ${RM} -f ex5_5_nasm.tmp
 
+runex5_5_newton_asm_dmda:
+	-@${MPIEXEC} -n 4 ./ex5 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -da_refine 4 -da_overlap 3 \
+        -snes_type newtonls -pc_type asm -pc_asm_dm_subdomains -malloc_dump > ex5_5_newton_asm_dmda.tmp 2>&1; \
+	   if (${DIFF} output/ex5_5_newton_asm_dmda.out ex5_5_newton_asm_dmda.tmp) then true; \
+	   else  echo  ${PWD} "\nPossible problem with with ex5_5_newton_asm_dmda, diffs above \n========================================="; fi; \
+	   ${RM} -f ex5_5_newton_asm_dmda.tmp
+
+runex5_5_newton_gasm_dmda:
+	-@${MPIEXEC} -n 4 ./ex5 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -da_refine 4 -da_overlap 3 \
+        -snes_type newtonls -pc_type gasm -pc_gasm_dm_subdomains -malloc_dump > ex5_5_newton_gasm_dmda.tmp 2>&1; \
+	   if (${DIFF} output/ex5_5_newton_gasm_dmda.out ex5_5_newton_gasm_dmda.tmp) then true; \
+	   else  echo  ${PWD} "\nPossible problem with with ex5_5_newton_gasm_dmda, diffs above \n========================================="; fi; \
+	   ${RM} -f ex5_5_newton_gasm_dmda.tmp
+
 runex5_5_aspin:
 	-@${MPIEXEC} -n 4 ./ex5 -snes_monitor_short -ksp_monitor_short -snes_converged_reason -da_refine 4 -da_overlap 3 \
         -snes_type aspin > ex5_5_aspin.tmp 2>&1; \
                                  runex5_5_ngmres runex5_5_ngmres_nrichardson runex5_5_ncg runex5_5_nrichardson \
                                  runex5_5_ngmres_ngs runex5_5_qn runex5_5_ls \
                                  runex5_5_fas runex5_5_ngmres_fas runex5_5_fas_additive \
+                                 runex5_5_nasm runex5_5_newton_asm_dmda runex5_5_newton_gasm_dmda \
                                  runex5_6 ex5.rm ex7.PETSc runex7 ex7.rm\
                                  ex14.PETSc runex14 runex14_2 ex14.rm ex15.PETSc runex15 runex15_3 runex15_4 ex15.rm ex18.PETSc runex18 ex18.rm \
                                  ex19.PETSc runex19 runex19_5 \

src/snes/examples/tutorials/output/ex5_5_newton_asm_dmda.out

+  0 SNES Function norm 1.14125 
+    0 KSP Residual norm 0.825521 
+    1 KSP Residual norm 0.378571 
+    2 KSP Residual norm 0.225414 
+    3 KSP Residual norm 0.147695 
+    4 KSP Residual norm 0.100639 
+    5 KSP Residual norm 0.0701011 
+    6 KSP Residual norm 0.0507421 
+    7 KSP Residual norm 0.0388982 
+    8 KSP Residual norm 0.0304775 
+    9 KSP Residual norm 0.0248136 
+   10 KSP Residual norm 0.0222093 
+   11 KSP Residual norm 0.0209735 
+   12 KSP Residual norm 0.0197154 
+   13 KSP Residual norm 0.0186426 
+   14 KSP Residual norm 0.0173453 
+   15 KSP Residual norm 0.0136625 
+   16 KSP Residual norm 0.00961477 
+   17 KSP Residual norm 0.0051576 
+   18 KSP Residual norm 0.00273569 
+   19 KSP Residual norm 0.00122593 
+   20 KSP Residual norm 0.000579429 
+   21 KSP Residual norm 0.000331952 
+   22 KSP Residual norm 0.000264709 
+   23 KSP Residual norm 0.000211207 
+   24 KSP Residual norm 0.000139918 
+   25 KSP Residual norm 8.96142e-05 
+   26 KSP Residual norm 5.8691e-05 
+   27 KSP Residual norm 3.69686e-05 
+   28 KSP Residual norm 2.13325e-05 
+   29 KSP Residual norm 1.36574e-05 
+   30 KSP Residual norm 1.02911e-05 
+   31 KSP Residual norm 9.08937e-06 
+   32 KSP Residual norm 7.79963e-06 
+  1 SNES Function norm 0.00172373 
+    0 KSP Residual norm 0.00284078 
+    1 KSP Residual norm 0.002566 
+    2 KSP Residual norm 0.00242489 
+    3 KSP Residual norm 0.00227769 
+    4 KSP Residual norm 0.0021187 
+    5 KSP Residual norm 0.00197928 
+    6 KSP Residual norm 0.00182454 
+    7 KSP Residual norm 0.00152211 
+    8 KSP Residual norm 0.00107371 
+    9 KSP Residual norm 0.000760434 
+   10 KSP Residual norm 0.000506449 
+   11 KSP Residual norm 0.000300385 
+   12 KSP Residual norm 0.000156146 
+   13 KSP Residual norm 7.58712e-05 
+   14 KSP Residual norm 3.91485e-05 
+   15 KSP Residual norm 2.28167e-05 
+   16 KSP Residual norm 1.22109e-05 
+   17 KSP Residual norm 7.54353e-06 
+   18 KSP Residual norm 5.4423e-06 
+   19 KSP Residual norm 4.54508e-06 
+   20 KSP Residual norm 3.63673e-06 
+   21 KSP Residual norm 2.54436e-06 
+   22 KSP Residual norm 1.79453e-06 
+   23 KSP Residual norm 1.25884e-06 
+   24 KSP Residual norm 9.68409e-07 
+   25 KSP Residual norm 7.99469e-07 
+   26 KSP Residual norm 6.60614e-07 
+   27 KSP Residual norm 4.91146e-07 
+   28 KSP Residual norm 3.37163e-07 
+   29 KSP Residual norm 2.15076e-07 
+   30 KSP Residual norm 1.29238e-07 
+   31 KSP Residual norm 8.98074e-08 
+   32 KSP Residual norm 5.7403e-08 
+   33 KSP Residual norm 3.72703e-08 
+   34 KSP Residual norm 2.6906e-08 
+  2 SNES Function norm 1.32289e-05 
+    0 KSP Residual norm 2.20951e-05 
+    1 KSP Residual norm 1.82601e-05 
+    2 KSP Residual norm 1.77709e-05 
+    3 KSP Residual norm 1.64997e-05 
+    4 KSP Residual norm 1.37499e-05 
+    5 KSP Residual norm 1.13413e-05 
+    6 KSP Residual norm 8.89577e-06 
+    7 KSP Residual norm 5.31536e-06 
+    8 KSP Residual norm 2.28134e-06 
+    9 KSP Residual norm 1.16808e-06 
+   10 KSP Residual norm 6.48725e-07 
+   11 KSP Residual norm 3.4315e-07 
+   12 KSP Residual norm 1.83895e-07 
+   13 KSP Residual norm 1.04488e-07 
+   14 KSP Residual norm 6.60184e-08 
+   15 KSP Residual norm 5.14885e-08 
+   16 KSP Residual norm 3.79021e-08 
+   17 KSP Residual norm 2.86616e-08 
+   18 KSP Residual norm 1.9291e-08 
+   19 KSP Residual norm 1.11749e-08 
+   20 KSP Residual norm 6.9314e-09 
+   21 KSP Residual norm 4.57639e-09 
+   22 KSP Residual norm 3.1349e-09 
+   23 KSP Residual norm 2.44977e-09 
+   24 KSP Residual norm 2.01487e-09 
+   25 KSP Residual norm 1.75812e-09 
+   26 KSP Residual norm 1.44219e-09 
+   27 KSP Residual norm 7.938e-10 
+   28 KSP Residual norm 3.465e-10 
+   29 KSP Residual norm 1.553e-10 
+  3 SNES Function norm 9.184e-10 
+Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 3

src/snes/examples/tutorials/output/ex5_5_newton_gasm_dmda.out

+  0 SNES Function norm 1.14125 
+    0 KSP Residual norm 0.825521 
+    1 KSP Residual norm 0.378571 
+    2 KSP Residual norm 0.225414 
+    3 KSP Residual norm 0.147695 
+    4 KSP Residual norm 0.100639 
+    5 KSP Residual norm 0.0701011 
+    6 KSP Residual norm 0.0507421 
+    7 KSP Residual norm 0.0388982 
+    8 KSP Residual norm 0.0304775 
+    9 KSP Residual norm 0.0248136 
+   10 KSP Residual norm 0.0222093 
+   11 KSP Residual norm 0.0209735 
+   12 KSP Residual norm 0.0197154 
+   13 KSP Residual norm 0.0186426 
+   14 KSP Residual norm 0.0173453 
+   15 KSP Residual norm 0.0136625 
+   16 KSP Residual norm 0.00961477 
+   17 KSP Residual norm 0.0051576 
+   18 KSP Residual norm 0.00273569 
+   19 KSP Residual norm 0.00122593 
+   20 KSP Residual norm 0.000579429 
+   21 KSP Residual norm 0.000331952 
+   22 KSP Residual norm 0.000264709 
+   23 KSP Residual norm 0.000211207 
+   24 KSP Residual norm 0.000139918 
+   25 KSP Residual norm 8.96142e-05 
+   26 KSP Residual norm 5.8691e-05 
+   27 KSP Residual norm 3.69686e-05 
+   28 KSP Residual norm 2.13325e-05 
+   29 KSP Residual norm 1.36574e-05 
+   30 KSP Residual norm 1.02911e-05 
+   31 KSP Residual norm 9.08937e-06 
+   32 KSP Residual norm 7.79963e-06 
+  1 SNES Function norm 0.00172373 
+    0 KSP Residual norm 0.00284078 
+    1 KSP Residual norm 0.002566 
+    2 KSP Residual norm 0.00242489 
+    3 KSP Residual norm 0.00227769 
+    4 KSP Residual norm 0.0021187 
+    5 KSP Residual norm 0.00197928 
+    6 KSP Residual norm 0.00182454 
+    7 KSP Residual norm 0.00152211 
+    8 KSP Residual norm 0.00107371 
+    9 KSP Residual norm 0.000760434 
+   10 KSP Residual norm 0.000506449 
+   11 KSP Residual norm 0.000300385 
+   12 KSP Residual norm 0.000156146 
+   13 KSP Residual norm 7.58712e-05 
+   14 KSP Residual norm 3.91485e-05 
+   15 KSP Residual norm 2.28167e-05 
+   16 KSP Residual norm 1.22109e-05 
+   17 KSP Residual norm 7.54353e-06 
+   18 KSP Residual norm 5.4423e-06 
+   19 KSP Residual norm 4.54508e-06 
+   20 KSP Residual norm 3.63673e-06 
+   21 KSP Residual norm 2.54436e-06 
+   22 KSP Residual norm 1.79453e-06 
+   23 KSP Residual norm 1.25884e-06 
+   24 KSP Residual norm 9.68409e-07 
+   25 KSP Residual norm 7.99469e-07 
+   26 KSP Residual norm 6.60614e-07 
+   27 KSP Residual norm 4.91146e-07 
+   28 KSP Residual norm 3.37163e-07 
+   29 KSP Residual norm 2.15076e-07 
+   30 KSP Residual norm 1.29238e-07 
+   31 KSP Residual norm 8.98074e-08 
+   32 KSP Residual norm 5.7403e-08 
+   33 KSP Residual norm 3.72703e-08 
+   34 KSP Residual norm 2.6906e-08 
+  2 SNES Function norm 1.32289e-05 
+    0 KSP Residual norm 2.20951e-05 
+    1 KSP Residual norm 1.82601e-05 
+    2 KSP Residual norm 1.77709e-05 
+    3 KSP Residual norm 1.64997e-05 
+    4 KSP Residual norm 1.37499e-05 
+    5 KSP Residual norm 1.13413e-05 
+    6 KSP Residual norm 8.89577e-06 
+    7 KSP Residual norm 5.31536e-06 
+    8 KSP Residual norm 2.28134e-06 
+    9 KSP Residual norm 1.16808e-06 
+   10 KSP Residual norm 6.48725e-07 
+   11 KSP Residual norm 3.4315e-07 
+   12 KSP Residual norm 1.83895e-07 
+   13 KSP Residual norm 1.04488e-07 
+   14 KSP Residual norm 6.60184e-08 
+   15 KSP Residual norm 5.14885e-08 
+   16 KSP Residual norm 3.79021e-08 
+   17 KSP Residual norm 2.86616e-08 
+   18 KSP Residual norm 1.9291e-08 
+   19 KSP Residual norm 1.11749e-08 
+   20 KSP Residual norm 6.9314e-09 
+   21 KSP Residual norm 4.57639e-09 
+   22 KSP Residual norm 3.1349e-09 
+   23 KSP Residual norm 2.44977e-09 
+   24 KSP Residual norm 2.01487e-09 
+   25 KSP Residual norm 1.75812e-09 
+   26 KSP Residual norm 1.44219e-09 
+   27 KSP Residual norm 7.938e-10 
+   28 KSP Residual norm 3.465e-10 
+   29 KSP Residual norm 1.553e-10 
+  3 SNES Function norm 9.184e-10 
+Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 3