equinor / equinor/ert

Discourage DEFINE NUM_CPU

Open
#13,784 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
161
Forks
140
Avg merge
2d 1h
Merged PRs (30d)
138

Description

It has been observed that some users have

`DEFINE 4`

in their Ert configs. This is probably a user error, done from good intentions to "set NUM_CPU".

But the users should instead do:

`NUM_CPU 4`.

Both ways makes it possible to substitute in the value 4 with the substitution pattern ``, and if
all you use this for is to supply a value 4 to some forward model, both will work. But the DEFINE way of doing it will not lead to 4 processors being booked on the cluster

Also, if you have both

```
DEFINE 8
NUM_CPU 4
```

then 4 CPUs will be booked in the cluster, and the value `` will be replaced by 8, not 4, so the second definition of NUM_CPU is being shadowed with no warning given.

Contributor guide

Open the contributing guide

Research direction

No file or test is named in the issue. Start by tracing ERT configuration parsing and the handling of DEFINE and NUM_CPU, then reproduce the two conflicting examples from the report. Done means DEFINE cannot silently shadow NUM_CPU, and the configuration clearly discourages or reports the incorrect form.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.