Skip to content

Commit

Permalink
Improved flow control.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed Oct 6, 2021
1 parent 0b997a6 commit 966f406
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions andes/system.py
Expand Up @@ -638,18 +638,21 @@ def _init_numba(self, models: OrderedDict):
"""
Helper function to compile all functions with Numba before init.
"""
if self.config.numba:
use_parallel = bool(self.config.numba_parallel)
use_cache = bool(self.config.numba_cache)
nopython = bool(self.config.numba_nopython)
if not self.config.numba:
return

logger.info("Numba compilation initiated, parallel=%s, cache=%s.",
use_parallel, use_cache)
for mdl in models.values():
mdl.numba_jitify(parallel=use_parallel,
cache=use_cache,
nopython=nopython,
)
use_parallel = bool(self.config.numba_parallel)
use_cache = bool(self.config.numba_cache)
nopython = bool(self.config.numba_nopython)

logger.info("Numba compilation initiated, parallel=%s, cache=%s.",
use_parallel, use_cache)

for mdl in models.values():
mdl.numba_jitify(parallel=use_parallel,
cache=use_cache,
nopython=nopython,
)

def init(self, models: OrderedDict, routine: str):
"""
Expand Down

0 comments on commit 966f406

Please sign in to comment.