Skip to content

Commit

Permalink
safely set number of cores
Browse files Browse the repository at this point in the history
  • Loading branch information
pachadotdev committed Nov 13, 2024
1 parent d895519 commit be017f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rpkg/src/redatamlib/readers/FuzzyVariableParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ void FuzzyVariableParser::ParseAllVariables(vector<Entity> &entities) {
}

size_t numThreads = std::min(entities.size(), maxThreads);

if (numThreads == 0) {
numThreads = 1;
}

size_t chunkSize = entities.size() / numThreads;

Expand Down

0 comments on commit be017f8

Please sign in to comment.