-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"use mpi_f08" instead of "include mpif.h" #34
Comments
Support for the If moving to a hard dependency on #if USE_MPI_F08
# define PF_MPI_MODULE mpi_f08
# define PF_MPI_COMM_TYPE type(MPI_Comm)
#else
# define PF_MPI_MODULE mpi
# define PF_MPI_COMM_TYPE integer
#end
module PF_MpiContext
use PF_ParallelContext
use PF_ExceptionList, only: throw
use PF_MPI_MODULE
implicit none
private
public :: MpiContext
type, extends(ParallelContext) :: MpiContext
private
PF_MPI_COMM_TYPE :: mpiCommunicator = MPI_COMM_NULL
integer :: root = 0 It looks like there's only 5 files that would need modifying, and 3 of those only need the module name changing. |
What about the methods that say provide the MPI communicator inside a test? The user's code (and tests) may still be using integers for the communicator and the framework needs to support that. I would think we'd want/need a (conditional) extra method that can return an MPI_Comm while preserving the interface that returns the integer. |
Fair point -- I had assumed the The standard says that the function getMpiCommunicator(this) result(mpiCommunicator)
integer :: mpiCommunicator
class (MpiContext), intent(in) :: this
mpiCommunicator = this%mpiCommunicator%MPI_VAL
end function getMpiCommunicator
function getMpiF08Communicator(this) result(mpiCommunicator)
type(MPI_Comm) :: mpiCommunicator
class (MpiContext), intent(in) :: this
mpiCommunicator = this%mpiCommunicator
end function getMpiF08Communicator |
My main concern was just making sure that the default behavior remains backward compatible. If the default remains "not F08" then we can let the user update the tests themselves if they select F08. Then is some mystic future when pFUnit 5.0 comes out we would make F08 the default and not support older MPI's. This would obviate the need for two "getters" as above. But having both might be friendlier to a gradual update. Sound ok? |
First of all thanks for the great unit test environment!
Reading Halo_mod I noticed, that "include mpif.h" is used.
(Other modules like PF_MpiTestCase already have "use mpi")
Using mpi with "include mpif.h" is outdated and should not be done anymore. Instead think about putting "use mpi" or even better (for all functionality) "use mpi_f08".
From the mpi forum:
Instead of using mpif.h, the use of the mpi_f08 or mpi module is strongly encouraged for the following reasons:
The text was updated successfully, but these errors were encountered: