Changeset: 480b9571bc1b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=480b9571bc1b
Modified Files:
        geom/monetdb5/geomBulk.c
Branch: sfcgal
Log Message:

Do not set count and then remove properties. In OpenMP once you get the first 
error message do not continue processing.


diffs (truncated from 353 to 300 lines):

diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c
--- a/geom/monetdb5/geomBulk.c
+++ b/geom/monetdb5/geomBulk.c
@@ -13,9 +13,9 @@
 #include "geom.h"
 #include <omp.h>
 
-#define GEOMBULK_DEBUG 1
-#define OPENCL_DYNAMIC 1
-#define OPENCL_THREADS 8
+//#define GEOMBULK_DEBUG 1
+#define OPENCL_DYNAMIC 0
+#define OPENCL_THREADS 1
 
 /*******************************/
 /********** One input **********/
@@ -61,7 +61,9 @@ geom_2_geom_bat(bat *outBAT_id, bat *inB
     for (p = 0; p < q; p++) {
                str err = NULL;
            wkb *inWKB = NULL, *outWKB = NULL;
-
+        
+        if (msg)
+            continue;
                //if for used --> inWKB = (wkb *) BUNtail(inBATi, i);
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                if ((err = geom_2_geom(&outWKB, &inWKB, columnType, 
columnSRID)) != MAL_SUCCEED) {      //check type
@@ -103,8 +105,8 @@ geom_2_geom_bat(bat *outBAT_id, bat *inB
     fprintf(stdout, "batcalc.wkb BUNappend %llu ms\n", t);
 #endif
 
+       //BATrmprops(outBAT)
        //BATsetcount(outBAT, BATcount(inBAT));
-       //BATrmprops(outBAT)
        //BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -202,6 +204,8 @@ wkbCoordinateFromMBR_bat(bat *outBAT_id,
                str err = NULL;
            mbr *inMBR = NULL;
            //double outDbl = 0.0;
+        if (msg)
+            continue;
 
                inMBR = (mbr *) BUNtail(inBAT_iter, p);
                //if ((err = wkbCoordinateFromMBR(&outDbl, &inMBR, 
coordinateIdx)) != MAL_SUCCEED) {
@@ -225,8 +229,8 @@ wkbCoordinateFromMBR_bat(bat *outBAT_id,
     }
 
        //set some properties of the new BAT
+       BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-       BATrmprops(outBAT)
        BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -338,6 +342,8 @@ WKBtoDBL_bat(bat *outBAT_id, bat *inBAT_
                str err = NULL;
            wkb *inWKB = NULL;
                //double outSingle;
+        if (msg)
+            continue;
 
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                //if ((err = (*func) (&outSingle, &inWKB)) != MAL_SUCCEED) {
@@ -360,8 +366,8 @@ WKBtoDBL_bat(bat *outBAT_id, bat *inBAT_
         return msg;
     }
 
+    BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -420,6 +426,8 @@ WKBtoWKB_bat(bat *outBAT_id, bat *inBAT_
                str err = NULL;
                wkb *outSingle;
            wkb *inWKB = NULL;
+        if (msg)
+            continue;
 
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                if ((err = (*func) (&outSingle, &inWKB)) != MAL_SUCCEED) {
@@ -462,8 +470,8 @@ WKBtoWKB_bat(bat *outBAT_id, bat *inBAT_
 #endif
 
        //set the number of elements in the outBAT
+    //BATrmprops(outBAT)
        //BATsetcount(outBAT, BATcount(inBAT));
-    //BATrmprops(outBAT)
     //BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -527,6 +535,8 @@ WKBtoWKBflagINT_bat(bat *outBAT_id, bat 
                str err = NULL;
                wkb *outSingle;
            wkb *inWKB = NULL;
+        if (msg)
+            continue;
 
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                if ((err = (*func) (&outSingle, &inWKB, flag)) != MAL_SUCCEED) {
@@ -568,8 +578,8 @@ WKBtoWKBflagINT_bat(bat *outBAT_id, bat 
     fprintf(stdout, "batcalc.wkb BUNappend %llu ms\n", t);
 #endif
 
+    //BATrmprops(outBAT)
        //BATsetcount(outBAT, BATcount(inBAT));
-    //BATrmprops(outBAT)
     //BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -639,6 +649,8 @@ WKBtoWKBflagDBL_bat(bat *outBAT_id, bat 
                str err = NULL;
                wkb *outSingle;
            wkb *inWKB = NULL;
+        if (msg)
+            continue;
 
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                if ((err = (*func) (&outSingle, &inWKB, flag)) != MAL_SUCCEED) {
@@ -680,8 +692,8 @@ WKBtoWKBflagDBL_bat(bat *outBAT_id, bat 
     fprintf(stdout, "batcalc.wkb BUNappend %llu ms\n", t);
 #endif
 
+    //BATrmprops(outBAT)
        //BATsetcount(outBAT, BATcount(inBAT));
-    //BATrmprops(outBAT)
     //BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -739,6 +751,8 @@ WKBtoBIT_bat(bat *outBAT_id, bat *inBAT_
         str err = NULL;
            wkb *inWKB = NULL;
         //bit outSingle;
+        if (msg)
+            continue;
 
         inWKB = (wkb *) BUNtail(inBAT_iter, p);
         //if ((err = (*func) (&outSingle, &inWKB)) != MAL_SUCCEED) {
@@ -761,8 +775,8 @@ WKBtoBIT_bat(bat *outBAT_id, bat *inBAT_
         return msg;
     }
 
+    BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -851,6 +865,8 @@ WKBWKBtoBIT_bat(bat *outBAT_id, bat *aBA
         wkb *aWKB = NULL, *bWKB = NULL;
         //bit out;
         str err = NULL;
+        if (msg)
+            continue;
 
         aWKB = (wkb *) BUNtail(aBAT_iter, p);
         bWKB = (wkb *) BUNtail(bBAT_iter, p);
@@ -876,8 +892,8 @@ WKBWKBtoBIT_bat(bat *outBAT_id, bat *aBA
         return msg;
     }
 
+    BATrmprops(outBAT)
     BATsetcount(outBAT, q);
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -948,6 +964,8 @@ WKBWKBtoBITflagDBL_bat(bat *outBAT_id, b
         wkb *aWKB = NULL, *bWKB = NULL;
         //bit out;
         str err = NULL;
+        if (msg)
+            continue;
 
         aWKB = (wkb *) BUNtail(aBAT_iter, p);
         bWKB = (wkb *) BUNtail(bBAT_iter, p);
@@ -973,8 +991,8 @@ WKBWKBtoBITflagDBL_bat(bat *outBAT_id, b
         return msg;
     }
 
+    BATrmprops(outBAT)
     BATsetcount(outBAT, q);
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -1037,6 +1055,8 @@ WKBWKBtoWKB_bat(bat *outBAT_id, bat *aBA
     for (p = 0; p < q; p++) {
         wkb *aWKB = NULL, *bWKB = NULL, *outWKB = NULL;
         str err = NULL;
+        if (msg)
+            continue;
 
         aWKB = (wkb *) BUNtail(aBAT_iter, p);
         bWKB = (wkb *) BUNtail(bBAT_iter, p);
@@ -1160,6 +1180,8 @@ WKBDBLDBLDBLINTtoBIT_bat(bat *outBAT_id,
            wkb *inWKB = NULL;
                //bit outSingle;
         double x, y, z;
+        if (msg)
+            continue;
 
 
         inWKB = (wkb *) BUNtail(inBAT_iter, p);
@@ -1202,8 +1224,8 @@ WKBDBLDBLDBLINTtoBIT_bat(bat *outBAT_id,
         BBPunfix(outBAT->batCacheid);
     }
 
+    BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
     BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -1293,6 +1315,8 @@ WKBDBLDBLDBLINTtoBITflagDBL_bat(bat *out
            wkb *inWKB = NULL;
                //bit outSingle;
         double x, y, z;
+        if (msg)
+            continue;
 
 
         inWKB = (wkb *) BUNtail(inBAT_iter, p);
@@ -1335,8 +1359,8 @@ WKBDBLDBLDBLINTtoBITflagDBL_bat(bat *out
         BBPunfix(outBAT->batCacheid);
     }
 
+    BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
     BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -1394,6 +1418,8 @@ WKBtoINT_bat(bat *outBAT_id, bat *inBAT_
                str err = NULL;
            wkb *inWKB = NULL;
                //int outSingle;
+        if (msg)
+            continue;
 
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                //if ((err = (*func) (&outSingle, &inWKB)) != MAL_SUCCEED) {
@@ -1416,8 +1442,8 @@ WKBtoINT_bat(bat *outBAT_id, bat *inBAT_
         return msg;
     }
 
+    BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -1482,6 +1508,8 @@ WKBtoINTflagINT_bat(bat *outBAT_id, bat 
                str err = NULL;
            wkb *inWKB = NULL;
                //int outSingle;
+        if (msg)
+            continue;
 
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                //if ((err = (*func) (&outSingle, &inWKB, flag)) != 
MAL_SUCCEED) {
@@ -1505,8 +1533,8 @@ WKBtoINTflagINT_bat(bat *outBAT_id, bat 
     }
 
        //set the number of elements in the outBAT
+    BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -1570,7 +1598,9 @@ wkbGetCoordinate_bat(bat *outBAT_id, bat
                str err = NULL;
            wkb *inWKB = NULL;
        //      double outSingle;
-
+        if (msg)
+            continue;
+         
                inWKB = (wkb *) BUNtail(inBAT_iter, p);
                //if ((err = wkbGetCoordinate(&outSingle, &inWKB, flag)) != 
MAL_SUCCEED) {
                if ((err = wkbGetCoordinate(&outs[p], &inWKB, flag)) != 
MAL_SUCCEED) {
@@ -1592,8 +1622,8 @@ wkbGetCoordinate_bat(bat *outBAT_id, bat
         return msg;
     }
 
+    BATrmprops(outBAT)
        BATsetcount(outBAT, BATcount(inBAT));
-    BATrmprops(outBAT)
     BATsettrivprop(outBAT);
        BBPkeepref(*outBAT_id = outBAT->batCacheid);
 
@@ -1678,6 +1708,8 @@ WKBtoWKBxyzDBL_bat(bat *outBAT_id, bat *
            wkb *inWKB = NULL;
                wkb *outSingle;
         double x, y, z;
+        if (msg)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to