LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Roberto Pasianot (pasianot_at_[hidden])
Date: 2004-03-31 10:17:06


 You must initialize MPI environment in main not in subroutine.
 Cheers. Roberto.

On Wed, 31 Mar 2004, [iso-8859-1] Mathias Brito wrote:

> I tried to run this code after compile it, and it
> did't run. Can somebody help me with this?
>
> program sph
> include 'mpif.h'
> call data_
> end
>
> subroutine data_
> C
> integer nprocs, rank, ierror
> integer start_address, address
> integer x
> integer l(2), d(2), t(2)
> real c
> C
> call mpi_init(ierror)
> call mpi_comm_size(MPI_COMM_WORLD, nprocs,
> ierror)
> call mpi_comm_rank(MPI_COMM_WORLD, rank,
> ierror)
> C
> l(1) = 1
> l(2) = 1
>
> call mpi_address(x, start_address, ierror)
> d(1) = 0
> call mpi_address(c, address, ierror)
> d(2) = address - start_address
>
> t(1) = MPI_INTEGER
> t(2) = MPI_REAL
>
> call mpi_type_struct(2, l, d, t, packz,
> ierror)
> call mpi_type_commit(packz, ierror)
> call mpi_finalize(ierror)
>
> end
>
>
> =====
> Mathias Brito
> Universidade Estadual de Santa Cruz - UESC
> Departamento de Ciências Exatas e Tecnológicas
> Estudante do Curso de Ciência da Computação
>
> ______________________________________________________________________
>
> Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
> http://br.yahoo.com/info/mail.html
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>