Skip to content

Conversation

@psychocoderHPC
Copy link
Contributor

Similar to #6286 rounding number of bytes into a single precision floating point value to round up the result of a division is a potential risk due to rounding errors.

  • remove floating point operations for round up
  • removes floating point conversion for round down (native behavior of integer division)

Signed-off-by: René Widera [email protected]

Similar to open-mpi#6286 rounding number of bytes into a single precision floating point value to round up the result of a division is a potential risk due to rounding errors.

- remove floating point operations for `round up`
- removes floating point conversion for round down (native behavior of integer division)

Signed-off-by: René Widera <[email protected]>
@ompiteam-bot
Copy link

Can one of the admins verify this patch?

@psychocoderHPC
Copy link
Contributor Author

To avoid style changes I keeped the indention for this PR equal to the lines I changed even if there are tabs in the first column. This will not follow the contribution guide lines but I tried to avoid to change other code around the touched lines.

int size_smallest_group = 0;
int num_groups = 0;
int ret = OMPI_SUCCESS;
OMPI_MPI_COUNT_TYPE bytes_per_agg_group = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is OMPI_MPI_COUNT_TYPE the right type for a byte count here or should it be MPI_Aint?

@jsquyres
Copy link
Member

ok to test

@edgargabriel
Copy link
Member

I am honestly still unclear why the ceil and floor functions are considered inadequate, i.e. not convinced this is truly necessary.

@psychocoderHPC
Copy link
Contributor Author

@edgargabriel Since io_ompio_bytes_per_agg (default on my system: 33554432) is an integer which can be chosen by the user form the environment it can result into the same rounding issue than #6286 and if the value is larger than 24bit it is not anymore possible to represent the value without rounding as a float value.

@edgargabriel
Copy link
Member

after thinking a bit more about it, the problem pinpointed by this fix is a legitimate concern. Whether we use a double precision value and the ceil function for resolving it, or your approach doesn't really matter in my opinion, so we can this solution as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants