Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Simulation/Native/src/external/fused.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ class Fused
if (envNT == NULL) { // If the user didn't force the number of threads, make an intelligent guess
int nMaxThrds = std::thread::hardware_concurrency(); // Logical HW threads
if (nMaxThrds > 4) nMaxThrds/= 2; // Assume we have hyperthreading (no consistent/concise way to do this)
if (wfnCapacity < 1u << 20) {
if (wfnCapacity < 1ul << 14) nMaxThrds = 1;
else if (wfnCapacity < 1ul << 16) nMaxThrds = 2;
Copy link
Contributor

@rmshaffer rmshaffer Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor note: looks like this line would actually increase nMaxThrds from 1 to 2 if running on a single-core CPU? Is that the intent?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but I haven't seen a 1 CPU machine in a long time. Easy to add the check if desired.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you. As you say, this is probably a rare case in practice.

else if (wfnCapacity < 1ul << 20)
{
if (nMaxThrds > 8) nMaxThrds = 8; // Small problem, never use too many
else if (nMaxThrds > 3) nMaxThrds = 3; // Small problem on a small machine
}
Expand Down