Skip to content

Fortran: fix mapping of Fortran REAL - #7918

Merged
hzhou merged 2 commits into
pmodels:mainfrom
hzhou:2608_datatype
Aug 3, 2026
Merged

Fortran: fix mapping of Fortran REAL#7918
hzhou merged 2 commits into
pmodels:mainfrom
hzhou:2608_datatype

Conversation

@hzhou

@hzhou hzhou commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Description

Fix a typo in configure resulted mapping Fortran REAL to internal MPIR_INT32.

Add a test cover future mapping issues.

Fixes #7911

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@hzhou

hzhou commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

test:mpich/ch3/most
test:mpich/ch4/most

@hzhou
hzhou requested a review from colleeneb August 2, 2026 20:22

@colleeneb colleeneb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I had one not-super-important comment, but it looks good. I built it and tested with the reproducer and it worked.

Comment thread test/mpi/f77/coll/reducef.f Outdated

if (rank .eq. 0) then
ans_f = real(size * (size + 1) / 2)
if (abs(sum_f - ans_f) .gt. 1.0e-6) then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

1.0e-6 might be a little tight for comparing reals generally (maybe 1e-5 or 1e-4 would be better) but since this is just comparing the sum of ranks it's probably rare it would be a problem.

hzhou added 2 commits August 3, 2026 09:44
A typo resulted mapping Fortran REAL to internal integer type.
Add basic tests that covers reduce operation on basic Fortran types.
@hzhou
hzhou merged commit b29cabf into pmodels:main Aug 3, 2026
6 checks passed
@hzhou
hzhou deleted the 2608_datatype branch August 3, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fortran: MPI_Reduce produces wrong answer using MPI_REAL

2 participants