Commit d0d77b7d authored by Paul Schultz's avatar Paul Schultz
Browse files

cluster problem

parent dd167826
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from numba import njit, float64, complex128, void, int32
from numba import njit, float64, complex128, void, int32, __version__
# from assimulo.solvers import CVODE
# from assimulo.problem import Explicit_Problem
import scipy.sparse as sps
import os
# numba version on the cluster does not support caching
cache_flag = __version__ != '0.19.1'
# The dynamics should be structured according to what is calculated on the network links.
class NodeType(object):
......@@ -162,7 +165,7 @@ from numba import njit, float64, complex128, void, int32
"""
def_network_rhs_string = """
@njit(float64[:](float64[:], float64), cache=True)
@njit(float64[:](float64[:], float64), cache={cache_flag})
def network_rhs_numba(y, t):
dydt = np.empty({total_length} + {length})
......@@ -180,7 +183,8 @@ def network_rhs_numba(y, t):
""".format(total_length=total_length,
length=length,
l_indptr=l_indptr
l_indptr=l_indptr,
cache_flag=cache_flag
)
def_network_rhs_string += "".join([node.node_dynamics_string(j) for j, node in enumerate(node_list)])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment