restricting the number of threads in an application
How can I restrict the number of threads to run by an hpx application?
@tsung-wei-huang if you refer to the number of cores to run your HPX application on, then you can pass the --hpx:threads=N command line option, where N is the number of cores to use. In general you might want to read about the various command line options any HPX application supports here: https://stellar-group.github.io/hpx-docs/latest/html/manual/launching_and_configuring_hpx_applications.html#commandline.
@hkaiser is there any way I can do this through environment variable?
@hkaiser is there any way I can do this through environment variable?
Unfortunately, this can't be controlled through an environment variable, ATM. But we could easily add this functionality, if needed. Not sure of how much use that would be for you.
I'm not sure if we want to have more ways of setting the number of threads, but doesn't the configuration system already allow customizing things through environment variables? Having HPX_NUM_THREADS work as an environment variable looks like it would be a one-line change.
I'm not sure if we want to have more ways of setting the number of threads, but doesn't the configuration system already allow customizing things through environment variables? Having HPX_NUM_THREADS work as an environment variable looks like it would be a one-line change.
Yes, that's what I was thinking. This changes the base-line default only however. We try to figure out how many cores to use through many different means, so I'm not sure if the base-line default value is actually used in the end. This needs some investigation.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.