ert icon indicating copy to clipboard operation
ert copied to clipboard

QueueConfig from dict does not add job dispatch when not in user mode

Open eivindjahren opened this issue 2 years ago • 1 comments

The following test fails as loading QueueConfig from file with have job_script pointing at ert/bin/job_dispatch.py while for from dict it will be job.sh.

import os
from res.enkf import QueueConfig
from res.job_queue import QueueDriverEnum


def touch(filename):
    with open(filename, "w") as fh:
        fh.write(" ")

def test_fails(tmpdir):
    touch(tmpdir + "/job.sh")

    with open(tmpdir + "/test.ert", "w") as fh:
        fh.write(
            """
JOBNAME  Job%d
JOBSCRIPT  job.sh
NUM_CPU 1
MAX_SUBMIT 1
NUM_REALIZATIONS 1
QUEUE LSF
"""
        )
    assert QueueConfig(str(tmpdir + "/test.ert")) == QueueConfig(config_dict={
       ConfigKeys.JOB_SCRIPT: "job.sh",
       ConfigKeys.USER_MODE: False,
       ConfigKeys.MAX_SUBMIT: 1,
       ConfigKeys.NUM_CPU: 1,
       ConfigKeys.QUEUE_SYSTEM:  QueueDriverEnum.LSF_DRIVER,
       ConfigKeys.QUEUE_OPTION: []
    })

The test does not fail when setting ConfigKeys.USER_MODE: True.

eivindjahren avatar Dec 14 '21 09:12 eivindjahren

@oyvindeide might have info regarding this issue whenever it is picked up

oysteoh avatar Sep 01 '22 07:09 oysteoh