Commits

Peter Brune committed 9d87081 Merge

Merge branch 'prbrune/snes-commimprovements' into next

Comments (0)

Files changed (2)

src/snes/linesearch/impls/cp/linesearchcp.c

 
   for (i = 0; i < max_its; i++) {
     if (i == 0) {
-      ierr = VecDotBegin(F,Y,&fty_old);CHKERRQ(ierr);
+      ierr = VecDot(F,Y,&fty_old);CHKERRQ(ierr);
       fty_init = fty_old;
     }
     /* compute the norm at lambda */
       ierr = (*linesearch->ops->viproject)(snes, W);CHKERRQ(ierr);
     }
     ierr = (*linesearch->ops->snesfunc)(snes,W,F);CHKERRQ(ierr);
-    ierr = VecDotBegin(F,Y,&fty);CHKERRQ(ierr);
-    if (i == 0) {
-      ierr = VecDotEnd(F,Y,&fty_old);CHKERRQ(ierr);
-    }
-    ierr = VecDotEnd(F,Y,&fty);CHKERRQ(ierr);
+    ierr = VecDot(F,Y,&fty);CHKERRQ(ierr);
 
     delLambda = lambda - lambda_old;
 
         ierr = (*linesearch->ops->viproject)(snes, W);CHKERRQ(ierr);
       }
       ierr = (*linesearch->ops->snesfunc)(snes,W,F);CHKERRQ(ierr);
-      ierr = VecDotBegin(F, Y, &fty_mid1);CHKERRQ(ierr);
+      ierr = VecDot(F, Y, &fty_mid1);CHKERRQ(ierr);
       ierr = VecCopy(X, W);CHKERRQ(ierr);
       ierr = VecAXPY(W, -(lambda + 0.5*(lambda - lambda_old)), Y);CHKERRQ(ierr);
       if (linesearch->ops->viproject) {
         ierr = (*linesearch->ops->viproject)(snes, W);CHKERRQ(ierr);
       }
       ierr = (*linesearch->ops->snesfunc)(snes, W, F);CHKERRQ(ierr);
-      ierr = VecDotBegin(F, Y, &fty_mid2);CHKERRQ(ierr);
-      ierr = VecDotEnd(F, Y, &fty_mid1);CHKERRQ(ierr);
-      ierr = VecDotEnd(F, Y, &fty_mid2);CHKERRQ(ierr);
+      ierr = VecDot(F, Y, &fty_mid2);CHKERRQ(ierr);
       s    = (2.*fty_mid2 + 3.*fty - 6.*fty_mid1 + fty_old) / (3.*delLambda);
     }
     /* if the solve is going in the wrong direction, fix it */

src/snes/linesearch/impls/l2/linesearchl2.c

         fnrm_mid = gnorm;
         ierr     = (*linesearch->ops->vinorm)(snes, F, W, &fnrm_mid);CHKERRQ(ierr);
       } else {
-        ierr = VecNormBegin(F, NORM_2, &fnrm_mid);CHKERRQ(ierr);
+        ierr = VecNorm(F,NORM_2,&fnrm_mid);CHKERRQ(ierr);
       }
 
       /* compute the norm at lambda */
         fnrm = gnorm;
         ierr = (*linesearch->ops->vinorm)(snes, F, W, &fnrm);CHKERRQ(ierr);
       } else {
-        ierr = VecNormBegin(F, NORM_2, &fnrm);CHKERRQ(ierr);
-      }
-      if (!linesearch->ops->vinorm) {
-        ierr = VecNormEnd(F, NORM_2, &fnrm_mid);CHKERRQ(ierr);
-        ierr = VecNormEnd(F, NORM_2, &fnrm);CHKERRQ(ierr);
+        ierr = VecNorm(F,NORM_2,&fnrm);CHKERRQ(ierr);
       }
       fnrm_mid = fnrm_mid*fnrm_mid;
       fnrm = fnrm*fnrm;