Skip to content

Commit

Permalink
feat: fix sorting
Browse files Browse the repository at this point in the history
"Aborted (core dumped)"
  • Loading branch information
JonasKellerer committed Jul 26, 2023
1 parent e75a925 commit 1ed18ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/silo/prepare_dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ std::unordered_map<std::string, silo::common::Date> sortMetadataFile(
silo::common::Date date;
};
std::vector<RowWithDate> rows;
rows.reserve(chunk.size);

for (auto& row : metadata_reader.reader) {
std::this_thread::sleep_for(std::chrono::nanoseconds(1));
const auto primary_key = row[sort_chunk_config.primary_key_name].get();
const auto date_str = row[sort_chunk_config.date_column_to_sort_by].get();

const silo::common::Date date = silo::common::stringToDate(date_str);

rows.push_back({row, date});
rows.emplace_back(row, date);

primary_key_to_date[primary_key] = date;
}
Expand Down
3 changes: 1 addition & 2 deletions src/silo/preprocessing/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,12 @@ void Chunk::addChunk(Chunk&& other) {
count_of_sequences += other.count_of_sequences;

auto copy_of_my_lineages = std::move(pango_lineages);
pango_lineages.clear();
std::merge(
copy_of_my_lineages.begin(),
copy_of_my_lineages.end(),
other.pango_lineages.begin(),
other.pango_lineages.end(),
pango_lineages.begin()
std::back_inserter(pango_lineages)
);
}

Expand Down

0 comments on commit 1ed18ae

Please sign in to comment.