Skip to content

test/mpi: add implicit none to Fortran tests - #7912

Open
jeffhammond wants to merge 2 commits into
pmodels:mainfrom
jeffhammond:fix-issue-6318
Open

test/mpi: add implicit none to Fortran tests#7912
jeffhammond wants to merge 2 commits into
pmodels:mainfrom
jeffhammond:fix-issue-6318

Conversation

@jeffhammond

@jeffhammond jeffhammond commented Jul 31, 2026

Copy link
Copy Markdown
Member

Goal: address issue #6318 by making the Fortran MPI tests require explicit declarations across the f77, f90, f08, errors, and shared utility test sources.

Reasoning: without implicit none, missing or misspelled MPI Fortran names can compile as implicit variables, which hides coverage gaps. The F77-to-F90 converter and F90 IO harness generation were updated so generated sources keep the correct declaration order: F77 keeps implicit none before mpif.h includes, while generated F90 emits use mpi before implicit none.

Verification: regenerated MPICH with ./autogen.sh, configured with CC=gcc CXX=g++ FC=gfortran F77=gfortran ../configure --with-device=ch4:ofi --with-libfabric=embedded --enable-g --enable-f77 --enable-f90 --enable-f08, built with make -j50, and installed locally. Regenerated test metadata with ./autogen.sh -do=test, configured the MPI test suite against the local install, forced the F90 IO harness generation path, and verified the test suite builds with make -j50 in build-gcc-ch4-ofi-g/test/mpi-verify-4. Also ran git diff --check -- test/mpi and a structural scan that reported files 337 missing 0.

Context: the F90 IO harness output is generated and ignored, so this commit changes the tracked generator rule instead of committing generated files. Local build, install, log, and generated wrapper outputs are intentionally left untracked.

Pull Request Description

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.

Resolves #6318.

Goal: address issue pmodels#6318 by making the Fortran MPI tests require explicit declarations across the f77, f90, f08, errors, and shared utility test sources.

Reasoning: without implicit none, missing or misspelled MPI Fortran names can compile as implicit variables, which hides coverage gaps. The F77-to-F90 converter and F90 IO harness generation were updated so generated sources keep the correct declaration order: F77 keeps implicit none before mpif.h includes, while generated F90 emits use mpi before implicit none.

Verification: regenerated MPICH with ./autogen.sh, configured with CC=gcc CXX=g++ FC=gfortran F77=gfortran ../configure --with-device=ch4:ofi --with-libfabric=embedded --enable-g --enable-f77 --enable-f90 --enable-f08, built with make -j50, and installed locally. Regenerated test metadata with ./autogen.sh -do=test, configured the MPI test suite against the local install, forced the F90 IO harness generation path, and verified the test suite builds with make -j50 in build-gcc-ch4-ofi-g/test/mpi-verify-4. Also ran git diff --check -- test/mpi and a structural scan that reported files 337 missing 0.

Context: the F90 IO harness output is generated and ignored, so this commit changes the tracked generator rule instead of committing generated files. Local build, install, log, and generated wrapper outputs are intentionally left untracked.
Goal: keep the implicit-none conversion buildable with compilers that do not implicitly type the nonstandard iargc routine.

Reasoning: the spawn argument tests intentionally use the legacy getarg/iargc interface. After adding implicit none, nvfortran rejects iargc unless it has an explicit type declaration. Declaring iargc as integer is the smallest source change and matches the existing call sites without altering test behavior or formatting.

Verification: configured, built, and installed MPICH in build-gcc-nvfortran-ch4-ofi-g with CC=gcc CXX=g++ FC=nvfortran F77=nvfortran, --with-device=ch4:ofi, --with-libfabric=embedded, --enable-g, --enable-f77, --enable-f90, and --enable-f08. Then configured test/mpi against install-gcc-nvfortran-ch4-ofi-g and rebuilt the MPI test suite with make -j50. Also ran git diff --check -- test/mpi.
@hzhou

hzhou commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

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

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.

all the Fortran tests need implicit none in them

2 participants