Skip to content

Conversation

@xvallspl
Copy link
Contributor

@xvallspl xvallspl commented Sep 19, 2017

...refactoring the old way of obtaining it.

Just for convenience.

pcanal
pcanal previously requested changes Sep 19, 2017
UInt_t GetImplicitMTPoolSize();

/// Get the number of system CPUs.
UInt_t GetNCPUs();
Copy link
Member

Choose a reason for hiding this comment

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

(Especially since) this is not configurable, this routine belongs in TSystem. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, ubuntu14/native with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@dpiparo
Copy link
Member

dpiparo commented Sep 19, 2017

Hi @xvallspl , what problem is this change solving?

@xvallspl
Copy link
Contributor Author

xvallspl commented Sep 19, 2017

It's a proposal, totally open to discussion.

I found myself in need of this piece of code several times and I always thought it would be cool to have it as a single call instead of having to remember those three lines.

You can see it a nicer and useful way for writing nCPUs dependent, processor-agnostic code. I would say it's better than replicating the current process of getting the number of CPUs all over the place.

This function will be helpful when parallelizing without IMT/tbb, where you may still be in need of knowing the number of threads you can use.

...refactoring the old way of obtaining it.
@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, ubuntu14/native with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@xvallspl
Copy link
Contributor Author

Moved it to TSystem.

@xvallspl
Copy link
Contributor Author

Just remembered std::thread::hardware_concurrency. Closing the PR.

@xvallspl xvallspl closed this Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants