]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/s-fixint.h
Cleaned up tracing levels. Array sorter now has its own control knob.
[libucw.git] / lib / sorter / s-fixint.h
index de152b0a90422d5fae4bd56de7d4c1e9eb68a188..276194cb4498535be62902cf84b3c294a81f2a09 100644 (file)
 #define ASORT_KEY_TYPE P(key)
 #define ASORT_LT(x,y) (P(compare)(&(x), &(y)) < 0)
 #ifdef SORT_INTERNAL_RADIX
 #define ASORT_KEY_TYPE P(key)
 #define ASORT_LT(x,y) (P(compare)(&(x), &(y)) < 0)
 #ifdef SORT_INTERNAL_RADIX
-#define ASORT_HASH(x) P(hash)(&(x))
+#  define ASORT_HASH(x) P(hash)(&(x))
+#    ifdef SORT_LONG_HASH
+#      define ASORT_LONG_HASH
+#    endif
 #endif
 #include "lib/sorter/array.h"
 
 #endif
 #include "lib/sorter/array.h"
 
@@ -55,7 +58,7 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct
   P(key) *buf = ctx->big_buf;
   uns maxkeys = P(internal_num_keys)(ctx);
 
   P(key) *buf = ctx->big_buf;
   uns maxkeys = P(internal_num_keys)(ctx);
 
-  SORT_XTRACE(4, "s-fixint: Reading (maxkeys=%u, hash_bits=%d)", maxkeys, bin->hash_bits);
+  SORT_XTRACE(5, "s-fixint: Reading (maxkeys=%u, hash_bits=%d)", maxkeys, bin->hash_bits);
   uns n = 0;
   while (n < maxkeys && P(read_key)(in, &buf[n]))
     n++;
   uns n = 0;
   while (n < maxkeys && P(read_key)(in, &buf[n]))
     n++;
@@ -63,22 +66,20 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct
     return 0;
   void *workspace UNUSED = ALIGN_PTR(&buf[n], CPU_PAGE_SIZE);
 
     return 0;
   void *workspace UNUSED = ALIGN_PTR(&buf[n], CPU_PAGE_SIZE);
 
-  SORT_XTRACE(3, "s-fixint: Sorting %u items (%s items, %s workspace)",
+  SORT_XTRACE(4, "s-fixint: Sorting %u items (%s items, %s workspace)",
        n,
        stk_fsize(n * sizeof(P(key))),
        stk_fsize(n * P(internal_workspace)()));
   timestamp_t timer;
   init_timer(&timer);
        n,
        stk_fsize(n * sizeof(P(key))),
        stk_fsize(n * P(internal_workspace)()));
   timestamp_t timer;
   init_timer(&timer);
-  buf = P(array_sort)(buf, n,
+  buf = P(array_sort)(buf, n
 #ifdef SORT_INTERNAL_RADIX
 #ifdef SORT_INTERNAL_RADIX
-    workspace, bin->hash_bits
-#else
-    NULL, 0
+    , workspace, bin->hash_bits
 #endif
     );
   ctx->total_int_time += get_timer(&timer);
 
 #endif
     );
   ctx->total_int_time += get_timer(&timer);
 
-  SORT_XTRACE(4, "s-fixint: Writing");
+  SORT_XTRACE(5, "s-fixint: Writing");
   if (n < maxkeys)
     bout = bout_only;
   struct fastbuf *out = sbuck_write(bout);
   if (n < maxkeys)
     bout = bout_only;
   struct fastbuf *out = sbuck_write(bout);
@@ -110,7 +111,7 @@ static int P(internal)(struct sort_context *ctx, struct sort_bucket *bin, struct
       P(write_key)(out, &buf[i]);
     }
 #ifdef SORT_UNIFY
       P(write_key)(out, &buf[i]);
     }
 #ifdef SORT_UNIFY
-  SORT_XTRACE(3, "Merging reduced %d records", merged);
+  SORT_XTRACE(4, "Merging reduced %d records", merged);
 #endif
 
   return (n == maxkeys);
 #endif
 
   return (n == maxkeys);