From 45894aeceebbcfc131f217c44470edbd6358cab8 Mon Sep 17 00:00:00 2001 From: David Daniel Date: Thu, 27 Jul 2006 23:45:33 +0000 Subject: [PATCH] Adding support for MPI_Comm_spawn() to use the 'host' key in an MPI_Info object if provided. The associated value is a comma-separated list of hosts -- which must be in the initial allocation -- and is used to populate the application context map. This commit was SVN r11039. --- ompi/communicator/comm_dyn.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ompi/communicator/comm_dyn.c b/ompi/communicator/comm_dyn.c index a8003fbf76..e3822b9b61 100644 --- a/ompi/communicator/comm_dyn.c +++ b/ompi/communicator/comm_dyn.c @@ -323,6 +323,7 @@ ompi_comm_start_processes(int count, char **array_of_commands, int have_wdir=0; int valuelen=OMPI_PATH_MAX, flag=0; char cwd[OMPI_PATH_MAX]; + char host[OMPI_PATH_MAX]; /*** should define OMPI_HOST_MAX ***/ orte_jobid_t new_jobid; orte_app_context_t **apps=NULL; @@ -424,15 +425,28 @@ ompi_comm_start_processes(int count, char **array_of_commands, } } - /* Check for the 'wdir' and later potentially for the - 'path' Info object */ + /* Check for well-known info keys */ have_wdir = 0; if ( array_of_info != NULL && array_of_info[i] != MPI_INFO_NULL ) { + + /* check for 'wdir' */ ompi_info_get (array_of_info[i], "wdir", valuelen, cwd, &flag); if ( flag ) { apps[i]->cwd = cwd; have_wdir = 1; } + + /* check for 'host' */ + ompi_info_get (array_of_info[i], "host", sizeof(host), host, &flag); + if ( flag ) { + apps[i]->num_map = 1; + apps[i]->map_data = (orte_app_context_map_t **) malloc(sizeof(orte_app_context_map_t *)); + apps[i]->map_data[0] = OBJ_NEW(orte_app_context_map_t); + apps[i]->map_data[0]->map_type = ORTE_APP_CONTEXT_MAP_HOSTNAME; + apps[i]->map_data[0]->map_data = strdup(host); + } + + /* 'path', 'arch', 'file', 'soft' -- to be implemented */ } /* default value: If the user did not tell us where to look for the