progressbar.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 static char const Id[] = "$Id: progressbar.c 2962 2010-02-04 19:50:44Z scholz $\n\n";
00025 static char const Td[] = "$Today: " __FILE__ " " __DATE__ " " __TIME__ " $\n\n";
00026
00027 #include "util.h"
00028
00029 int ProgressBar(int cur,int max,int ival)
00030 {
00031 if (cur==0) {
00032 return(0);
00033 }
00034
00035 if (cur>=max) {
00036 PetscPrintf(PETSC_COMM_WORLD,"100%%...done\n");
00037 return(0);
00038 }
00039
00040 ival=max/ival+1;
00041 if (cur%ival==0) {
00042 PetscPrintf(PETSC_COMM_WORLD,"%i%%...",cur*100/max);
00043 }
00044 return(0);
00045 }