diff --git a/python/dune/perftool/pdelab/argument.py b/python/dune/perftool/pdelab/argument.py index ff6ff6e9602a87a3ef28153772b64b8853c53893..b537093bb5def70a32acd99f42f8caba5d03b11e 100644 --- a/python/dune/perftool/pdelab/argument.py +++ b/python/dune/perftool/pdelab/argument.py @@ -102,7 +102,7 @@ def name_trialfunction_gradient(element, restriction, component): # This is just a temporary test used to create an A-matrix as # local operator class member. Right now it doesn't evaluate # anything. - if get_option("sumfact") and restriction==Restriction.NONE: + if get_option("sumfact") and restriction == Restriction.NONE: from dune.perftool.sumfact import evaluate_coefficient_gradient_sumfact evaluate_coefficient_gradient_sumfact(element, name, container, restriction, component) diff --git a/python/dune/perftool/sumfact/amatrix.py b/python/dune/perftool/sumfact/amatrix.py index 4703180aae29ece8fc9bf8339e6a40c5b0a174e9..6b4d911474f25009e94c12655c92df9be1570256 100644 --- a/python/dune/perftool/sumfact/amatrix.py +++ b/python/dune/perftool/sumfact/amatrix.py @@ -17,6 +17,7 @@ from dune.perftool.pdelab.localoperator import (name_domain_field, from dune.perftool.sumfact.sumfact import AMatrix, sumfact + @class_member("operator") def define_alignment(name): alignment = get_option("sumfact_alignment") diff --git a/python/dune/perftool/sumfact/sumfact.py b/python/dune/perftool/sumfact/sumfact.py index 5884b2f010330dd16ac8f764a236002740eecb16..9bbd6e0222139238f7f6fb034caf7af7de2d6943 100644 --- a/python/dune/perftool/sumfact/sumfact.py +++ b/python/dune/perftool/sumfact/sumfact.py @@ -75,10 +75,11 @@ class _GlobalSumfactCounter(object): def _sumfact_rows_iname(a_matrix, count): # TODO: Avoid caching? # count = _GlobalSumfactCounter().get() - name = "sf_cols_"+str(count) + name = "sf_cols_" + str(count) domain(name, a_matrix.m) return name + def sumfact_rows_iname(a_matrix): count = _GlobalSumfactCounter().get() name = _sumfact_rows_iname(a_matrix, count) @@ -89,7 +90,7 @@ def sumfact_rows_iname(a_matrix): def _sumfact_collumns_iname(input_collumns, count): # TODO: Avoid caching? # count = _GlobalSumfactCounter().get() - name = "sf_rows_"+str(count) + name = "sf_rows_" + str(count) domain(name, int(input_collumns)) return name @@ -179,19 +180,19 @@ def sumfact(element, name, container, restriction, component, a_matrices, inp, o # Special case for 1D if len(a_matrices) == 1: input_collumns = sumfact_kernel(a_matrices[0], inp, out, input_collumns, - first=True, element=element, name=name, container=container, - restriction=restriction, component=component) + first=True, element=element, name=name, container=container, + restriction=restriction, component=component) else: # Create buffer buffer_1 = name_buffer(a_matrices) if len(a_matrices) > 2: buffer_2 = name_buffer(a_matrices) - if len(a_matrices)%2 == 0: + if len(a_matrices) % 2 == 0: # First kernel input_collumns = sumfact_kernel(a_matrices[0], inp, out, input_collumns, - first=True, element=element, name=name, container=container, - restriction=restriction, component=component) + first=True, element=element, name=name, container=container, + restriction=restriction, component=component) # In between kernels for mat_1, mat_2 in zip(a_matrices[1:-2:2], a_matrices[2:-1:2]): @@ -203,8 +204,8 @@ def sumfact(element, name, container, restriction, component, a_matrices, inp, o else: # First kernel input_collumns = sumfact_kernel(a_matrices[0], inp, out, input_collumns, - first=True, element=element, name=name, container=container, - restriction=restriction, component=component) + first=True, element=element, name=name, container=container, + restriction=restriction, component=component) # Second kernel input_collumns = sumfact_kernel(a_matrices[1], buffer_1, buffer_2, input_collumns)