| 172af916 | 24-Sep-2019 |
Jed Brown <jed@jedbrown.org> |
VecScatter: fix premature overflow caused by PetscInt indexing by bytes
When sizeof(PetscInt) == 4, we can store all array indices, but not necessarily all offsets in bytes. This effectively reduce
VecScatter: fix premature overflow caused by PetscInt indexing by bytes
When sizeof(PetscInt) == 4, we can store all array indices, but not necessarily all offsets in bytes. This effectively reduces the max problem size (in case of large messages) to 2B / sizeof(PetscScalar), which is an easy limit to hit.
The copy_lengths field could be changed to size_t to accommodate, but I think the code is more clear to change it to a count in units of PetscScalar and then use PetscArraycpy instead of PetscMemcpy, which is the approach taken in this commit.
Reported-by: Paolo Orsini <paolo.orsini@opengosim.com>
show more ...
|