Oh, hang on, I just saw that the value of CORES_PER_NUMA_REGION is a shell expression.
This is very different to Jinja2 code. Jinja2 code gets processed at start-up, when the flow.cylc is parsed.
Shell expressions are not processed at all by Cylc. They are printed verbatim to the job file, to be evaluated in the job environment at job run time!
If the final values you need are available at start-up (when flow.cylc is parsed) it’s probably better to use Jinja2, then you don’t have to wait till that particular job runs to find out if you got it wrong because the job environment is not what you thought.