Skip to content

Commit

Permalink
Add pytools requirements to do single_valued
Browse files Browse the repository at this point in the history
  • Loading branch information
JDBetteridge committed Nov 23, 2023
1 parent 8979f6a commit c7ad8bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pyop2/types/set.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ctypes
import functools
import numbers

import numpy as np
import pytools

from pyop2 import (
caching,
Expand Down Expand Up @@ -538,10 +538,7 @@ def __init__(self, sets):
"All components of a MixedSet must have the same number of layers."
# TODO: do all sets need the same communicator?
self.comm = mpi.internal_comm(
functools.reduce(
lambda a, b: a or b,
map(lambda s: s if s is None else s.comm, sets)
),
pytools.single_valued(s.comm for s in sets if s is not None),
self
)
self._initialized = True
Expand Down
1 change: 1 addition & 0 deletions requirements-ext.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ decorator<=4.4.2
dataclasses
cachetools
packaging
pytools
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def get_petsc_dir():
'decorator',
'mpi4py',
'numpy>=1.6',
'pytools',
]

version = sys.version_info[:2]
Expand Down

0 comments on commit c7ad8bd

Please sign in to comment.