How to use the oasislmf.model_execution.bash.genbash function in oasislmf

To help you get started, we’ve selected a few oasislmf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OasisLMF / OasisPlatform / src / model_execution_worker / supplier_model_runner.py View on Github external
def run(analysis_settings, number_of_processes=-1):
    if number_of_processes == -1:
        number_of_processes = multiprocessing.cpu_count()

    genbash(number_of_processes, analysis_settings, 'run_ktools.sh')
    try:
        subprocess.check_call(['bash', 'run_ktools.sh'])
    except subprocess.CalledProcessError as e:
        raise OasisException('Error running ktools: {}'.format(e.stderr))