Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Addressed suggested changes
  • Loading branch information
xvallspl committed Jul 13, 2017
commit 082b406247f8d9b4606e8bfbfc25c181085f9ab2
11 changes: 5 additions & 6 deletions core/base/src/TROOT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -578,19 +578,18 @@ namespace Internal {
}

////////////////////////////////////////////////////////////////////////////////
/// Returns the maximum number of threads the user can instantiate.
UInt_t GetAvailableThreads()
/// Returns the number of concurrent threads supported by the implementation.
/// In the IMT case returns the number of logical CPUs available to the current process in accordance with its TBB affinity mask.
UInt_t GetNThreadsAvailable()
{
#ifdef R__USE_IMT
static UInt_t (*sym)() = (UInt_t(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_GetAvailableThreads");
static UInt_t (*sym)() = (UInt_t(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_GetNThreadsAvailable");
if (sym)
return sym();
else
return 0;
#else
SysInfo_t s;
gSystem->GetSysInfo(&s);
return s.fCpus;
return std::thread::hardware_concurrency();
#endif
}
}
Expand Down
6 changes: 3 additions & 3 deletions core/imt/inc/ROOT/TPoolManager.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ namespace ROOT {
std::shared_ptr<TPoolManager> GetPoolManager(UInt_t nThreads = 0);


/// Get the maximum number of logical CPUs available.
/// In case of having an affinity mask (TBB), return the logical CPU available to the current process in accordance with it.
Int_t GetMaxNThreadsAvailable();
/// Get the number of logical CPUs in the system.
/// In case of having an affinity mask (TBB), return the number of logical CPUs available to the current process in accordance with it.
Int_t GetNThreadsAvailable();
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/imt/src/TImplicitMT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ extern "C" UInt_t ROOT_TImplicitMT_GetImplicitMTPoolSize()
return ROOT::Internal::TPoolManager::GetPoolSize();
};

extern "C" UInt_t ROOT_TImplicitMT_GetAvailableThreads()
extern "C" UInt_t ROOT_TImplicitMT_GetNThreadsAvailable()
{
return ROOT::Internal::GetMaxNThreadsAvailable();
return ROOT::Internal::GetNThreadsAvailable();
};

extern "C" void ROOT_TImplicitMT_EnableParBranchProcessing()
Expand Down
2 changes: 1 addition & 1 deletion core/imt/src/TPoolManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace ROOT {
return GetWP().lock();
}

Int_t GetMaxNThreadsAvailable()
Int_t GetNThreadsAvailable()
{
return tbb::task_scheduler_init::default_num_threads();
}
Expand Down