partial commit from cherry-pick 2f35c3d
partial commit from cherry-pick 2f35c3d


Former-commit-id: fea8f8f38fd5baf6d93e8ddc7f18c6827bd77988 [formerly 03811207c7d26cee4cd36a0b135d3e159e02eae7]
Former-commit-id: 97a2d635310fd0b72b69c284d09a5f2f21dad1f2
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine