Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
**/out
**/dpu-out
**/build
.vscode/*
Datasets/const-seq/*
Datasets/var-seq/*
Datasets/bin/*
17 changes: 17 additions & 0 deletions Datasets/generatedata.sh
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 7 additions & 0 deletions WFA/DPU-MRAM/dpu/wfa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down Expand Up @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions WFA/DPU-MRAM/host/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down