Skip to content

Commit

Permalink
baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryidk committed Mar 15, 2024
1 parent 729eee5 commit 42672ba
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 230 deletions.
4 changes: 4 additions & 0 deletions include/tests/KmerTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class KmerTest {
void count_kmer_radix_partition_global(Shard* sh, const Configuration& config,
std::barrier<VoidFn>* barrier,
RadixContext* context, BaseHashTable* ht);

void count_kmer_baseline(Shard* sh, const Configuration& config,
std::barrier<VoidFn>* barrier,
BaseHashTable* ht);
};

} // namespace kmercounter
Expand Down
5 changes: 5 additions & 0 deletions include/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ typedef enum {
RW_RATIO = 12,
HASHJOIN = 13,
FASTQ_WITH_INSERT_RADIX = 14,
BASELINE = 15,
} run_mode_t;

// XXX: If you add/modify a mode, update the `ht_type_strings` in
Expand Down Expand Up @@ -355,6 +356,10 @@ struct Configuration {
// controls distribution of threads across numa nodes
uint32_t numa_split;

//baseline
uint32_t data_size;
uint32_t workload_size;

// hashtable configuration
// different hashtable types
uint32_t ht_type;
Expand Down
66 changes: 34 additions & 32 deletions jerry-benchmark.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

GENOME="fvesca"
LOG_DIR=./log
LOG_DIR=.
DATASET_DIR=/opt/dramhit/kmer_dataset
declare -A DATASET_ARRAY
DATASET_ARRAY["dmela"]=${DATASET_DIR}/ERR4846928.fastq
Expand All @@ -19,10 +19,35 @@ function command_regular()
--mode 4 \
--ht-type 3 \
--numa-split 1 \
--num-threads $2 \
--num-threads 64 \
--ht-size $HT_SIZE \
--in-file $FASTA_FILE \
--k $1 > $LOG_DIR/kmer_k${1}.log
--k 10 > $LOG_DIR/kmer_k${1}.log
}

function command_baseline()
{
sudo ./build/dramhit \
--mode 15 \
--ht-type 3 \
--numa-split 1 \
--num-threads 1 \
--ht-size $1 \
--datasize $2 \
--workload $3 > logs/baseline_d${2}_ht${1}.log
}


function bench_baseline()
{
#ht=300
#d=100
w=100000
for (( i=5; i<=25; i+=1 )); do
d=$((1<<i))
ht=$((1*d))
command_baseline $ht $d $w
done
}

function command_radix()
Expand All @@ -31,7 +56,6 @@ function command_radix()
--mode 14 \
--ht-type 3 \
--numa-split 1 \
--hw-pref on \
--num-threads $3 \
--ht-size ${HT_SIZE} \
--in-file ${FASTA_FILE} \
Expand All @@ -41,46 +65,24 @@ function command_radix()
function bench_radix()
{
echo ">>> Input File: ${FASTA_FILE} Hashtable Size: ${HT_SIZE}"
t=64 # thread number
t=1 # thread number
k=15
for d in $(seq 6 6); do
for d in $(seq 10 10); do
echo "-> Starting to run with d ${d} k ${k}"
command_radix $k $d $t
done
}

function debug()
{
sudo gdb --args \
./build/dramhit \
"--mode" "14" \
"--k" "6" \
"--d" "2" \
"--ht-type" "3" \
"--numa-split" "1" \
"--num-threads" "1" \
"--ht-size" "100" \
"--in-file" $DATASET_ARRAY[$ACTIVE_DATASET]
sudo gdb --args ./build/dramhit --mode 15 --ht-type 3 --numa-split 1 --num-threads 1 --ht-size 300 --datasize 100 --workload 10000
}

# perf report
function perf()
{
sudo perf record \
-e cache-misses, cycles, faults \
./build/dramhit \
--mode 14 \
--ht-type 3 \
--numa-split 1 \
--num-threads 64 \
--ht-size $HT_SIZE \
--in-file $FASTA_FILE \
--k 8 --d 8
}

function bench() {
bench_radix
#bench_regular
#bench_radix
#command_regular
bench_baseline
}

function build() {
Expand Down
27 changes: 20 additions & 7 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ void Application::shard_thread(int tid,

switch (config.mode) {
case FASTQ_WITH_INSERT:
kmer_ht = init_ht(config.ht_size, sh->shard_idx);
break;
case BASELINE:
case FASTQ_WITH_INSERT_RADIX:
kmer_ht = init_ht(config.ht_size, sh->shard_idx);
break;
Expand Down Expand Up @@ -242,6 +241,9 @@ void Application::shard_thread(int tid,
case FASTQ_WITH_INSERT:
this->test.kmer.count_kmer(sh, config, kmer_ht, barrier);
break;
case BASELINE:
this->test.kmer.count_kmer_baseline(sh, config, barrier, kmer_ht);
break;
default:
break;
}
Expand All @@ -258,7 +260,7 @@ void Application::shard_thread(int tid,
// kmer_ht->print_to_file(outfile);
// }

free_ht(kmer_ht);
// free_ht(kmer_ht);

done:
--num_entered;
Expand All @@ -278,7 +280,7 @@ int Application::spawn_shard_threads() {

if ((config.mode != SYNTH) && (config.mode != ZIPFIAN) &&
(config.mode != PREFETCH) && (config.mode != CACHE_MISS) &&
(config.mode != RW_RATIO) && (config.mode != HASHJOIN)) {
(config.mode != RW_RATIO) && (config.mode != HASHJOIN) && (config.mode != BASELINE)) {
config.in_file_sz = get_file_size(config.in_file.c_str());
PLOG_INFO.printf("File size: %" PRIu64 " bytes", config.in_file_sz);
seg_sz = config.in_file_sz / config.num_threads;
Expand Down Expand Up @@ -400,7 +402,8 @@ int Application::process(int argc, char *argv[]) {
"11: Zipfian non-bqueue test\n"
"12: RW-ratio test\n"
"13: Hashjoin\n"
"14: Fastq insert with Radix Parition")("base",
"14: Fastq insert with Radix Parition\n"
"15: BaseLine")("base",
po::value<uint64_t>(&config.kmer_create_data_base)
->default_value(def.kmer_create_data_base),
"Number of base K-mers")(
Expand Down Expand Up @@ -503,7 +506,15 @@ int Application::process(int argc, char *argv[]) {
"Enable R/W tests for queues tests")(
"pollute-ratio",
po::value(&config.pollute_ratio)->default_value(def.pollute_ratio),
"Ratio of pollution events to ops (>1)");
"Ratio of pollution events to ops (>1)")
(
"workload",
po::value<uint32_t>(&config.workload_size)->default_value(10000),
"Baseline workload size")
(
"datasize",
po::value<uint32_t>(&config.data_size)->default_value(100),
"Baseline data size");

papi_init();

Expand Down Expand Up @@ -586,6 +597,8 @@ int Application::process(int argc, char *argv[]) {
// config.ht_fill;
}
PLOGI.printf("Setting ht size to %llu for hashjoin test", config.ht_size);
}else if(config.mode == BASELINE)
{
}

switch (config.ht_type) {
Expand Down Expand Up @@ -641,7 +654,7 @@ int Application::process(int argc, char *argv[]) {
bq_load = BQUEUE_LOAD::HtInsert;
}

if ((config.mode == BQ_TESTS_YES_BQ) ||
if ((config.mode == BASELINE) ||(config.mode == BQ_TESTS_YES_BQ) ||
((config.mode == FASTQ_WITH_INSERT ||
(config.mode == FASTQ_WITH_INSERT_RADIX)) &&
(config.ht_type == PARTITIONED_HT))) {
Expand Down
Loading

0 comments on commit 42672ba

Please sign in to comment.