Newsgroups: comp.parallel.mpi
From: "Thomas Fürle" <fuerle@vipios.pri.univie.ac.at>
Subject: Re: [Q] Another question about MPI...
Organization: Vienna University, Austria
Date: Mon, 02 Mar 1998 16:20:24 +0100
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <34FACE38.7F5436BE@vipios.pri.univie.ac.at>

Jean-Paul Dzisiak wrote:

> Hello !
>
> I have written an MPMD model between a "master" and a "slave". The
> "slave" sends data to the "master" with the "MPI_SEND" and the "master
>
> receives its data with the "MPI_RECV" MPI call.
>
> My questions are:
>
> 1) When the "slave" has finished, how can I inform the master ? I've
> tried
>     to call "MPI_FINALIZE" in the "slave" but the "master" is waiting
> its
>     data through "MPI_RECV" (a blocking call). Should I try the
> "MPI_PRODE"
>     call in order to know if the "slave" is still present ?

send another tag to finish receivement like DATA and DATA_FINISHED to
the master.

while (MPI_Probe (MPI_ANY_SOURCE, MPI_ANY_TAG, ..., &status)
{
        if (status == DATA_FINISHED)
        {  MPI_Finalize ();
            exit (0);
        }
}

> 2) If an error occur in the "master" or in the "slave" (file not
> found,
> etc...),
>     how can I shutdown these 2 programs ?

see 1.)

>
>
> 3) When a program stops, I am obliged to call "MPI_FINALIZE" or when
> an
> error
>     occur, do I have to call "MPI_ABORT". Can't I use STOP (in
> Fortran)
> only ?

I think you can use STOP, but you'll get some error messages on stderr,
because MPI cannot correct finish.

>
>
> Help would be very appreciated...
>
> Jep


Regards, Tom
--
Thomas Fuerle
mailto:fuerle@vipios.pri.univie.ac.at
http://vipios.pri.univie.ac.at
Institute for Applied Computer Science and Information Systems
University of  Vienna, Rathausstr. 19/4, A-1010 Vienna, Austria
Tel: +43 1 4277 38423



