Note that the default error handling mechanism in MPI is to abort the
application. What you need to do is change the default error handling
mechanism (perhaps temporarily) on MPI_COMM_WORLD to return errors
instead of aborting.
See the function MPI_COMM_SET_ERRHANDLER in MPI-2 for a description of
how to change the error handler (you want to change it to
MPI_ERRORS_RETURN) for MPI_COMM_WORLD (you want to change it on
MPI_COMM_WORLD because there is no communicator argument in the
MPI_LOOKUP_NAME function, so by default, any error is propagated using
MPI_COMM_WORLD's error handle).
According the MPI-2, if you LOOKUP a name that is not published, an
error of class MPI_ERR_NAME should be returned (i.e., status ==
MPI_ERR_NAME).
On Aug 27, 2005, at 4:48 PM, Lei_at_ICS wrote:
> Hi,
>
> I ran the following code:
>
> char port_name[MPI_MAX_PORT_NAME];
> int status;
>
> MPI_Init( &argc, &argv );
>
> status = MPI_Lookup_name("MPI_SERVER1", MPI_INFO_NULL, port_name);
>
> if (status != MPI_SUCCESS) {
> printf("****** MPI Server not up yet. \n");
> }
>
> Since MPI_SERVER1 is not published, I expect the error
> message to be printed. Indeed, it is printed, but from a
> crash:
> pan_at_scalable-quality% mpirun -np 1 client
> MPI_Lookup_name: publishing service: name is not published (rank 0,
> MPI_COMM_WORLD)
> Rank (0, MPI_COMM_WORLD): Call stack within LAM:
> Rank (0, MPI_COMM_WORLD): - MPI_Lookup_name()
> Rank (0, MPI_COMM_WORLD): - main()
> -----------------------------------------------------------------------
> ------
> One of the processes started by mpirun has exited with a nonzero exit
>
> What made the process crash with correct error message?
> What is wrong with my way of using MPI_Lookup_name?
> In order to use MPI dynamic processes, do I need to build LAM
> with a special option?
>
> Your prompt help is very much appreciated!
>
> Thanks,
>
> -Lei
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|