-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mpi: Packed gathers and scatters #2109
Conversation
@@ -534,6 +534,67 @@ def distance_mapper(self): | |||
retval[d] = j | |||
return retval | |||
|
|||
@cached_property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these properties here are simply lifted from what is now a subclass of Relation, namely Dependence , so this is not new code
@@ -24,7 +24,20 @@ RUN apt-get install -y libgl1-mesa-glx | |||
############################################################## | |||
FROM base as gcc | |||
|
|||
RUN apt-get install -y mpich libmpich-dev | |||
RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mloubout for homogeneity, switching to OpenMPI here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind switching but this is the expensive route, for standard CPU apt install libopenmpi-dev
should be enough (gotta double check name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but last I checked you would get openmpi 3, this way you get 4 (but I may be wrong)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it's fine
mkdir -p
lets you do any path so just mkdir -p /opt/openmpi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is mkdir -p /opt/openmpi
already... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missread deps
for openmpi
my bad
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## master #2109 +/- ##
===========================================
+ Coverage 63.06% 87.76% +24.70%
===========================================
Files 142 221 +79
Lines 21990 39115 +17125
Branches 3996 5087 +1091
===========================================
+ Hits 13867 34331 +20464
+ Misses 7409 4221 -3188
+ Partials 714 563 -151
|
if a0 is a1: | ||
continue | ||
|
||
r = Relation(a0, a1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Relation
commutative? product is quite brutal (might be ok if small set) so if it's commutative you are better of with two for loop (i, a0) in enumerate(v), a1 in v[i:-1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not commutative because the distance would flip (positive -> negative or negative -> positive)
""" | ||
Create a new HaloScheme that contains all entries in `self` plus the one | ||
passed in input. If `f` already exists in `self`, the old value is | ||
overridden. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so why is it overridden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's classic dict behaviour:
a[2] = 3
a[2] = 4
Now a[2]
contains 4
IOW, it does not behave as dict.setdefault
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant what is the reason for the new value to have priority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just the semantics I've established for this method. It seemed more convenient at the caller sites
@@ -78,21 +114,18 @@ def dtype_to_ctype(dtype): | |||
|
|||
def dtype_to_mpitype(dtype): | |||
"""Map numpy types to MPI datatypes.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NumPy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments but looks good
@@ -67,6 +68,11 @@ def make(self, hs): | |||
# Sanity check | |||
assert all(f.is_Function and f.grid is not None for f in hs.fmapper) | |||
|
|||
# Pack-up Functions into Bundles. Worst case scenario, we have Bundles | |||
# with just one components each. This is to maximize the likelihood of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one component
if swap is False: | ||
eq = Eq(buf[dims], f[f_indices]) | ||
swap = lambda i, j: (i, j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For readability, ok!
padded_count = count | ||
if count == 3: | ||
padded_count = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be better documented/explained? Not sure I get it
No description provided.