[mpich-discuss] How to use MPI_TYPE_CREATE_F90_REAL
Dave Goodell
goodell at mcs.anl.gov
Mon Apr 5 22:45:27 CDT 2010
I think Rajeev is right, this is a bug in MPICH2. But the good news
is that it should be safe to call MPI_TYPE_COMMIT on the unnamed
predefined types, which would get you un-stuck for the moment.
-Dave
On Apr 5, 2010, at 10:41 PM, Rajeev Thakur wrote:
> Looks like this is a bug in MPICH2. It is saying that the datatype
> is not committed, whereas the datatype returned by
> type_create_f90_real is a predefined datatype that does not need to
> be committed. I have filed a bug report. You can try it here: https://trac.mcs.anl.gov/projects/mpich2/ticket/1028
>
> Rajeev
>
> From: mpich-discuss-bounces at mcs.anl.gov [mailto:mpich-discuss-bounces at mcs.anl.gov
> ] On Behalf Of Jilong Yin
> Sent: Monday, April 05, 2010 10:24 PM
> To: mpich-discuss at mcs.anl.gov
> Subject: [mpich-discuss] How to use MPI_TYPE_CREATE_F90_REAL
>
> Hello, everyone
>
> I am modifying my program to be used in user-specified real
> precision such as single/double/quad precision.
> I use Fortran (Intel fortran)
> But when I make the following test program, it failed and reported
> as this,.
> Fatal error in PMPI_Bcast: Invalid datatype, error stack:
> PMPI_Bcast(1301): MPI_Bcast(buf=0012FEE8, count=1,
> dtype=USER<f90_real>, root=0
> MPI_COMM_WORLD) failed
> PMPI_Bcast(1252): Datatype has not been committed
>
>
> I searched the web but can find little about this
> MPI_TYPE_CREATE_F90_REAL,
> Anyone can help me out?
>
> Thank you.
>
>
> ccccccccccccccccccccccccccccccccccccccccc
>
> PROGRAM TEST
> IMPLICIT NONE
> INCLUDE "MPIF.h"
>
> C Define real type in different precision
> INTEGER,PARAMETER::SP=SELECTED_REAL_KIND(6,37)
> INTEGER,PARAMETER::DP=SELECTED_REAL_KIND(15,307)
> INTEGER,PARAMETER::QP=SELECTED_REAL_KIND(33,4931)
>
> INTEGER MYID,NUM_PROCS,IERR
>
> C MPI REAL DATA TYPE
> INTEGER MPI_REAL_SP,MPI_REAL_DP,MPI_REAL_QP
>
> REAL(KIND=SP)::s
> REAL(KIND=DP)::d
> REAL(KIND=QP)::q
>
> C Initialize MPI enviroment
> CALL MPI_INIT(IERR)
>
> C get my Rank ID
> CALL MPI_COMM_RANK(MPI_COMM_WORLD,MYID,IERR)
>
> C get the number of procs
> CALL MPI_COMM_SIZE(MPI_COMM_WORLD,NUM_PROCS,IERR)
>
> C Output the precision and range for each real type
> WRITE(6,10)PRECISION(1.0_SP),RANGE(1.0_SP),
> & PRECISION(1.0_DP),RANGE(1.0_DP),
> & PRECISION(1.0_QP),RANGE(1.0_QP)
>
> C Define MPI REAL Type
> CALL MPI_TYPE_CREATE_F90_REAL(6,MPI_UNDEFINED,MPI_REAL_SP,IERR)
> CALL MPI_TYPE_CREATE_F90_REAL(15,MPI_UNDEFINED,MPI_REAL_DP,IERR)
> CALL MPI_TYPE_CREATE_F90_REAL(33,MPI_UNDEFINED,MPI_REAL_QP,IERR)
>
>
> c test real type
> IF(MYID.EQ.0) THEN
> s=1.0_SP
> d=2.0_DP
> q=3.0_QP
> END IF
>
> c broadcast the above 3 values from master node
> CALL MPI_BCAST(s,1,MPI_REAL_SP,0,MPI_COMM_WORLD,IERR)
> CALL MPI_BCAST(d,1,MPI_REAL_DP,0,MPI_COMM_WORLD,IERR)
> CALL MPI_BCAST(q,1,MPI_REAL_QP,0,MPI_COMM_WORLD,IERR)
>
> C output the result
> PRINT*,'MyID=',MYID,' s=',s,' d=',d,' q=',q
>
> C finish the mpi enviroment
> CALL MPI_FINALIZE(IERR)
>
> STOP
>
> 10 FORMAT('REAL PRECISION: SP(',I2,',',I4,')',1X,
> & 'DP(',I2,',',I4,')',1X,
> & 'QP(',I2,',',I4,')')
>
> END
>
> cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
More information about the mpich-discuss
mailing list