<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18904"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=250003203-06042010><FONT color=#0000ff
size=2 face=Arial>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: <A
href="https://trac.mcs.anl.gov/projects/mpich2/ticket/1028">https://trac.mcs.anl.gov/projects/mpich2/ticket/1028</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250003203-06042010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=250003203-06042010><FONT color=#0000ff
size=2 face=Arial>Rajeev</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> mpich-discuss-bounces@mcs.anl.gov
[mailto:mpich-discuss-bounces@mcs.anl.gov] <B>On Behalf Of </B>Jilong
Yin<BR><B>Sent:</B> Monday, April 05, 2010 10:24 PM<BR><B>To:</B>
mpich-discuss@mcs.anl.gov<BR><B>Subject:</B> [mpich-discuss] How to use
MPI_TYPE_CREATE_F90_REAL<BR></FONT><BR></DIV>
<DIV></DIV>Hello, everyone<BR><BR> I am modifying my program to be used
in user-specified real precision such as single/double/quad
precision.<BR> I use Fortran (Intel fortran)<BR> But when I make
the following test program, it failed and reported as this,.<BR>Fatal error in
PMPI_Bcast: Invalid datatype, error stack:<BR>PMPI_Bcast(1301):
MPI_Bcast(buf=0012FEE8, count=1, dtype=USER<f90_real>,
root=0<BR> MPI_COMM_WORLD) failed<BR>PMPI_Bcast(1252): Datatype has not
been committed<BR> <BR><BR> I searched the web but can find little
about this MPI_TYPE_CREATE_F90_REAL,<BR>Anyone can help me out?<BR><BR>Thank
you.<BR><BR><BR>ccccccccccccccccccccccccccccccccccccccccc<BR><BR>
PROGRAM TEST<BR> IMPLICIT NONE<BR> INCLUDE
"MPIF.h"<BR><BR>C Define real type in different
precision<BR>
INTEGER,PARAMETER::SP=SELECTED_REAL_KIND(6,37)<BR>
INTEGER,PARAMETER::DP=SELECTED_REAL_KIND(15,307)<BR>
INTEGER,PARAMETER::QP=SELECTED_REAL_KIND(33,4931)<BR><BR>
INTEGER MYID,NUM_PROCS,IERR<BR><BR>C MPI REAL DATA
TYPE<BR> INTEGER
MPI_REAL_SP,MPI_REAL_DP,MPI_REAL_QP<BR><BR>
REAL(KIND=SP)::s<BR> REAL(KIND=DP)::d<BR>
REAL(KIND=QP)::q<BR><BR>C Initialize MPI
enviroment<BR> CALL MPI_INIT(IERR)<BR><BR>C get
my Rank ID<BR> CALL
MPI_COMM_RANK(MPI_COMM_WORLD,MYID,IERR)<BR><BR>C get the number of
procs<BR> CALL
MPI_COMM_SIZE(MPI_COMM_WORLD,NUM_PROCS,IERR)<BR><BR>C Output the precision and
range for each real type<BR>
WRITE(6,10)PRECISION(1.0_SP),RANGE(1.0_SP),<BR>
&
PRECISION(1.0_DP),RANGE(1.0_DP),<BR>
&
PRECISION(1.0_QP),RANGE(1.0_QP)<BR><BR>C Define MPI REAL
Type<BR> CALL
MPI_TYPE_CREATE_F90_REAL(6,MPI_UNDEFINED,MPI_REAL_SP,IERR)<BR>
CALL
MPI_TYPE_CREATE_F90_REAL(15,MPI_UNDEFINED,MPI_REAL_DP,IERR)<BR>
CALL
MPI_TYPE_CREATE_F90_REAL(33,MPI_UNDEFINED,MPI_REAL_QP,IERR)<BR><BR>
<BR>c test real type<BR> IF(MYID.EQ.0)
THEN<BR>
s=1.0_SP<BR> d=2.0_DP<BR>
q=3.0_QP<BR> END IF<BR><BR>c broadcast the above 3 values
from master node<BR> CALL
MPI_BCAST(s,1,MPI_REAL_SP,0,MPI_COMM_WORLD,IERR)<BR>
CALL
MPI_BCAST(d,1,MPI_REAL_DP,0,MPI_COMM_WORLD,IERR)<BR>
CALL MPI_BCAST(q,1,MPI_REAL_QP,0,MPI_COMM_WORLD,IERR)<BR><BR>C output the
result<BR> PRINT*,'MyID=',MYID,' s=',s,' d=',d,'
q=',q <BR><BR>C finish the mpi
enviroment<BR> CALL
MPI_FINALIZE(IERR)<BR><BR>
STOP<BR><BR>10 FORMAT('REAL PRECISION:
SP(',I2,',',I4,')',1X,<BR>
&
'DP(',I2,',',I4,')',1X,<BR>
&
'QP(',I2,',',I4,')')<BR><BR> END
<BR><BR>cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc<BR></BLOCKQUOTE></BODY></HTML>