Multi-core Hash Joins
Main-memory hash join implementations for multi-core CPUs
Classes | Macros | Typedefs | Functions | Variables
no_partitioning_join.c File Reference

The implementation of NPO, No Partitioning Optimized join algortihm. More...

#include <sched.h>
#include <pthread.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include "no_partitioning_join.h"
#include "npj_params.h"
#include "npj_types.h"
#include "rdtsc.h"
#include "lock.h"
#include "cpu_mapping.h"
#include "barrier.h"
#include "affinity.h"
#include "generator.h"

Go to the source code of this file.

Classes

struct  arg_t
 

Macros

#define _GNU_SOURCE
 
#define NEXT_POW_2(V)
 
#define HASH(X, MASK, SKIP)   (((X) & MASK) >> SKIP)
 
#define DEBUGMSG(COND, MSG, ...)
 

Typedefs

typedef struct arg_t arg_t
 

Functions

void init_bucket_buffer (bucket_buffer_t **ppbuf)
 
void free_bucket_buffer (bucket_buffer_t *buf)
 
void allocate_hashtable (hashtable_t **ppht, uint32_t nbuckets)
 
void destroy_hashtable (hashtable_t *ht)
 
void build_hashtable_st (hashtable_t *ht, relation_t *rel)
 
int64_t probe_hashtable (hashtable_t *ht, relation_t *rel, void *output)
 
result_tNPO_st (relation_t *relR, relation_t *relS, int nthreads)
 
void build_hashtable_mt (hashtable_t *ht, relation_t *rel, bucket_buffer_t **overflowbuf)
 
void * npo_thread (void *param)
 
result_tNPO (relation_t *relR, relation_t *relS, int nthreads)
 

Variables

int numalocalize
 
int nthreads
 

Detailed Description

The implementation of NPO, No Partitioning Optimized join algortihm.

Author
Cagri Balkesen cagri.nosp@m..bal.nosp@m.kesen.nosp@m.@inf.nosp@m..ethz.nosp@m..ch
Date
Sun Feb 5 20:16:58 2012
Version
Id
no_partitioning_join.c 4419 2013-10-21 16:24:35Z bcagri

(c) 2012, ETH Zurich, Systems Group

Definition in file no_partitioning_join.c.

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 14 of file no_partitioning_join.c.

◆ DEBUGMSG

#define DEBUGMSG (   COND,
  MSG,
  ... 
)

Debug msg logging method

Definition at line 78 of file no_partitioning_join.c.

◆ HASH

#define HASH (   X,
  MASK,
  SKIP 
)    (((X) & MASK) >> SKIP)

Definition at line 70 of file no_partitioning_join.c.

◆ NEXT_POW_2

#define NEXT_POW_2 (   V)
Value:
do { \
V--; \
V |= V >> 1; \
V |= V >> 2; \
V |= V >> 4; \
V |= V >> 8; \
V |= V >> 16; \
V++; \
} while(0)

compute the next number, greater than or equal to 32-bit unsigned v. taken from "bit twiddling hacks": http://graphics.stanford.edu/~seander/bithacks.html

Definition at line 57 of file no_partitioning_join.c.

Variable Documentation

◆ nthreads

int nthreads
extern

Definition at line 48 of file generator.c.

◆ numalocalize

int numalocalize
extern

An experimental feature to allocate input relations numa-local

Definition at line 47 of file generator.c.