gem/oq-engine — pull request #1072 by larsbutler (2013-03-06 11:25:54+00:00)
Title: Don't save hazard curves to the DB which are all zeros

Related to: https://bugs.launchpad.net/openquake/+bug/1096926

Optimization: Don't bother updating `hazard_curve_progress` records when the
result matrix contains all zeros.

This is slightly tangential to the original idea described in the bug above. I prototyped some code for doing what the bug requests, but we're already doing this filter inside of the task, and doing this during pre-execution doesn't really give us any advantage. In fact, it's slower and more complicated.

Regardless, the primary goal of this task is to avoid wasted work where the region of interest is too far away from a given set of sources (for a task), and simply not saving curves of all zeros solves the problem. Admittedly, there is still some messaging overhead for creating and managing the tasks, but this overhead is so small and we shouldn't be concerned about it at this point.