1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /*
3  *
4  *  (C) 2003 by Argonne National Laboratory.
5  *      See COPYRIGHT in top-level directory.
6  */
7 #include "mpi.h"
8 #include <stdio.h>
9 #include <string.h>
10 #include "mpitest.h"
11 
12 /* calling lookup_name 15 times in a loop when the name has not been
13    been published used to cause MPICH2 to crash. Adding this as a
14    regression test */
15 
main(int argc,char * argv[])16 int main( int argc, char *argv[] )
17 {
18     int errs = 0, i;
19     char port_name[MPI_MAX_PORT_NAME], serv_name[256];
20 
21     MTest_Init( &argc, &argv );
22 
23     strcpy( serv_name, "MyTest" );
24 
25     MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
26 
27     for (i=0; i<20; i++)
28 	MPI_Lookup_name(serv_name, MPI_INFO_NULL, port_name);
29 
30     MTest_Finalize( errs );
31     MPI_Finalize();
32     return 0;
33 
34 }
35