I'm testing out parallelization using openMP on an 8-core Linux box. To build xspec to support openMP options requires the hmakerc to be edited to add -fopenmp to CFLAGS, FFLAGS, and CXXFLAGS and -lgomp to be added to F77LIBS4C (I added it immediately before -lgfortran).
First test is in sumape.f to parallelize over the individual elements when interpolating the continuum and pseudo-continuum...
C$OMP PARALLEL PRIVATE(ien,limdown,limup,ihigh,energy)
C$OMP DO SCHEDULE(DYNAMIC)
DO ielt = 1, nmelt
C$OMP END DO
C$OMP END PARALLEL
The variables defined as private are to avoid threads overwriting variables being set and used by other threads.
Timing tests show that parallelization doesn't win enough in this case. Including the parallel directives slows a newpar down from 0.02 seconds to 0.4 seconds due to the overhead.