CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

problem in MPI programming...

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2009, 15:46
Default problem in MPI programming...
  #1
New Member
 
Mehdi
Join Date: May 2009
Posts: 1
Rep Power: 0
mehdi is on a distinguished road
Hi everyone,

I've got a problem on employing MPI in my parallel code. Actually, even for a so simple following integration part!, if the #cpu's be changed, the results would be changed, too!
However, the difference will be rectified by using double precision for variables. Since the difference for single precision is quite unacceptable, how do you think if I am doing something wrong...?


thanks in advance!


Program main
include 'mpif.h'
include 'c_param .f'
include 'comm.f'
integer myid,rc,ierror
call MPI_INIT(ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, myid, ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
n2do=ny/size
n1m=nx
n2m=ny
n3m=nz
DO 20 J=1,NY
DY(J)=-YV(J-1)+YV(J)
DY(J)=0.01
20 CONTINUE
C---------------------------------
AREABODY=0.d0
DO K=1,n3m
DO I=1,n1m
DO J=1,N2DO
jj=myid*N2DO+j
AREABODY=AREABODY+DY(JJ)
ENDDO
ENDDO
ENDDO
CALL MPI_ALLREDUCE(AREABODY,WORK_AREABODY,1,MPI_double_ precision,
1 MPI_SUM, MPI_COMM_WORLD, IERROR)

write(6,101) myid,j,jj,AREABODY,WORK_AREABODY
101 format(3I10,2F25.15)


CALL MPI_FINALIZE(rc)
STOP
END
mehdi is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13
Problem in Tutorial problem of fluent Phanindra FLUENT 5 April 17, 2007 10:57
problem in solving "wave generation" problem san FLUENT 2 April 4, 2006 00:37
problem with using colocated code Jack Main CFD Forum 0 December 15, 2002 01:15
GAMBIT meshing problem Gauthier Lambert Main CFD Forum 1 August 3, 2000 10:22


All times are GMT -4. The time now is 10:32.