Blame test/mpi/errors/spawn/unpub.c
|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* (C) 2003 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
#include "mpi.h"
|
|
Packit Service |
c5cf8c |
#include <stdio.h>
|
|
Packit Service |
c5cf8c |
#include <string.h>
|
|
Packit Service |
c5cf8c |
#include "mpitest.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* calling MPI_Unpublish_name before calling MPI_Publish_name
|
|
Packit Service |
c5cf8c |
(a user error) would cause the process manager to die. This is
|
|
Packit Service |
c5cf8c |
added as a regression test so that it doesn't happen in the future. */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int main(int argc, char *argv[])
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int rc, errclass, errs = 0;
|
|
Packit Service |
c5cf8c |
char port_name[MPI_MAX_PORT_NAME], serv_name[256];
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MTest_Init(&argc, &argv);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
strcpy(port_name, "otherhost:122");
|
|
Packit Service |
c5cf8c |
strcpy(serv_name, "MyTest");
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
rc = MPI_Unpublish_name(serv_name, MPI_INFO_NULL, port_name);
|
|
Packit Service |
c5cf8c |
MPI_Error_class(rc, &errclass);
|
|
Packit Service |
c5cf8c |
if (errclass != MPI_ERR_SERVICE)
|
|
Packit Service |
c5cf8c |
++errs;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MTest_Finalize(errs);
|
|
Packit Service |
c5cf8c |
return MTestReturnValue(errs);
|
|
Packit Service |
c5cf8c |
}
|