Skip to content

numba TypingError when running large-tokamak regression test #3099

@jonmaddock

Description

@jonmaddock

When trying to run the large-tokamak regression test, I get a TypingError from numba:

**************************************************************************************************************
 
   Equality constraints : 26
 Inequality constraints : 00
      Total constraints : 26
    Iteration variables : 44
         Max iterations : 200
       Figure of merit  : +01  -- minimise major radius.
  Convergence parameter : 1.00E-07
 
 **************************************************************************************************************
Traceback (most recent call last):
  File "/home/jon/anaconda3/envs/process/bin/process", line 33, in <module>
    sys.exit(load_entry_point('process', 'console_scripts', 'process')())
  File "/home/jon/code/process/process/main.py", line 650, in main
    Process(args)
  File "/home/jon/code/process/process/main.py", line 127, in __init__
    self.run_mode()
  File "/home/jon/code/process/process/main.py", line 204, in run_mode
    self.run.run()
  File "/home/jon/code/process/process/main.py", line 363, in run
    self.run_scan(self.solver)
  File "/home/jon/code/process/process/main.py", line 459, in run_scan
    self.scan = Scan(self.models, solver)
  File "/home/jon/code/process/process/scan.py", line 22, in __init__
    self.run_scan()
  File "/home/jon/code/process/process/scan.py", line 36, in run_scan
    ifail = self.doopt()
  File "/home/jon/code/process/process/scan.py", line 56, in doopt
    ifail = self.optimiser.run()
  File "/home/jon/code/process/process/optimiser.py", line 47, in run
    evaluators = Evaluators(self.models, x)
  File "/home/jon/code/process/process/evaluators.py", line 28, in __init__
    self.caller = Caller(models, x)
  File "/home/jon/code/process/process/caller.py", line 20, in __init__
    self.call_models(x)
  File "/home/jon/code/process/process/caller.py", line 65, in call_models
    self.models.physics.physics()
  File "/home/jon/code/process/process/physics.py", line 998, in physics
    current_drive_variables.cboot * self.bootstrap_fraction_sauter()
  File "/home/jon/code/process/process/physics.py", line 4627, in bootstrap_fraction_sauter
    dcsa(
  File "/home/jon/.local/lib/python3.10/site-packages/numba/core/dispatcher.py", line 468, in _compile_for_args
    error_rewrite(e, 'typing')
  File "/home/jon/.local/lib/python3.10/site-packages/numba/core/dispatcher.py", line 409, in error_rewrite
    raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Internal error at <numba.core.typeinfer.CallConstraint object at 0x7f9b8ff168f0>.
Failed in nopython mode pipeline (step: nopython rewrites)
Constant inference not possible for: $222build_string.6 + $const220.5

File "../../../../process/physics.py", line 776:
def tpf(j, triang, sqeps, fit=1):
    <source elided>

    raise RuntimeError(f"fit={fit} is not valid. Must be 1, 2, or 3")
    ^

During: resolving callee type: type(CPUDispatcher(<function tpf at 0x7f9b909ddd80>))
During: typing of call at /home/jon/code/process/process/physics.py (511)

Enable logging at debug level for details.

File "../../../../process/physics.py", line 511:
def dcsa(j, nr, rmajor, bt, triang, ne, ni, tempe, tempi, mu, rho, zef, sqeps):
    <source elided>
    zz = zef[j - 1]
    zft = tpf(j, triang, sqeps)
    ^

Obviously this needs to be fixed (possible as a result of #3088), but also how did this get through the CI?

My numba version is 0.56.4.

Metadata

Metadata

Assignees

Labels

UrgentNeeds to be resolved ASAP

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions