gem/oq-engine — pull request #1149 by micheles (2013-04-20 14:40:15+00:00)
Title: Replaced run_job_sp with run_hazard_job

run_job_sp is a remnant of the past. It was used only in the tests and only in a couple of places. run_hazard_job is a much better solution since it does not run a job in an external process and so 1) it is much faster, 2) it is much easier to debug. The use of run_job_sp was at the origin of https://bugs.launchpad.net/openquake/+bug/1153512

FYI: replacing run_job_sp with run_hazard_job the execution time of tests/calculators/hazard/general_test.py went from 114s to 40s (nearly 1/3! the startup time was very significant).

When debugging, one should replace helpers.run_hazard_job(cfg, distribute=True)
with helpers.run_hazard_job(cfg, distribute=False), then it is possible to use pdb.
A possible improvement could be to use the OQ_NO_DISTRIBUTE variable instead.
What do you think? It would be easier to use and consistent with the rest of the code.