Skip to content

Commit

Permalink
Default shared memory execution (instead of distributed)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaasna committed Sep 4, 2023
1 parent 41ae52d commit 1844930
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion include/valik/shared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct search_arguments final : public minimiser_threshold_arguments, public ste
std::filesystem::path ref_meta_path{};
std::filesystem::path ref_seg_path{};
std::filesystem::path query_seg_path{};
bool shared_memory{false};
bool distribute{false};

};

Expand Down
6 changes: 3 additions & 3 deletions src/argument_parsing/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ void init_search_parser(sharg::parser & parser, search_arguments & arguments)
.long_id = "query-meta",
.description = "Path to query genome metadata for finding all local alignment between two long sequences.",
.validator = sharg::input_file_validator{}});
parser.add_flag(arguments.shared_memory,
parser.add_flag(arguments.distribute,
sharg::config{.short_id = '\0',
.long_id = "shared-memory",
.description = "Launch Stellar instances on a single machine with shared memory."});
.long_id = "distribute",
.description = "Launch parallel Stellar instances each of them with independent memory."});
parser.add_option(arguments.threads,
sharg::config{.short_id = '\0',
.long_id = "threads",
Expand Down
6 changes: 3 additions & 3 deletions src/valik_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ void valik_search(search_arguments const & arguments)
}

bool failed;
if (arguments.shared_memory)
if (arguments.distribute)
failed = search_distributed(arguments, time_statistics, index);
else
{
if (arguments.query_seg_path.empty())
failed = search_local<false>(arguments, time_statistics, index);
else
failed = search_local<true>(arguments, time_statistics, index);
}
else
failed = search_distributed(arguments, time_statistics, index);

if (arguments.write_time)
write_time_statistics(time_statistics, arguments.out_file.string() + ".time");
Expand Down
3 changes: 0 additions & 3 deletions test/cli/dream_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ TEST_P(dream_short_search, short_shared_mem)
"--output ", index_path);

cli_test_result const result = execute_app("valik", "search",
"--shared-memory",
"--output search.gff",
"--pattern 50",
"--overlap 49",
Expand Down Expand Up @@ -81,7 +80,6 @@ TEST_F(dream_short_search, no_matches)
"--output ", ibf_path(number_of_bins, window_size));

cli_test_result const result = execute_app("valik", "search",
"--shared-memory",
"--output search.gff",
"--pattern 50",
"--overlap 49",
Expand Down Expand Up @@ -137,7 +135,6 @@ TEST_P(dream_split_search, split_shared_mem)
"--output ", index_path);

cli_test_result const search = execute_app("valik", "search",
"--shared-memory",
"--output search.gff",
"--pattern 50",
"--overlap 49",
Expand Down
2 changes: 2 additions & 0 deletions test/cli/valik_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ TEST_P(valik_search_clusters, search)

cli_test_result const result = execute_app("valik", "search",
"--output search.gff",
"--distribute",
"--pattern", std::to_string(pattern_size),
"--overlap", std::to_string(overlap),
"--error ", std::to_string(number_of_errors),
Expand Down Expand Up @@ -196,6 +197,7 @@ TEST_P(valik_search_segments, search)

cli_test_result const result = execute_app("valik", "search",
"--output search.gff",
"--distribute",
"--pattern", std::to_string(pattern_size),
"--overlap", std::to_string(overlap),
"--error ", std::to_string(number_of_errors),
Expand Down
6 changes: 0 additions & 6 deletions test/data/datasources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ include (cmake/app_datasources.cmake)
declare_datasource (FILE database.fasta
URL ${CMAKE_SOURCE_DIR}/test/data/split/database.fasta
URL_HASH SHA256=7c7a8fcdd52a932cda76219f24024c1624292377103d9fd5a55abd288c6072be)
declare_datasource (FILE single_query.fasta
URL ${CMAKE_SOURCE_DIR}/test/data/split/single_query.fasta
URL_HASH SHA256=38cfe9dfc5c452002553225fba211569aaa974eb8c38145b890195f59a074773)
declare_datasource (FILE single_query.fq
URL ${CMAKE_SOURCE_DIR}/test/data/split/single_query.fq
URL_HASH SHA256=6f6837a3313b8288a1cffa1091329cf797ef72e2501c13e2b7dbd285a63a193b)
declare_datasource (FILE single_reference_B.fasta
URL ${CMAKE_SOURCE_DIR}/test/data/split/single_reference_B.fasta
URL_HASH SHA256=fd75ba89825ff869a6b14d1a1fe9013baf0225c763cf66cf186b20b8dedfbf8b)
declare_datasource (FILE single_reference.fasta
URL ${CMAKE_SOURCE_DIR}/test/data/split/single_reference.fasta
URL_HASH SHA256=53d633474b01a68927d3ab1fd970b200e96403bb1fdcc53feb0367a2093be273)
Expand Down
4 changes: 2 additions & 2 deletions test/data/dream/cli_test_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ do
dist_out=$b"bins"$w"window"$e"error.gff"
dist_consolidated="consolidated"$b"bins"$w"window"$e"error.gff"
#local_out="local"$b"bins"$w"window"$e"error.gff"
valik search --index "$index" --query "$query" --output "$dist_out" --error "$e" --pattern "$pattern" --overlap "$pat_overlap" --ref-meta "$ref_meta" --seg-meta "$seg_meta"
valik search --distribute --index "$index" --query "$query" --output "$dist_out" --error "$e" --pattern "$pattern" --overlap "$pat_overlap" --ref-meta "$ref_meta" --seg-meta "$seg_meta"
valik consolidate --input "$dist_out" --output "$dist_consolidated" --ref-meta "$ref_meta"
#valik search --shared-memory --index "$index" --query "$query" --output "$local_out" --error "$e" --pattern "$pattern" --overlap "$pat_overlap" --ref-meta "$ref_meta" --seg-meta "$seg_meta"
#valik search --index "$index" --query "$query" --output "$local_out" --error "$e" --pattern "$pattern" --overlap "$pat_overlap" --ref-meta "$ref_meta" --seg-meta "$seg_meta"
done

rm $VALIK_TMP/*
Expand Down
2 changes: 1 addition & 1 deletion test/data/search/cli_test_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ do
echo "Searching the IBF (w=$w, k=19) for an approximate local match of length $p with $e error(s)"
echo "Potential matches overlap by $o bp"
output="8bins"$w"window"$e"error"$p"pattern"$o"overlap.gff"
valik search --index ../build/8bins${w}window.ibf --query query.fq --output "$output" --error "$e" --pattern "$p" --overlap "$o" --tau "$tau" --p_max "$p_max" --threads 1
valik search --distribute --index ../build/8bins${w}window.ibf --query query.fq --output "$output" --error "$e" --pattern "$p" --overlap "$o" --tau "$tau" --p_max "$p_max" --threads 1
rm "$output"
done
done
Expand Down
2 changes: 1 addition & 1 deletion test/data/split/cli_test_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ do

echo "Searching IBF with $errors errors"
search_out="single/"$seg_overlap"overlap"$b"bins"$w"window"$errors"errors.gff"
valik search --index "$index" --query "$query" --output "$search_out" --error "$errors" --pattern "$pattern" --overlap "$pat_overlap" --tau "$tau" --p_max "$p_max" --ref-meta "$ref_meta" --seg-meta "$seg_meta" --threads 1
valik search --distribute --index "$index" --query "$query" --output "$search_out" --error "$errors" --pattern "$pattern" --overlap "$pat_overlap" --tau "$tau" --p_max "$p_max" --ref-meta "$ref_meta" --seg-meta "$seg_meta" --threads 1
rm "$search_out"
done
done
Expand Down

0 comments on commit 1844930

Please sign in to comment.