Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [OMPI users] Regarding Fortran 90 subroutines with MPI
Date: 2009-12-31 11:17:50


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


Dr. Ethan Deneault
Assistant Professor of Physics
SC 234
University of Tampa
Tampa, FL 33606
-----Original Message-----
From: users-bounces_at_[hidden] on behalf of Arunkumar C R
Sent: Thu 12/31/2009 1:29 AM
To: users_at_[hidden]
Subject: [OMPI users] Regarding Fortran 90 subroutines with MPI
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
        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'
!subroutine call
        end do
        print*,'Program completed!'
        call mpi_finalize(ierr)
        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
Arunkumar C R
Research Assistant
Solid State & Structural Chemistry Unit
Indian Institute of Science
Bangalore -12, INDIA
Mob: +91- 9900 549 059