Ignore:
Timestamp:
06/22/12 10:28:55 (13 years ago)
Author:
Mathieu Morlighem
Message:

Changing some printf to _printLine_

Location:
issm/trunk-jpl/src/c/modules
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp

    r12450 r12507  
    7777                }
    7878                printf( "\n" );
    79                 printf("Number of zeroes remaining: %10ld",lines*samps-counter);
     79                printf("Number of zeroes remaining: %d",lines*samps-counter);
    8080                fflush( stdout );
    8181        #endif
     
    9696                //        n u m b e r   o f   z e r o e s   r e m a i n i n g :   1 2 3 4 5 6 7 8 9 10       
    9797                printf( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
    98                 printf("Number of zeroes remaining: %10ld",lines*samps-counter);
     98                printf("Number of zeroes remaining: %d",lines*samps-counter);
    9999                fflush( stdout );
    100100        #endif
  • issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp

    r12493 r12507  
    124124        double *y             = gate->y;
    125125        int     nods          = gate->nods;
    126         Vector*     data_mesh     = gate->data_mesh;
     126        Vector *data_mesh     = gate->data_mesh;
    127127        double *data          = gate->data;
    128128        double  default_value = gate->default_value;
     
    131131        int     N             = gate->N;
    132132
     133        bool debug = M*N>1? true:false;
     134        debug = true;
     135
    133136        /*partition loop across threads: */
    134137        PartitionRange(&i0,&i1,nods,num_threads,my_thread);
    135138        for (i=i0;i<i1;i++) {
    136139
     140                if(debug && my_thread==0)
     141                 _printLine_("\r      interpolation progress: "<<setw(5)<<setprecision(2)<<double(i-i0)/double(i1-i0)*100<<"%%");
    137142                x_grid=*(x_mesh+i);
    138143                y_grid=*(y_mesh+i);
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp

    r11695 r12507  
    1717        bool debug;
    1818        int  nels_data;
    19         double* index_data=NULL;
    20         double* x_data=NULL;
    21         double* y_data=NULL;
    22         double* data=NULL;
    23         double xmin,xmax;
    24         double ymin,ymax;
    25         int    nods_prime;
    26         Vector*    data_prime=NULL;
    27         double* x_prime=NULL;
    28         double* y_prime=NULL;
    29         double* default_values=NULL;
     19        double *index_data         = NULL;
     20        double *x_data             = NULL;
     21        double *y_data             = NULL;
     22        double *data               = NULL;
     23        double  xmin                 ,xmax;
     24        double  ymin                 ,ymax;
     25        int     nods_prime;
     26        Vector *data_prime         = NULL;
     27        double *x_prime            = NULL;
     28        double *y_prime            = NULL;
     29        double *default_values     = NULL;
    3030        int     num_default_values;
    31         double*    incontour=NULL;
     31        double *incontour          = NULL;
    3232
    3333        /*intermediary: */
     
    4646       
    4747        /*recover parameters :*/
    48         interpolation_type=gate->interpolation_type;
    49         debug=gate->debug;
    50         nels_data=gate->nels_data;
    51         index_data=gate->index_data;
    52         x_data=gate->x_data;
    53         y_data=gate->y_data;
    54         data=gate->data;
    55         xmin=gate->xmin;
    56         xmax=gate->xmax;
    57         ymin=gate->ymin;
    58         ymax=gate->ymax;
    59         nods_prime=gate->nods_prime;
    60         data_prime=gate->data_prime;
    61         x_prime=gate->x_prime;
    62         y_prime=gate->y_prime;
    63         default_values=gate->default_values;
    64         num_default_values=gate->num_default_values;
    65         incontour=gate->incontour;
     48        interpolation_type = gate->interpolation_type;
     49        debug              = gate->debug;
     50        nels_data          = gate->nels_data;
     51        index_data         = gate->index_data;
     52        x_data             = gate->x_data;
     53        y_data             = gate->y_data;
     54        data               = gate->data;
     55        xmin               = gate->xmin;
     56        xmax               = gate->xmax;
     57        ymin               = gate->ymin;
     58        ymax               = gate->ymax;
     59        nods_prime         = gate->nods_prime;
     60        data_prime         = gate->data_prime;
     61        x_prime            = gate->x_prime;
     62        y_prime            = gate->y_prime;
     63        default_values     = gate->default_values;
     64        num_default_values = gate->num_default_values;
     65        incontour          = gate->incontour;
    6666
    6767        /*partition loop across threads: */
     
    6969
    7070        /*Loop over the elements*/
    71         if (debug && my_thread==0) printf("      interpolation progress:   %5.2lf %%",0.0);
    72 
    7371        for (i=i0;i<i1;i++){
    7472
    7573                /*display current iteration*/
    76                 if (debug && my_thread==0 && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100*num_threads);
     74                if (debug && my_thread==0 && fmod((double)i,(double)100)==0)
     75                 _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(i-i0)/double(i1-i0)*100<<"%");
    7776
    7877                /*if there is no point inside the domain, go to next iteration*/
     
    125124                }
    126125        }
    127         if (debug && my_thread==0) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
    128        
     126        if(debug && my_thread==0)
     127         _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    129128        return NULL;
    130 
    131129}
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp

    r12493 r12507  
    8585
    8686        /*Loop over the elements*/
    87         if (debug) printf("      interpolation progress:   %5.2lf %%",0.0);
    8887        for (n=0;n<nels;n++){
    8988
    9089                /*display current iteration*/
    91                 if (debug && fmod((double)n,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)n/nels*100);
     90                if (debug && fmod((double)n,(double)100)==0)
     91                 _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(n)/double(nels)*100<<"%");
    9292
    9393                /*Get extrema coordinates of current elements*/
     
    168168                }
    169169        }
    170         if (debug) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     170        if (debug)
     171         _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    171172
    172173        /*Assign output pointers:*/
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp

    r12493 r12507  
    5858
    5959        /*Loop over the elements*/
    60         if (debug) printf("      interpolation progress:   %5.2lf %%",0.0);
    6160        for (i=0;i<nels_data;i++){
    6261
    6362                /*display current iteration*/
    64                 if (debug && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
     63                if (debug && fmod((double)i,(double)100)==0)
     64                 _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<double(i)/double(nels_data)*100<<"%");
    6565
    6666                /*Get extrema coordinates of current elements*/
     
    132132                }
    133133        }
    134         if (debug) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     134        if (debug)
     135         _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    135136
    136137        /*Assign output pointers:*/
  • issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp

    r12493 r12507  
    9696                /*launch the thread manager with Krigingxt as a core: */
    9797                LaunchThread(NearestNeighbort,(void*)&gate,num);
    98                 printf("\r      interpolation progress:  100.00%%\n");
     98                _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    9999                xDelete<double>(gate.percent);
    100100        }
     
    115115                /*launch the thread manager with Krigingxt as a core: */
    116116                LaunchThread(idwt,(void*)&gate,num);
    117                 printf("\r      interpolation progress:  100.00%%\n");
     117                _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    118118                xDelete<double>(gate.percent);
    119119        }
     
    135135                /*launch the thread manager with Krigingxt as a core: */
    136136                LaunchThread(Krigingxt,(void*)&gate,num);
    137                 printf("\r      interpolation progress:  100.00%%\n");
     137                _printLine_("\r      interpolation progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    138138                xDelete<double>(gate.percent);
    139139        }
     
    190190                localpercent=percent[0];
    191191                for(int i=1;i<num_threads;i++) localpercent=min(localpercent,percent[i]);
    192                 printf("\r      interpolation progress: %5.2lf%%",localpercent);
     192                _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<localpercent<<"%");
    193193
    194194                /*Kriging interpolation*/
     
    239239                localpercent=percent[0];
    240240                for(i=1;i<num_threads;i++) localpercent=min(localpercent,percent[i]);
    241                 printf("\r      interpolation progress: %5.2lf%%",localpercent);
     241                _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<localpercent<<"%");
    242242
    243243                observations->InterpolationNearestNeighbor(&predictions[idx],x_interp[idx],y_interp[idx],radius);
     
    287287                localpercent=percent[0];
    288288                for(int i=1;i<num_threads;i++) localpercent=min(localpercent,percent[i]);
    289                 printf("\r      interpolation progress: %5.2lf%%",localpercent);
     289                _printString_("\r      interpolation progress: "<<setw(6)<<setprecision(2)<<localpercent<<"%");
    290290
    291291                observations->InterpolationIDW(&predictions[idx],x_interp[idx],y_interp[idx],radius,mindata,maxdata,power);
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp

    r12450 r12507  
    4545
    4646        /*Loop over the nodes*/
    47         if (my_thread==0) printf("      loop progress:   %5.2lf %%",0.0);
    48 
    4947        for (i=i0;i<i1;i++){
    5048
    5149                /*display current iteration*/
    52                 if (my_thread==0 && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nods*100*num_threads);
     50                if (my_thread==0 && fmod((double)i,(double)100)==0)
     51                 _printString_("\r      loop progress: "<<setw(6)<<setprecision(2)<<double(i-i0)/double(i1-i0)*100<<"%");
    5352
    5453                distance=mindistance+100; //make sure initialization respects min distance criterion.
     
    7069                }
    7170        }
    72         if (my_thread==0) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     71        if (my_thread==0)
     72         _printLine_("\r      loop progress: "<<fixed<<setw(6)<<setprecision(2)<<100.<<"%");
    7373
    7474        /*Free ressources:*/
Note: See TracChangeset for help on using the changeset viewer.