Skip to content

Commit

Permalink
fix: divergence between mac and linux info test results, fix memory l…
Browse files Browse the repository at this point in the history
…eaks in Threshold.cpp
  • Loading branch information
Taepper committed Aug 3, 2023
1 parent b653753 commit ffcefd0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
20 changes: 10 additions & 10 deletions endToEndTests/test/info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('The /info endpoint', () => {
.get('/info')
.expect(200)
.expect('Content-Type', 'application/json')
.expect({ nBitmapsSize: 3898, sequenceCount: 100, totalSize: 60055044 })
.expect({ nBitmapsSize: 3898, sequenceCount: 100, totalSize: 60054981 })
.end(done);
});

Expand All @@ -26,15 +26,15 @@ describe('The /info endpoint', () => {
'bitmapContainerSizeStatistic'
);
expect(returnedInfo.bitmapContainerSizePerGenomeSection.bitmapContainerSizeStatistic).to.deep.equal({
numberOfArrayContainers: 43545,
numberOfArrayContainers: 43540,
numberOfBitsetContainers: 0,
numberOfRunContainers: 78,
numberOfValuesStoredInArrayContainers: 59694,
numberOfRunContainers: 83,
numberOfValuesStoredInArrayContainers: 59577,
numberOfValuesStoredInBitsetContainers: 0,
numberOfValuesStoredInRunContainers: 2237,
totalBitmapSizeArrayContainers: 119388,
numberOfValuesStoredInRunContainers: 2354,
totalBitmapSizeArrayContainers: 119154,
totalBitmapSizeBitsetContainers: 0,
totalBitmapSizeRunContainers: 2964,
totalBitmapSizeRunContainers: 3170,
});

expect(returnedInfo.bitmapContainerSizePerGenomeSection).to.have.property(
Expand Down Expand Up @@ -62,11 +62,11 @@ describe('The /info endpoint', () => {
expect(returnedInfo).to.have.property('bitmapSizePerSymbol');
expect(returnedInfo.bitmapSizePerSymbol).to.deep.equal({
'-': 6003470,
'A': 6112681,
'A': 6112653,
'B': 5980600,
'C': 6064603,
'C': 6064589,
'D': 5980600,
'G': 6067693,
'G': 6067672,
'H': 5980600,
'K': 5980630,
'M': 5980620,
Expand Down
12 changes: 6 additions & 6 deletions src/silo/database.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TEST(DatabaseTest, shouldReturnCorrectDatabaseInfo) {
const auto simple_info = database.getDatabaseInfo();

EXPECT_EQ(
detailed_info.bitmap_size_per_symbol.size_in_bytes.at(silo::NUCLEOTIDE_SYMBOL::A), 6112681
detailed_info.bitmap_size_per_symbol.size_in_bytes.at(silo::NUCLEOTIDE_SYMBOL::A), 6112653
);
EXPECT_EQ(
detailed_info.bitmap_size_per_symbol.size_in_bytes.at(silo::NUCLEOTIDE_SYMBOL::GAP), 6003470
Expand All @@ -54,7 +54,7 @@ TEST(DatabaseTest, shouldReturnCorrectDatabaseInfo) {
EXPECT_EQ(
detailed_info.bitmap_container_size_per_genome_section.bitmap_container_size_statistic
.number_of_values_stored_in_run_containers,
2237
2354
);
EXPECT_EQ(
detailed_info.bitmap_container_size_per_genome_section.bitmap_container_size_statistic
Expand All @@ -63,18 +63,18 @@ TEST(DatabaseTest, shouldReturnCorrectDatabaseInfo) {
);

EXPECT_EQ(
detailed_info.bitmap_container_size_per_genome_section.total_bitmap_size_computed, 96160390
detailed_info.bitmap_container_size_per_genome_section.total_bitmap_size_computed, 96160327
);
EXPECT_EQ(
detailed_info.bitmap_container_size_per_genome_section.total_bitmap_size_frozen, 48185111
detailed_info.bitmap_container_size_per_genome_section.total_bitmap_size_frozen, 48185073
);
EXPECT_EQ(
detailed_info.bitmap_container_size_per_genome_section.bitmap_container_size_statistic
.total_bitmap_size_array_containers,
119388
119154
);

EXPECT_EQ(simple_info.total_size, 60055044);
EXPECT_EQ(simple_info.total_size, 60054981);
EXPECT_EQ(simple_info.sequence_count, 100);
EXPECT_EQ(simple_info.n_bitmaps_size, 3898);
}
Expand Down
6 changes: 2 additions & 4 deletions src/silo/query_engine/operators/threshold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ OperatorResult Threshold::evaluate() const {
partition_bitmaps[j] |= partition_bitmaps[j - 1] - *bitmap;
}
if (k - i > n - 1) {
roaring::api::roaring_bitmap_or_inplace(
&partition_bitmaps[0].roaring,
roaring::api::roaring_bitmap_flip(&bitmap->roaring, 0, row_count)
);
bitmap->flip(0, row_count);
partition_bitmaps[0] |= *bitmap;
}
}
// NOLINTEND(readability-identifier-length)
Expand Down

0 comments on commit ffcefd0

Please sign in to comment.