Changeset: 991885af7fa8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=991885af7fa8
Modified Files:
monetdb5/extras/crackers/crackers_core_unordered.mx
monetdb5/extras/crackers/crackers_selectholpl_ops.mx
Branch: holindex
Log Message:
Each thread that copies the tail, materializes also the head.
diffs (60 lines):
diff --git a/monetdb5/extras/crackers/crackers_core_unordered.mx
b/monetdb5/extras/crackers/crackers_core_unordered.mx
--- a/monetdb5/extras/crackers/crackers_core_unordered.mx
+++ b/monetdb5/extras/crackers/crackers_core_unordered.mx
@@ -1772,13 +1772,17 @@ static str CRKcopy_x_@2_@1 (
) {
@1 *src_t_crackerbat = (@1 *) Tloc(crackerbat, BUNfirst(crackerbat));
@1 *src_t_basebat = (@1 *) Tloc(basebat, BUNfirst(basebat));
- oid *src_h_crackerbat = (oid *) Hloc(crackerbat, BUNfirst(crackerbat));
- oid *src_h_basebat = (oid *) Hloc(basebat, BUNfirst(basebat));
const BUN n = last - first + 1;
const BUN snt = n * sizeof(@1);
- const BUN snh = n * sizeof(oid);
+ BUN i;
+ oid h = crackerbat->hseqbase + first;
+ oid *x = (oid *) crackerbat->H->heap.base + first;
- memcpy(&src_h_crackerbat[first], &src_h_basebat[first], snh);
+ /*materialize head*/
+ for (i=first; i <= last; i++)
+ *x++ = h++;
+
+ /*copy data (tail) from base bat to cracker bat*/
memcpy(&src_t_crackerbat[first], &src_t_basebat[first], snt);
return MAL_SUCCEED;
diff --git a/monetdb5/extras/crackers/crackers_selectholpl_ops.mx
b/monetdb5/extras/crackers/crackers_selectholpl_ops.mx
--- a/monetdb5/extras/crackers/crackers_selectholpl_ops.mx
+++ b/monetdb5/extras/crackers/crackers_selectholpl_ops.mx
@@ -1412,25 +1412,21 @@ CRKRangeLeftNilTree_@1(int *vid, int *bi
}
gettimeofday(&tv0_copy, 0);
- //b = BATcopy(bo, bo->htype, bo->ttype, TRUE);
- //if ( bo->htype == TYPE_void)
- // b = BATmaterializeh(b);
b=BATnew(TYPE_oid, bo->ttype,BATcount(bo));
- BATkey(BATmirror(b),FALSE);
- BATsetcount(b,BATcount(bo));
- CRKparallelcopy_LE_@1(b, bo, (BUN) 0, BATcount(bo)-1, nthreads);
- gettimeofday(&tv1_copy, 0);
- fprintf(ofp_copy,"%d\n",(int)dt(tv0_copy,tv1_copy)*1000000);
-
b->hsorted = FALSE;
b->tsorted = FALSE;
b->hdense = FALSE;
b->tdense = FALSE;
+ CRKparallelcopy_LE_@1(b, bo, (BUN) 0, BATcount(bo)-1, nthreads);
+ BATkey(BATmirror(b),FALSE);
+ BATsetcount(b,BATcount(bo));
b->batRestricted= BAT_READ;
BATmode(b,PERSISTENT);
bo->batRestricted= BAT_READ;
+ BBPincref(*bid, TRUE);
+ gettimeofday(&tv1_copy, 0);
+ fprintf(ofp_copy,"%d\n",(int)dt(tv0_copy,tv1_copy)*1000000);
- BBPincref(*bid, TRUE);
m = newCrackerIndex_@1(*bid,b->batCacheid);
if ((c = BATdescriptor(CrackerIndex[m].cid)) == NULL)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list