Skip to content

Commit b78aa90

Browse files
author
Qi Chen
committed
change printstep
1 parent 40a89d6 commit b78aa90

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Test/src/SPFreshTest.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ std::shared_ptr<VectorIndex> BuildIndex(const std::string &outDirectory, std::sh
9393
InPlace=true
9494
StartFileSizeGB=1
9595
OneClusterCutMax=false
96-
ConsistencyCheck=false
96+
ConsistencyCheck=true
9797
ChecksumCheck=false
9898
ChecksumInRead=false
9999
AsyncMergeInSearch=false
@@ -316,6 +316,7 @@ void InsertVectors(SPANN::Index<ValueType> *p_index, int insertThreads, int step
316316

317317
std::vector<std::thread> threads;
318318

319+
int printstep = step / 50;
319320
std::atomic_size_t vectorsSent(start);
320321
auto func = [&]() {
321322
size_t index = start;
@@ -324,7 +325,7 @@ void InsertVectors(SPANN::Index<ValueType> *p_index, int insertThreads, int step
324325
index = vectorsSent.fetch_add(1);
325326
if (index < start + step)
326327
{
327-
if ((index & ((1 << 5) - 1)) == 0)
328+
if ((index & (printstep - 1)) == 0)
328329
{
329330
SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Sent %.2lf%%...\n", index * 100.0 / step);
330331
}
@@ -646,14 +647,15 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c
646647
int startidx = iter * deleteBatchSize;
647648
std::atomic_size_t vectorsSent(startidx);
648649
int totaldeleted = startidx + deleteBatchSize;
650+
int printstep = deleteBatchSize / 50;
649651
auto func = [&]() {
650652
size_t idx = startidx;
651653
while (true)
652654
{
653655
idx = vectorsSent.fetch_add(1);
654656
if (idx < totaldeleted)
655657
{
656-
if ((idx & ((1 << 5) - 1)) == 0)
658+
if ((idx & (printstep - 1)) == 0)
657659
{
658660
SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Sent %.2lf%%...\n",
659661
(idx - startidx) * 100.0 / deleteBatchSize);

0 commit comments

Comments
 (0)