General:

  The avx_phi_* files can be compiled for both KNC and AVX2.
  The phi_* files can be compiled for KNC.
  Compilation for Xeon Phi (KNC) has been tested with ICC 15 and ICC 16.
  Compilation for Haswell (AVX2) has been tested with ICC 15, ICC 16, GCC 4.9 and GCC 5.1.
  When compiling for KNC with ICC, we use the -mmic flag.
  All data are uniform random using the rand.c and rand.h files.

****************************************

Files:
  avx_phi_selection_scan.c

Compile:
  icc/gcc -mmic/-march=core-avx2 -o exe avx_phi_selection_scan.c rand.c -lpthread -lrt

Description:
  Selection scan using the C1 <= key <= C2 predicate (Figure 5).
  Both input and output use 32-bit keys and payloads.

Arguments:
  1) number of tuples

****************************************

Files:
  avx_phi_probe_cuckoo.c
  avx_phi_probe_linear.c
  avx_phi_probe_double.c

Compile:
  icc/gcc -mmic/-march=core-avx2 -o exe avx_phi_probe_{cuckoo,linear,double}.c inner_outer.c rand.c -lpthread -lrt

Description:
  Hash table probing using three algorithms (Figures 6 and 7).
  The read-only hash table is shared across all threads.
  The hash table stores 32-bit keys and payloads.
  The probing input has 32-bit keys and the probing
  output has the 32-bit payloads of the matching keys.
  All keys inserted in the hash table are unique.
  The helper files inner_outer.c and inner_outer.h
  are used to generate the input data.

Arguments:
  1) logarithm of hash table size in bytes
  2) number of tuples probed against the hash table
  3) probing selectivity for ratio of matching keys
  4) hash table load factor

****************************************

Files:
  phi_build_probe_linear.c
  phi_build_probe_double.c
  phi_build_probe_cuckoo.c

Macros:
  _UNIQUE

Compile:
  icc -mmic -o exe phi_build_probe_{linear,double,cuckoo}.c rand.c -lpthread -lrt [-D_UNIQUE]

Description:
  Iterative building and probing of hash tables (Figures 8 and 9).
  Each thread iteratively builds and probes hash tables.
  If _UNIQUE is enabled, linear and double hashing assume 0/1 matches
  instead of 0/N matches. Cuckoo hashing only supports 0/1 matches.
  Both the input and the output is 32-bit keys and payloads.
  The last argument is meaningfull only for 0/N matches.

Arguments:
  1) number of threads
  2) number of total tuples in gigabytes.
  3) number of outer (probing)  tuples per hash table
  4) number of inner (building) tuples per hash table
  5) selectivity for ratio of matching keys
  6) load factor of hash tables
  7) number of distinct outer tuples per hash table
  8) number of distinct inner tuples per hash table

****************************************

Files:
  avx_phi_probe_bloom.c

Compile:
  icc/gcc -mmic/-march=core-avx2 -o exe avx_phi_probe_bloom.c rand.c -lpthread -lrt

Description:
  Bloom filter probing using 32-bit keys and payloads (Figure 10).

Arguments:
  1) logarithm of Bloom filter size in bits
  2) bits per item inserted in the Bloom filter
  3) number of hash functions (parameter k)
  4) selectivity of the Bloom filter probing
  5) number of tuples probed against the Bloom filter

****************************************

Files:
  phi_partition_radix.c
  phi_partition_hash.c

Compile:
  icc -mmic -o exe phi_partition_{radix,hash}.c rand.c -lpthread -lrt

Description:
  Histogram generation and shuffling (Figures 11 and 13).
  The inputs and outputs are 32-bit keys and payloads.
  For buffered shuffling, radix is stable and hash is unstable.

Arguments:
  1) number of threads
  2) input size in gigabytes

****************************************

Files:
  avx_phi_range_function.c

Compile:
  icc/gcc -mmic/-march=core-avx2 -o exe avx_phi_range.c rand.c -lpthread -lrt

Description:
  Range functions with binary search and range index (Figure 12).
  On KNC, the range index has 1 to 3 levels with fanout 17.
  On MIC, the range index has 1 to 4 levels with fanout 9.

Arguments:
  1) input size in gigabytes

****************************************

Files:
  phi_radixsort_key.c
  phi_radixsort_key_val.c

Macros:
  _NO_BUFFER
  _NO_VECTOR

Compile:
  icc -mmic -o exe phi_radixsort_{key,key_val}.c -lpthread -lrt [-D_NO_BUFFER] [-D_NO_VECTOR]

Description:
  LSB radixsort for 32-bit keys only and 32-bit keys and rids (Figures 14 and 16).
  The _NO_VECTOR macro disables vectorization and the _NO_BUFFER macro
  disables buffering during data shuffling.

Arguments:
  1) number of input tuples in millions
  2) number of threads

****************************************

Files:
  phi_hash_join_no_part
  phi_hash_join_min_part
  phi_hash_join_max_part

Macros:
  _NO_VECTOR
  _NO_VECTOR_HASHING
  _NO_VECTOR_PARTIITIONING

Compile:
  icc -mmic -o exe phi_hash_join_{no,min,max}_part.c -lpthread -lrt [-D_NO_VECTOR]
      [-D_NO_VECTOR_HASHING] [-D_NO_VECTOR_PARTITIONING]

Description:
  Hash join using different degrees of partitioning (Figures 15 and 16).
  The _NO_VECTOR_HASHING macro disables vectorization for the hashing
  step (building and probing) and the _NO_VECTOR_PARTITIONING macro
  disables vectorization during partitioning. The _NO_VECTOR macro
  disables both (supersedes the other macros).
