Skip to content
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

Fix computation of the size of the vector we scatter into #272

Merged
merged 1 commit into from
Nov 19, 2013

Conversation

wence-
Copy link
Member

@wence- wence- commented Nov 19, 2013

The local size of each data is dataset.size * dataset.cdim, not
dataset.size. This fixes a segfault when vecscattering mixed spaces
with vector function spaces in them.

sz = 0
# Size of flattened vector is product of size and cdim of each dat
for d in self._dats:
sz += d.dataset.size * d.dataset.cdim
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have written this as

sz = sum(d.dataset.size * d.dataset.cdim for d in self._dats)

but that's just nitpicking.

@kynan
Copy link
Member

kynan commented Nov 19, 2013

Apart from minor nitpick I think this is good to go.

The local size of each data is dataset.size * dataset.cdim, not
dataset.size.  This fixes a segfault when vecscattering mixed spaces
with vector function spaces in them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants