Commits

BarryFSmith  committed a20e7fd
  • Participants
  • Parent commits 7539395

Comments (0)

Files changed (2)

File src/vec/vec/examples/tests/ex34.c

   /* display norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Original: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Original: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /* display cached norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"cached: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"cached: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /*
    * Alter an element
   /* display norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Altered: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Altered: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /* display cached norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"recomputed: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"recomputed: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /*
    * Scale the vector a little
   /* display updated cached norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Scale: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Scale: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /* display forced norm 1 & 2 */
   ierr = PetscObjectStateIncrease((PetscObject)V);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"recompute: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"recompute: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /*
    * Normalize the vector a little
   /* display updated cached norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Normalize: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Normalize: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /* display forced norm 1 & 2 */
   ierr = PetscObjectStateIncrease((PetscObject)V);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"recompute: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"recompute: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /*
    * Copy to another vector
   /* display norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Original: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Original: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /* display cached norm 1 & 2 */
   ierr = VecNorm(W,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(W,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"copied: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"copied: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /*
    * Copy while data is invalid
   /* display norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Invalidated: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Invalidated: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /* display norm 1 & 2 */
   ierr = VecNorm(W,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(W,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"copied: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"copied: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /*
    * Constant vector
   /* display updated cached norm 1 & 2 */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Constant: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Constant: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /* display forced norm 1 & 2 */
   ierr = PetscObjectStateIncrease((PetscObject)V);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_2,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"recomputed: norm1=%e, norm2=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"recomputed: norm1=%e,norm2=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
 
   /*
    * Swap vectors
    */
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(W,NORM_1,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"Orig: norm V=%e, norm W=%e\n",nrm1,nrm2);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"Orig: norm_V=%e,norm_W=%e\n",(double)nrm1,(double)nrm2);CHKERRQ(ierr);
   /* store inf norm */
   ierr = VecNorm(V,NORM_INFINITY,&nrm3);CHKERRQ(ierr);
   ierr = VecNorm(W,NORM_INFINITY,&nrm4);CHKERRQ(ierr);
   ierr = PetscObjectStateIncrease((PetscObject)W);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_1,&nrm1);CHKERRQ(ierr);
   ierr = VecNorm(W,NORM_1,&nrm2);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"swapped: norm V=%e, norm W=%e\n",nrm2,nrm1);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"orig: F norm V=%e, F norm W=%e\n",nrm3,nrm4);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"swapped: norm_V=%e,norm_W=%e\n",(double)nrm2,(double)nrm1);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"orig: F-norm_V=%e,F-norm_W=%e\n",(double)nrm3,(double)nrm4);CHKERRQ(ierr);
   ierr = VecNorm(V,NORM_INFINITY,&nrm3);CHKERRQ(ierr);
   ierr = VecNorm(W,NORM_INFINITY,&nrm4);CHKERRQ(ierr);
-  ierr = PetscPrintf(comm,"swapped: F norm V=%e, F norm W=%e\n",nrm4,nrm3);CHKERRQ(ierr);
+  ierr = PetscPrintf(comm,"swapped: F-norm_V=%e,F-norm_W=%e\n",(double)nrm4,(double)nrm3);CHKERRQ(ierr);
 
   ierr = VecDestroy(&V);CHKERRQ(ierr);
   ierr = VecDestroy(&W);CHKERRQ(ierr);

File src/vec/vec/examples/tests/makefile

 	   ${RM} -f ex33_1.tmp
 runex34:
 	-@${MPIEXEC} -n 1 ./ex34 > ex34_1.tmp 2>&1;
-	-@cat ex34_1.tmp | sed s/e-00/e+00/g | awk '{ $$1=""; if (v!="") { if (v!=$$0) {print "  orig <" v "> \n  cached <" $$0 ">"}; v=""} else {v=$$0} }' > ex34_1.dif
-	-@if [ ` cat ex34_1.dif | wc -l ` -gt 0 ] ; then \
-	    printf "${PWD}\nPossible problem with ex34_1\n=========================================\n"; cat ex34_1.dif; fi; \
+	-@cat ex34_1.tmp | sed s/e-00/e+00/g | awk '{ if (v!="") { if (v!=$$2) {print "  orig <" v "> \n  cached <" $$0 ">"}; v=""} else {v=$$2} }' > ex34_1.dif
+	-@if [ ` cat ex34_1.dif | wc -l ` -gt 0 ] ; then  cat ex34_1.dif ;\
+	    printf "${PWD}\nPossible problem with ex34_1\n=========================================\n"; fi; \
 	   ${RM} -f ex34_1.tmp ex34_1.dif
 runex35:
 	-@${MPIEXEC} -n 1 ./ex35 > ex35_1.tmp 2>&1;\