Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
169 stars 45 forks source link

bug in ctest macro #435

Open tclune opened 11 months ago

tclune commented 11 months ago

Reported by user:

One quick sanity check with add_pfunit_ctest.cmake though.

Line 137-140

It does a check on: If (NOT MPIEXEC_NUMPROC_FLAG)

And then

If (PFUNIT_MPI_USE_MPIEXEC) Set(MPIEXEC_EXECUTABLE ${PFUNIT_MPI_USE_MPIEXEC})

Should that “set” instead be

Set(MPIEXEC_NUMPROC_FLAG ${PFUNIT_MPI_USEMPIEXEC NUMPROC_FLAG })

To match the else() just below on 141?

Else() # best guess Set(MPIEXEC_NUMPROC_FLAG “-np”)

mathomp4 commented 11 months ago

Yeah, this:

    if (NOT MPIEXEC_NUMPROC_FLAG)
      if (PFUNIT_MPI_USE_MPIEXEC)
        set(MPIEXEC_EXECUTABLE ${PFUNIT_MPI_USE_MPIEXEC})
      else() # best guess
        set(MPIEXEC_NUMPROC_FLAG "-np")
      endif()
    endif()

does look a bit wonky.

Probably should be:

    if (NOT MPIEXEC_NUMPROC_FLAG)
      if (PFUNIT_MPI_MPIEXEC_NUMPROC_FLAG)
        set(MPIEXEC_NUMPROC_FLAG ${PFUNIT_MPI_MPIEXEC_NUMPROC_FLAG})
      else() # best guess
        set(MPIEXEC_NUMPROC_FLAG "-np")
      endif()
    endif()