Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #722 from OP2/JDBetteridge/reset_numbering
Browse files Browse the repository at this point in the history
Reset numbering when generating
  • Loading branch information
JDBetteridge authored Jun 12, 2024
2 parents a52b998 + 7f3e8ae commit af813e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyop2/codegen/rep2loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pymbolic.primitives as pym

from collections import OrderedDict, defaultdict
from functools import singledispatch, reduce
from functools import singledispatch, reduce, partial
import itertools
import operator

Expand Down Expand Up @@ -401,6 +401,12 @@ def bounds(exprs):


def generate(builder, wrapper_name=None):
# Reset all terminal counters to avoid generated code becoming different across ranks
Argument._count = defaultdict(partial(itertools.count))
Index._count = itertools.count()
Materialise._count = itertools.count()
RuntimeIndex._count = itertools.count()

if builder.layer_index is not None:
outer_inames = frozenset([builder._loop_index.name,
builder.layer_index.name])
Expand Down

0 comments on commit af813e9

Please sign in to comment.