Skip to content

[OTHER] Investigate differences in modulo between compilers #2630

Description

@EmilyBourne

What would you like to share?

Investigate differences in modulo between compilers. In particular compiling with intel leads to a larger difference in the result compared to Python

I cannot remember why such a large tolerance is needed on Intel. Maybe it uses a "fast-math" algorithm for the modulo operation? Is this problem language-specific, or is it the same for C, C++, and Fortran?
Originally posted by @yguclu in #2628 (comment)

I'm not sure we ever investigated this, we just assumed that it must be using a different algorithm. From memory, the issue was the same for C and Fortran, C++ support hasn't been added for this file yet (maybe it is in #2537)
Originally posted by @EmilyBourne in #2628 (comment)

See:

# Relative and absolute tolerances for array comparisons in the form
# numpy.isclose(a, b, rtol, atol). Intel seems to use a different algorithm
if os.environ.get("PYCCEL_DEFAULT_COMPILER", "GNU") == "intel":
RTOL = 1e-10
ATOL = 1e-10

Checklist 🚀

  • I checked and didn't find a similar issue.
  • I have read the Contributing Guidelines.
  • I am willing to work on this issue (optional).
  • I have starred the repository

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions