Changeset: 18e6db1a7f81 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=18e6db1a7f81
Modified Files:
        monetdb5/extras/crackers/crackers_parallelselect_ops.mx
        monetdb5/extras/crackers/crackers_select_ops.mx
Branch: holindex
Log Message:

Remove some useless code.


diffs (truncated from 355 to 300 lines):

diff --git a/monetdb5/extras/crackers/crackers_parallelselect_ops.mx 
b/monetdb5/extras/crackers/crackers_parallelselect_ops.mx
--- a/monetdb5/extras/crackers/crackers_parallelselect_ops.mx
+++ b/monetdb5/extras/crackers/crackers_parallelselect_ops.mx
@@ -62,8 +62,6 @@ crackers_export str CRKparalleluselectBo
 #include "monetdb_config.h"
 #include "crackers.h"
 
-/*#define CRACK_DEBUG 1*/
-
 /* Local support functions and macros */
 @:TypeSwitch(crackOperations)@
 
@@ -227,8 +225,6 @@ createView:
        BUN idxFirst;
        bit copy=TRUE;
        int i;
-        int pieces=0;
-
 
        int *pl_new = NULL;
        oid *pl_new_oid = NULL;
@@ -236,7 +232,7 @@ createView:
         oid *pr_new_oid = NULL;
        int *p_data_less = NULL;
        int *p_data_greater = NULL;
-       int nthreads=0;
+       int nthreads;
         char* p;
         
        p = getenv("MULTITHREADS");
@@ -248,16 +244,6 @@ createView:
        p_data_less=GDKzalloc(nthreads * sizeof(int));
        p_data_greater=GDKzalloc(nthreads * sizeof(int));
 
-
-       /*FILE *ofp;
-       char outputFilename1[] = 
"/export/scratch2/petraki/experiments_1st_paper/experiments/stochastic/idle_time_2/pieces_cracking.txt";
-       ofp = fopen(outputFilename1,"a");
-       if (ofp == NULL) {
-               fprintf(stderr, "Can't open output file!\n");
-               exit(1);
-       }*/
-
-       
        if (@2_GT(low,hgh,@3@1))
                throw(MAL, "crackers.crack", "illegal range");
        
@@ -297,18 +283,7 @@ createView:
                           anyway so crack in three pieces cl-ch */
                        posl = BUNfirst(b);
                        posh = BUNlast(b)-1;
-#ifdef CRACK_DEBUG
-                       fprintf(stderr,"\nposl= "OIDFMT" posh= "OIDFMT" \n", 
posl,posh );       
-#endif
-                       /*printf(" "LLFMT" \n ",posh-posl);*/
                        @:crkThreeTree@5(@1,posl,posh,@5)@
-                       pieces = pieces + 3;
-                       /*fprintf(ofp,"%d\n",pieces);
-                       fclose(ofp);*/
-#ifdef CRACK_DEBUG
-                       fprintf(stderr,"\ncl1= "OIDFMT" ch1= "OIDFMT" cl2= 
"OIDFMT" ch2= "OIDFMT" vl= "OIDFMT" vh= "OIDFMT" ", cl1,ch1,cl2,ch2,vl,vh ); 
-#endif
-                       
                        BBPincref(b->batCacheid,TRUE);
                        BBPunfix(bo->batCacheid);
                        goto createView;
@@ -340,7 +315,6 @@ createView:
                        posl = BUNfirst(b);
                        posh = BUNlast(b)-1;
 
-                       /*printf(" "LLFMT" \n ",posh-posl);*/
                        @:crkThreeTreeCopy(@1,posl,posh,@5)@
                        
                        BBPincref(b->batCacheid,TRUE);
@@ -434,30 +408,17 @@ createView:
 
        
        /* find out where in the index the low falls */
-       
        foundLow = GetLow_@1(*low, *inclusiveLow, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl1, &ch1, 0, BUNlast(b)-(oid)1,&LBound);
 
        /* find out where in the index the high falls */
        foundHgh = GetHgh_@1(*hgh, *inclusiveHgh, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl2, &ch2, 0, BUNlast(b)-(oid)1);
        
-       /*printAVLTree(CrackerIndex[m].Tree, c, BUNfirst(c));*/
-       /*BATprint(BATdescriptor(CrackerIndex[m].cbid));*/ /*Print the cracker 
column BAT*/
-       /*BATprint(BATdescriptor(CrackerIndex[m].cid));  print the cracker 
index for BAT*/
        t=(int *)Tloc(b,BUNfirst(b));
 
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"FoundLow=%d  FoundHgh=%d\n",foundLow,foundHgh);
-       fprintf(stderr,"cl1= "OIDFMT" ch1= "OIDFMT" cl2= "OIDFMT" ch2= "OIDFMT" 
vl= "OIDFMT" vh= "OIDFMT",...t=%d , LBound=%d \n", 
cl1,ch1,cl2,ch2,vl,vh,*t,LBound );
-#endif
-
        /*need to increase one position for the low bound only since we always 
store the previous position in the index*/
        if (cl1 != 0 && LBound==FALSE) cl1++;
        if (cl2 != 0) cl2++;
 
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"cl1= "OIDFMT" ch1= "OIDFMT" cl2= "OIDFMT" ch2= "OIDFMT" 
vl= "OIDFMT" vh= "OIDFMT" \n\n", cl1,ch1,cl2,ch2,vl,vh );
-#endif
-
        /* find the hols if any in the pieces to crack so that cracking does 
not touch deleted buns */
         if (CrackerIndex[m].mergeDeletions == 2){
                oid holsLow = 0, holsHgh = 0;
@@ -518,15 +479,9 @@ createView:
                                 else
                                         _vl = vl;
                                 if (gapL>0)
-                                {
                                         addCrackerIndex_@1(m, low, 
*inclusiveLow, _vl, c);
-                                        pieces = pieces + 1;
-                                }
                                 if (gapH>0)
-                                {
                                         addCrackerIndex_@1(m, hgh, HBound, vh, 
c);
-                                        pieces = pieces + 1;
-                                }
                                 if ((vl == 1) && (*t == *low) && 
(*inclusiveLow == TRUE))
                                         vl = vl - 1;
                         }
@@ -540,10 +495,7 @@ createView:
                                else
                                        _vl = vl;
                                if (gapL>0)
-                               {
                                        addCrackerIndex_@1(m, low, 
*inclusiveLow, _vl, c);
-                                       pieces = pieces + 1;
-                               }
                                if ((vl == 1) && (*t == *low) && (*inclusiveLow 
== TRUE))
                                        vl = vl - 1;
                        }
@@ -563,10 +515,7 @@ createView:
                        t = (int *) Tloc(b, BUNfirst(b));
                        if (IndexSize < IndexStop)
                                if (gapH>0)
-                               {
                                        addCrackerIndex_@1(m, hgh, HBound, vh, 
c);
-                                       pieces = pieces + 1;
-                               }
                        vl = cl1;
                        if ((vl == 0) && (*t < *low) && (*inclusiveLow == TRUE))
                                vl = vl + 1;
@@ -579,9 +528,6 @@ createView:
                vh = ch2;
        }
 
-       /*fprintf(ofp,"%d\n",pieces);
-       fclose(ofp);*/
-       
        GDKfree(pl_new);
        GDKfree(pl_new_oid);
        GDKfree(pr_new);
@@ -897,7 +843,7 @@ CRKRangeLeftNilTree_@1(int *vid, int *bi
         oid *pr_new_oid = NULL;
         int *p_data_less = NULL;
         int *p_data_greater = NULL;
-       int nthreads=0;
+       int nthreads;
         char* p;
 
         p = getenv("MULTITHREADS");
@@ -1018,7 +964,7 @@ CRKRangeRightNilTree_@1(int *vid, int *b
        oid *pl_new_oid = NULL;
         int *p_data_less = NULL;
         int *p_data_greater = NULL;
-       int nthreads=0;
+       int nthreads;
         char* p;
 
         p = getenv("MULTITHREADS");
diff --git a/monetdb5/extras/crackers/crackers_select_ops.mx 
b/monetdb5/extras/crackers/crackers_select_ops.mx
--- a/monetdb5/extras/crackers/crackers_select_ops.mx
+++ b/monetdb5/extras/crackers/crackers_select_ops.mx
@@ -187,19 +187,11 @@ CRKthetauselect_@1(int *vid, int *bid, @
                CRKcrackUnorderedThree@4_LO_RE_@1(b,*low,*hgh, @2, @3, &vl, 
&vh);
        if (*inclusiveLow == FALSE && *inclusiveHgh == FALSE)
                CRKcrackUnorderedThree@4_LO_RO_@1(b,*low,*hgh, @2, @3, &vl, 
&vh);
-       
 
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"AFTER CRKcrackUnorderedThree vl= "OIDFMT"  \n", vl );
-#endif
        /*if (vl != -1 && vh != -1){*/
                if (vl>0) _vl=vl-1; else _vl=vl;
                addCrackerIndex_@1(m,low,*inclusiveLow,_vl,c);
                addCrackerIndex_@1(m,hgh,HBound,vh,c);
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"AFTER crkThreeTree vl= "OIDFMT"  \n", vl );
-#endif
-       
 @
 @= crkThreeTreeCopy
         /*printf("crack in three pieces\n");*/
@@ -226,10 +218,7 @@ CRKthetauselect_@1(int *vid, int *bid, @
                CRKcrackUnorderedZero@2_RE_@1(b,*low, cl1, ch1,&vl);
        else
                CRKcrackUnorderedZero@2_LE_@1(b,*low, cl1, ch1,&vl);
-
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"AFTER CRKcrackUnorderedZero vl= "OIDFMT"  \n", vl );    
-#endif
+       
        if (vl < cl1){
                /*then the left piece is empty*/
                gapL = -1;
@@ -242,10 +231,6 @@ CRKthetauselect_@1(int *vid, int *bid, @
 
        vl++; /* We need to take next position because the crack function 
always returns the last bun of the left piece.
                Instead we want the first bun of the right piece*/
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"AFTER crkTwoLTree vl= "OIDFMT"  \n", vl );
-#endif
-        
 @
 @= crkTwoRTree
        /*CRACK in two pieces cl2-ch2 using <incHgh bound*/
@@ -301,27 +286,12 @@ createView:
        BUN idxFirst;
        bit copy=TRUE;
 
-       int pieces=0;
-       /*FILE *ofp;
-       char outputFilename1[] = 
"/export/scratch2/petraki/experiments_1st_paper/experiments/stochastic/idle_time_2/pieces_cracking.txt";
-       ofp = fopen(outputFilename1,"a");
-       if (ofp == NULL) {
-               fprintf(stderr, "Can't open output file!\n");
-               exit(1);
-       }*/
-
-       
        if (@2_GT(low,hgh,@3@1))
                throw(MAL, "crackers.crack", "illegal range");
        
        if (*inclusiveHgh == TRUE) HBound = FALSE;
        else    HBound = TRUE;                          
 
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"RangeSelectBody\n");
-#endif
-       
-
        m = existsCrackerIndex(*bid);
 
        /* if this is the first time we select something from this bat,
@@ -355,17 +325,8 @@ createView:
                           anyway so crack in three pieces cl-ch */
                        posl = BUNfirst(b);
                        posh = BUNlast(b)-1;
-#ifdef CRACK_DEBUG
-                       fprintf(stderr,"\nposl= "OIDFMT" posh= "OIDFMT" \n", 
posl,posh );       
-#endif
-                       /*printf(" "LLFMT" \n ",posh-posl);*/
+                       
                        @:crkThreeTree@5(@1,posl,posh,@5)@
-                       pieces = pieces + 3;
-                       /*fprintf(ofp,"%d\n",pieces);
-                       fclose(ofp);*/
-#ifdef CRACK_DEBUG
-                       fprintf(stderr,"\ncl1= "OIDFMT" ch1= "OIDFMT" cl2= 
"OIDFMT" ch2= "OIDFMT" vl= "OIDFMT" vh= "OIDFMT" ", cl1,ch1,cl2,ch2,vl,vh ); 
-#endif
                        
                        BBPincref(b->batCacheid,TRUE);
                        BBPunfix(bo->batCacheid);
@@ -398,7 +359,6 @@ createView:
                        posl = BUNfirst(b);
                        posh = BUNlast(b)-1;
 
-                       /*printf(" "LLFMT" \n ",posh-posl);*/
                        @:crkThreeTreeCopy(@1,posl,posh,@5)@
                        
                        BBPincref(b->batCacheid,TRUE);
@@ -488,34 +448,18 @@ createView:
                         throw(MAL, "crackers.crackRange", "%s", msg);
        }
 
-       
-
-       
        /* find out where in the index the low falls */
-       
        foundLow = GetLow_@1(*low, *inclusiveLow, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl1, &ch1, 0, BUNlast(b)-(oid)1,&LBound);
 
        /* find out where in the index the high falls */
        foundHgh = GetHgh_@1(*hgh, *inclusiveHgh, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl2, &ch2, 0, BUNlast(b)-(oid)1);
        
-       /*printAVLTree(CrackerIndex[m].Tree, c, BUNfirst(c));*/
-       /*BATprint(BATdescriptor(CrackerIndex[m].cbid));*/ /*Print the cracker 
column BAT*/
-       /*BATprint(BATdescriptor(CrackerIndex[m].cid));  print the cracker 
index for BAT*/
        t=(int *)Tloc(b,BUNfirst(b));
 
-#ifdef CRACK_DEBUG
-       fprintf(stderr,"FoundLow=%d  FoundHgh=%d\n",foundLow,foundHgh);
-       fprintf(stderr,"cl1= "OIDFMT" ch1= "OIDFMT" cl2= "OIDFMT" ch2= "OIDFMT" 
vl= "OIDFMT" vh= "OIDFMT",...t=%d , LBound=%d \n", 
cl1,ch1,cl2,ch2,vl,vh,*t,LBound );
-#endif
-
        /*need to increase one position for the low bound only since we always 
store the previous position in the index*/
        if (cl1 != 0 && LBound==FALSE) cl1++;
        if (cl2 != 0) cl2++;
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to