!**********************************************************************
!****************************************************************************
program main
use mpi
TYPE particle ! Defining the DATA TYPE of "particle"
REAL, DIMENSION(3) :: Coord
REAL :: Radius
REAL :: ZetaPt
END TYPE particle
type(particle) :: colloid1
integer n, myid, numprocs , rc
integer, dimension(1) :: t, b, d
call MPI_INIT( ierr )
call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
print *, 'Process ', myid, ' of ', numprocs, ' is alive'
colloid1%Coord = 0
colloid1%Radius = 0.0
colloid1%ZetaPt = 0.0
if ( myid .eq. 0 ) then
n = 100000
colloid1%Coord(1) = 10.0
colloid1%Coord(2) = 20.0
colloid1%Coord(3) = 30.0
colloid1%Radius = 1.0
colloid1%ZetaPt = 0.0
endif
call MPI_BCAST(n,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
if ( myid .gt. -1 ) then
print *, ' n of process ', myid, ' is ', n
endif
t(1) = MPI_REAL
b(1) = 13
d(1) = 0
call MPI_TYPE_STRUCT (1,b,d,t,MPI_PARTICLE, ierr)
call MPI_TYPE_COMMIT (MPI_PARTICLE, ierr)
call MPI_BCAST(colloid1,1,MPI_PARTICLE,0,MPI_COMM_WORLD,ierr)
if ( myid .gt. -1 ) then
print *, myid, colloid1
endif
call MPI_FINALIZE(rc)
stop
end
This is not a blog, but my notes and tips for research. Feel free to take any information and leave any comments or questions.
Search This Blog
Friday, October 5, 2007
Subscribe to:
Posts (Atom)
Labels
- Academic Notes (4)
- BLAS (1)
- CEE618 (2)
- CentOS (1)
- Computation (1)
- Conferences (1)
- Cross compiling (1)
- Graphics (1)
- Hawaii Tour (2)
- Intel compiler (1)
- Just (1)
- Laptop (1)
- LaTex (22)
- Life and Humanity (8)
- Linux and Computing (107)
- LSF (1)
- Lyx (3)
- Macintosh (5)
- MPI (1)
- News (11)
- OpenFoam (1)
- OpenMPI (1)
- PBS (2)
- Software (4)
- SSH (2)
- torque (1)
- Touchpad (1)
- VMD (1)
- yum (1)