How can I specify the number of system cores to use for computationally intensive functions?
Several computationally intensive functions in Sherpa are parallelized to make use of multi-core systems. The number of cores to use when these commands are run may be specified using either of the following two options:
Setting 'numcores' when the individual command is run:
sherpa> set_conf_opt('numcores', 2) sherpa> conf() sherpa> plot_energy_flux(numcores=2)
The "numcores" argument of each of the parallelized commands is available for specifying the number of cores which should be utilized when these commands are run; the default is to use all cores available. Note that the conf and proj commands do not explicitly use a "numcores" argument like the rest of the commands; the "numcores" option of set_conf_opt and set_proj_opt should be used.
Setting 'numcores' in the Sherpa ~/.sherpa.rc customization file:
[parallel] numcores: 3
In order to specify the default number of cores to use each time a parallelized command is run, you can add a "parallel" section to the ~/.sherpa.rc file and set the desired 'numcores' value there. Note that the default setting in this file may be overridden at the Sherpa command line.
- conf
- proj
- int_proj
- int_unc
- get_int_proj
- get_int_unc
- reg_proj
- reg_unc
- get_reg_proj
- get_reg_unc
- plot_photon_flux
- plot_energy_flux
- get_photon_flux_hist
- get_energy_flux_hist