Syntax: parallel <task> <max num of processes>
where <task> is currently limited to leven or error. For best results, it is recommended that you set <max num of processes> to the number of CPU cores on your machine. Set <max num processes> back to 1 to turn parallel processing off for the particular task. To display current settings, type ‘parallel’ with no arguments.
The leven option will spawn up to <max num> processes during the Levenberg-Marquardt fitting, specifically to perform the N independent calculations of the parameter first-order partial derivatives (N being the number of variable fit parameters). [This will not apply if the USE_NUMERICAL_DIFFERENTIATION variable in the user’s Xspec.init file is changed from the default ‘false’ to ‘true’.]
The speed-up that one can expect is highly dependent upon the model in use. For simpler models with quick calculation times, you will probably see little to no speed gain with parallel leven. But with multi-core CPUs, gains should be quite noticeable when the model calculation consumes a large fraction of the overall fitting time. For example, with fits using the time-intensive sedov model on a 4-core machine, we’ve typically seen about a 40% reduction in fit time compared with the single processing case.
The error option is for running parallel computations within XSPEC’s error command. This enables the error calculations for multiple parameters to be performed simultaneously. The speed-up here should simply be proportional to the number of cores available. However for cases where complications are reported (such as a new minimum found, or a non-monotonicity in the statistic space), it is recommended that you perform the error calculations in standard single-process mode.
If both parallel leven and error are in use, XSPEC will temporarily disable the lower-level leven parallelization when running the higher-level parallel error command calculations.
This first implementation of the parallel command (as part of XSPEC 12.8.0) is considered to be a beta release, and we look forward to hearing your comments and suggestions (as well as any bug reports). We plan to implement addition parallel usages within XSPEC in the near future.
XSPEC12> model cflow
// Using a model with 5 variable fit parameters.
XSPEC12> parallel leven 4
// Calculations for the 5 parameters will be divided amongst
// 4 processes during the fit.
XSPEC12> parallel leven 1
// Restores single-process calculation to the
// Levenberg-Marquardt algorithm.
XSPEC12> parallel error 3
// Allow up to 3 simultaneous ‘error’ parameter calculations
// to be performed in parallel.
XSPEC12> error 2 3 6
// Perform error calculations on parameters 2, 3, and 6 in parallel.
// Display current settings:
Maximum number of parallel processes: