def __init__(self, call, parent_call): if False: self._0_to_n = DynKernelArgument(None, None, None) # for pyreverse Arguments.__init__(self, parent_call) self._args = [] for (idx, arg) in enumerate(call.ktype.arg_descriptors): self._args.append( DynKernelArgument(arg, call.args[idx], parent_call)) self._dofs = []
def __init__(self, call, parent_call): # pylint: disable=using-constant-test if False: self._0_to_n = GOKernelArgument(None, None, None) # for pyreverse Arguments.__init__(self, parent_call) self._args = [] for (idx, arg) in enumerate(call.ktype.arg_descriptors): self._args.append(GOKernelArgument(arg, call.args[idx], parent_call)) self._dofs = []
def iteration_space_arg(self, mapping=None): if mapping: my_mapping = mapping else: my_mapping = {"write": "write", "read": "read", "readwrite": "readwrite", "inc": "inc"} arg = Arguments.iteration_space_arg(self, my_mapping) return arg
def iteration_space_arg(self, mapping={}): if mapping != {}: my_mapping = mapping else: my_mapping = { "write": "gh_write", "read": "gh_read", "readwrite": "gh_rw", "inc": "gh_inc" } arg = Arguments.iteration_space_arg(self, my_mapping) return arg
def __init__(self, call, parent_call): if False: # pylint: disable=using-constant-test self._0_to_n = GOKernelArgument(None, None, None) # for pyreverse Arguments.__init__(self, parent_call) self._args = [] # Loop over the kernel arguments obtained from the meta data for (idx, arg) in enumerate(call.ktype.arg_descriptors): # arg is a GO1p0Descriptor object if arg.type == "grid_property": # This is an argument supplied by the psy layer self._args.append(GOKernelGridArgument(arg)) elif arg.type == "scalar" or arg.type == "field": # This is a kernel argument supplied by the Algorithm layer self._args.append( GOKernelArgument(arg, call.args[idx], parent_call)) else: raise ParseError("Invalid kernel argument type. Found '{0}' " "but must be one of {1}".format( arg.type, ["grid_property", "scalar", "field"])) self._dofs = []
def iteration_space_arg(self, mapping=None): if mapping: my_mapping = mapping else: # We provide an empty mapping for inc as it is not supported # in the GOcean 1.0 API. However, the entry has to be there # in the dictionary as a field that has read access causes # the code (that checks that a kernel has at least one argument # that is written to) to attempt to lookup "inc". my_mapping = { "write": "write", "read": "read", "readwrite": "readwrite", "inc": "" } arg = Arguments.iteration_space_arg(self, my_mapping) return arg