diff --git a/.gitignore b/.gitignore index edca7c8..4e1b0f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ **/out +**/dpu-out **/build +.vscode/* +Datasets/const-seq/* +Datasets/var-seq/* +Datasets/bin/* \ No newline at end of file diff --git a/Datasets/generatedata.sh b/Datasets/generatedata.sh new file mode 100755 index 0000000..44336ee --- /dev/null +++ b/Datasets/generatedata.sh @@ -0,0 +1,17 @@ +#! /usr/bin/bash + +# make sure Datasets/bin/generate_dataset exists (https://github.com/smarco/WFA) + +set -x + +seqLengths=("100" "1000" "5000" "10000" "20000" "25000" "50000" "100000") + +for seqLength in ${seqLengths[@]}; do + ./bin/generate_dataset --n 100000 -l $seqLength --e 0.01 --o ./const-seq/seq-l$seqLength-e1-100KPairs +done + +for seqLength in ${seqLengths[@]}; do + ./bin/generate_dataset --n 100000 -l $seqLength --e 0.05 --o ./const-seq/seq-l$seqLength-e5-100KPairs +done + +echo "finished generating data" diff --git a/WFA/DPU-MRAM/dpu/wfa.c b/WFA/DPU-MRAM/dpu/wfa.c index afe92f8..4e53e0c 100644 --- a/WFA/DPU-MRAM/dpu/wfa.c +++ b/WFA/DPU-MRAM/dpu/wfa.c @@ -140,16 +140,22 @@ void affine_wfa_reduce_wvs(wfa_component *wfa, awf_offset_t pattern_length, awf_ } } // insert new score +// change this function so it allocates using score % needed +// EDIT THIS FUNCTION!!!! wfa_component *allocate_new_score(dpu_alloc_wram_t *allocator, int score, int lo, int hi, int kernel, uint32_t *mramIdx, dpu_alloc_mram_t *dpu_alloc_mram) { int wv_len = hi - lo + 1; uint32_t cmpnt_size = 0; +// these two lines show that the size of the wfa_cmpnt is constant, but the size of the wfa cmpnt's offsets is not constant. wfa_component *wfa_cmpnt = (wfa_component *)allocate_new(allocator, sizeof(wfa_component)); awf_offset_t *offset_ptr = (awf_offset_t *)allocate_new(allocator, (wv_len * sizeof(awf_offset_t))); wfa_cmpnt->mwavefront = (awf_offset_t *)(offset_ptr - lo); cmpnt_size += ROUND_UP_MULTIPLE_8(wv_len * sizeof(awf_offset_t)); + // kernel = 3 means I and D + // kernel = 2 means I + // kernel = 1 means D if (kernel == 3 || kernel == 1) { @@ -281,6 +287,7 @@ wfa_component *affine_wfa_compute_next(int score, uint32_t *mramIdx, dpu_alloc_w int o_score = score - GAP_O - GAP_E; int e_score = score - GAP_E; +// edit here so it computes differently and loads mwaefront from score % something wfa_component *wfa_mismatch = (mismatch_score < 0 || mramIdx[mismatch_score] == 0) ? NULL : load_mwavefront_cmpnt_from_mram(alloc_obj, mramIdx[mismatch_score]); wfa_component *wfa_o_score = (o_score < 0 || mramIdx[o_score] == 0) ? NULL : load_mwavefront_cmpnt_from_mram(alloc_obj, mramIdx[o_score]); wfa_component *wfa_e_score = (e_score < 0 || mramIdx[e_score] == 0) ? NULL : load_idwavefront_cmpnt_from_mram(alloc_obj, mramIdx[e_score]); diff --git a/WFA/DPU-MRAM/host/host.c b/WFA/DPU-MRAM/host/host.c index 3d3526d..e04f572 100644 --- a/WFA/DPU-MRAM/host/host.c +++ b/WFA/DPU-MRAM/host/host.c @@ -338,13 +338,13 @@ int main(int argc, char *argv[]) for (i = 0; i < dpuParams[dpu].dpuNumReads; ++i) { fprintf(output_file, "%d, %d, \n", dpuResults[dpu][i].idx, dpuResults[dpu][i].score); + +#ifdef BACKTRACE edit_cigar_t cigar; cigar.score = dpuResults[dpu][i].score; cigar.max_operations = dpuResults[dpu][i].max_operations; cigar.begin_offset = dpuResults[dpu][i].begin_offset; cigar.end_offset = dpuResults[dpu][i].end_offset; - -#ifdef BACKTRACE cigar.operations = (char *)malloc(ROUND_UP_MULTIPLE_8(cigar.max_operations)); strncpy(cigar.operations, &(operations[i * 2 * READ_SIZE]), ROUND_UP_MULTIPLE_8(cigar.max_operations)); edit_cigar_print(&cigar, output_file);