openquake.engine package


openquake.engine.engine module

Engine: A collection of fundamental functions for initializing and running calculations.

exception openquake.engine.engine.MasterKilled[source]

Bases: KeyboardInterrupt

Exception raised when a job is killed manually


Check if there is a newer version of the engine.

  • the calculation mode when called from the engine
  • an empty string when called from the WebUI
  • a message if the running version of the engine is obsolete
  • the empty string if the engine is updated
  • None if the check could not be performed (i.e. github is down)
openquake.engine.engine.expose_outputs(dstore, owner='jenkins', status='complete')[source]

Build a correspondence between the outputs in the datastore and the ones in the database.

Parameters:dstore – datastore
openquake.engine.engine.inhibitSigInt(signum, _stack)[source]
openquake.engine.engine.job_from_file(job_ini, job_id, username, **kw)[source]

Create a full job profile from a job config file.

  • job_ini – Path to a job.ini file
  • job_id – ID of the created job
  • username – The user who will own this job profile and all results
  • kw – Extra parameters including calculation_mode and exposure_file

an oqparam instance

openquake.engine.engine.manage_signals(signum, _stack)[source]

Convert a SIGTERM into a SystemExit exception and a SIGINT/SIGHUP into a MasterKilled exception with an appropriate error message.

  • signum (int) – the number of the received signal
  • _stack – the current frame object, ignored
openquake.engine.engine.poll_queue(job_id, pid, poll_time)[source]

Check the queue of executing/submitted jobs and exit when there is a free slot.

openquake.engine.engine.run_calc(job_id, oqparam, exports, hazard_calculation_id=None, **kw)[source]

Run a calculation.


returns: a triple of integers from a version tag

Module contents

OpenQuake is an open-source platform for the calculation of hazard and risk impact. It is a project of the Global Earthquake Model, and may be extended by other organizations to address additional classes of peril.

For more information, please see the website at This software may be downloaded at

The continuous integration server is at
Up-to-date sphinx documentation is at

This software is licensed under the AGPL license, for more details please see the LICENSE file.

Copyright (C) 2010-2020 GEM Foundation

OpenQuake is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

OpenQuake is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with OpenQuake. If not, see <>.