Arun, 

Before you call any MPI subroutines, you have to call MPI_Init(ierr) first. 
Once you put that line in, it should work.

Cheers, 
Ethan

--
Dr. Ethan Deneault
Assistant Professor of Physics
SC 234
University of Tampa
Tampa, FL 33606



-----Original Message-----
From: users-boun...@open-mpi.org on behalf of Arunkumar C R
Sent: Thu 12/31/2009 1:29 AM
To: us...@open-mpi.org
Subject: [OMPI users] Regarding Fortran 90 subroutines with MPI
 
Hi,

I have encountered some run time errors in the general purpose program given
below. Could you please assist me  in correcting this.
The MPI code is written in Fortran 90. The concept of subroutine is used
because I want to write program for another scientific problem.


module data
        use mpi
        implicit none
        integer::np, ierr, irank
end module

program prog
        use data
        implicit none

        integer::trial, ntrials
        ntrials=10

        do trial=1, ntrials
               call mpi_comm_rank(mpi_comm_world, irank, ierr)
               call mpi_comm_size(mpi_comm_world,    np, ierr)
               write(1, *) 'trial no=', trial
               write(1, *) 'irank      np'
               call
process
!subroutine call
        end do
        print*,'Program completed!'
        call mpi_finalize(ierr)
end

subroutine
process
!subroutine
        use data
        implicit none

        if(irank.eq.0) then
                write(10, *) irank, np
        end if
end subroutine process

Could you please run the program and let e know the error?

Thanking you
Sincerely,
Arun


-- 
******************************************************
Arunkumar C R
Research Assistant
Solid State & Structural Chemistry Unit
Indian Institute of Science
Bangalore -12, INDIA
arunkumar...@sscu.iisc.ernet.in
Mob: +91- 9900 549 059
******************************************************

<<winmail.dat>>

Reply via email to