hpx icon indicating copy to clipboard operation
hpx copied to clipboard

restricting the number of threads in an application

Open tsung-wei-huang opened this issue 5 years ago • 6 comments

How can I restrict the number of threads to run by an hpx application?

tsung-wei-huang avatar Mar 30 '20 19:03 tsung-wei-huang

@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 avatar Mar 30 '20 19:03 hkaiser

@hkaiser is there any way I can do this through environment variable?

tsung-wei-huang avatar Mar 30 '20 19:03 tsung-wei-huang

@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.

hkaiser avatar Mar 30 '20 20:03 hkaiser

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.

msimberg avatar Apr 23 '20 15:04 msimberg

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.

hkaiser avatar Apr 23 '20 15:04 hkaiser

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.

stale[bot] avatar Jan 03 '21 06:01 stale[bot]