Discussion:
[OMPI users] migrating to the MPI_F08 module
Tom Rosmond
2017-03-22 20:55:45 UTC
Permalink
Hello;

I am converting some fortran 90/95 programs from the 'mpif.h' include
file to the 'mpi_f08' model and have encountered a problem. Here is a
simple test program that demonstrates it:

__________________________________________________________________________-

program testf08
!
use mpi_f08 !! F008

implicit none

type(mpi_comm) :: mpicomm ! F08
! type(mpi_xxx) :: mpiint ! F08
integer :: mpiint
integer myrank,nproc,ierr

mpicomm= mpi_comm_world
mpiint= mpi_integer

call MPI_Init(ierr)
call MPI_Comm_rank(mpicomm,myrank,ierr)
call MPI_Comm_size(mpicomm,nproc,ierr)
!
call mpi_finalize(ierr)
end

___________________________________________________________________________

Compilation fails with this error:

testf08.f90(13): error #6303: The assignment operation or the binary
expression operation is invalid for the data types of the two
operands. [MPI_INTEGER]
mpiint= mpi_integer

Clearly I need something like the commented line with the 'xxx' string
as an analog to the typing of 'mpicomm' above it. So, what is needed in
place of 'xxx'? The naive choice 'type(mpi_integer)' isn't correct.

I am using OPENMPI 2.0.1 with Intel IFORT 12.0.3.174.


T. Rosmond
Gilles Gouaillardet
2017-03-22 22:47:01 UTC
Permalink
Tom,

what if you use
type(mpi_datatype) :: mpiint

Cheers,

Gilles
Post by Tom Rosmond
Hello;
I am converting some fortran 90/95 programs from the 'mpif.h' include file
to the 'mpi_f08' model and have encountered a problem. Here is a simple
____________________________________________________________
______________-
program testf08
!
use mpi_f08 !! F008
implicit none
type(mpi_comm) :: mpicomm ! F08
! type(mpi_xxx) :: mpiint ! F08
integer :: mpiint
integer myrank,nproc,ierr
mpicomm= mpi_comm_world
mpiint= mpi_integer
call MPI_Init(ierr)
call MPI_Comm_rank(mpicomm,myrank,ierr)
call MPI_Comm_size(mpicomm,nproc,ierr)
!
call mpi_finalize(ierr)
end
____________________________________________________________
_______________
testf08.f90(13): error #6303: The assignment operation or the binary
expression operation is invalid for the data types of the two operands.
[MPI_INTEGER]
mpiint= mpi_integer
Clearly I need something like the commented line with the 'xxx' string as
an analog to the typing of 'mpicomm' above it. So, what is needed in place
of 'xxx'? The naive choice 'type(mpi_integer)' isn't correct.
I am using OPENMPI 2.0.1 with Intel IFORT 12.0.3.174.
T. Rosmond
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
Tom Rosmond
2017-03-22 23:49:58 UTC
Permalink
Gilles,

Yes, I found that definition about 5 minutes after I posted the
question. Thanks for the response.

Tom
Post by Gilles Gouaillardet
Tom,
what if you use
type(mpi_datatype) :: mpiint
Cheers,
Gilles
Hello;
I am converting some fortran 90/95 programs from the 'mpif.h'
include file to the 'mpi_f08' model and have encountered a
__________________________________________________________________________-
program testf08
!
use mpi_f08 !! F008
implicit none
type(mpi_comm) :: mpicomm ! F08
! type(mpi_xxx) :: mpiint ! F08
integer :: mpiint
integer myrank,nproc,ierr
mpicomm= mpi_comm_world
mpiint= mpi_integer
call MPI_Init(ierr)
call MPI_Comm_rank(mpicomm,myrank,ierr)
call MPI_Comm_size(mpicomm,nproc,ierr)
!
call mpi_finalize(ierr)
end
___________________________________________________________________________
testf08.f90(13): error #6303: The assignment operation or the
binary expression operation is invalid for the data types of the
two operands. [MPI_INTEGER]
mpiint= mpi_integer
Clearly I need something like the commented line with the 'xxx'
string as an analog to the typing of 'mpicomm' above it. So, what
is needed in place of 'xxx'? The naive choice 'type(mpi_integer)'
isn't correct.
I am using OPENMPI 2.0.1 with Intel IFORT 12.0.3.174.
T. Rosmond
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
<https://rfd.newmexicoconsortium.org/mailman/listinfo/users>
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
Loading...