From ad3702b96d548e731a3db0845ea8059dec67912d Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Fri, 17 Sep 2004 13:16:14 +0000 Subject: [PATCH] fixing some minor issues in connect/accept. A connect/accept between two groups of processes (within the same MPI_COMM_WORLD) works already This commit was SVN r2743. --- src/mpi/c/comm_accept.c | 6 ++++-- src/mpi/c/comm_connect.c | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/mpi/c/comm_accept.c b/src/mpi/c/comm_accept.c index bc2e0dabbc..85434ac410 100644 --- a/src/mpi/c/comm_accept.c +++ b/src/mpi/c/comm_accept.c @@ -74,8 +74,10 @@ int MPI_Comm_accept(char *port_name, MPI_Info info, int root, * Our own port_name is not of interest here, so we pass in NULL. * The two leaders will figure this out later. However, we need the tag. */ - tmp_port = ompi_parse_port(port_name, &tag); - free (tmp_port); + if ( rank == root ) { + tmp_port = ompi_parse_port(port_name, &tag); + free (tmp_port); + } rc = ompi_comm_connect_accept (comm, root, NULL, send_first, &newcomp, tag); *newcomm = newcomp; diff --git a/src/mpi/c/comm_connect.c b/src/mpi/c/comm_connect.c index 952fce3179..991dc2d6e8 100644 --- a/src/mpi/c/comm_connect.c +++ b/src/mpi/c/comm_connect.c @@ -76,13 +76,15 @@ int MPI_Comm_connect(char *port_name, MPI_Info info, int root, * translate the port_name string into the according process_name_t * structure. */ - tmp_port = ompi_parse_port (port_name, &tag); - port_proc_name = ompi_name_server.convert_string_to_process_name(tmp_port); - if ( NULL == port_proc_name ) { - *newcomm = MPI_COMM_NULL; - return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_PORT, FUNC_NAME); + if ( rank == root ) { + tmp_port = ompi_parse_port (port_name, &tag); + port_proc_name = ompi_name_server.convert_string_to_process_name(tmp_port); + if ( NULL == port_proc_name ) { + *newcomm = MPI_COMM_NULL; + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_PORT, FUNC_NAME); + } + free (tmp_port); } - free (tmp_port); rc = ompi_comm_connect_accept (comm, root, port_proc_name, send_first, &newcomp, tag);