From 1f7a5da3ce1694598b92bd84082ee5e45d1c194f Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 10 Oct 2006 23:59:48 +0000 Subject: [PATCH] Bring singleton comm_spawn online. This commit was SVN r12081. --- ompi/communicator/comm_dyn.c | 7 +++++-- ompi/mpi/c/comm_spawn.c | 11 ----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ompi/communicator/comm_dyn.c b/ompi/communicator/comm_dyn.c index faa7260f34..31cbe6bf87 100644 --- a/ompi/communicator/comm_dyn.c +++ b/ompi/communicator/comm_dyn.c @@ -352,7 +352,7 @@ ompi_comm_start_processes(int count, char **array_of_commands, char *base_prefix; orte_std_cntr_t num_apps, ai; - orte_jobid_t new_jobid; + orte_jobid_t new_jobid=ORTE_JOBID_INVALID; orte_app_context_t **apps=NULL; @@ -383,8 +383,11 @@ ompi_comm_start_processes(int count, char **array_of_commands, /* we'll just use the prefix from the first member of the app_context array. * this shouldn't matter as they all should be the same. it could be NULL, of * course (user might not have specified it), so we need to protect against that. + * + * It's possible that no app_contexts are returned (e.g., during a comm_spawn + * from a singleton), so check first */ - if (NULL != apps[0]->prefix_dir) { + if (NULL != apps && NULL != apps[0]->prefix_dir) { base_prefix = strdup(apps[0]->prefix_dir); } else { base_prefix = NULL; diff --git a/ompi/mpi/c/comm_spawn.c b/ompi/mpi/c/comm_spawn.c index e4ab82a26e..c760ad2eab 100644 --- a/ompi/mpi/c/comm_spawn.c +++ b/ompi/mpi/c/comm_spawn.c @@ -68,17 +68,6 @@ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, FUNC_NAME); } - - /* Do not allow MPI_COMM_SPAWN from a singleton. This check - will be removed when the ORTE 2.0 stuff comes over and - Makes This All Better(tm) */ - if (orte_process_info.singleton) { - if (ompi_comm_rank(comm) == root) { - opal_show_help("help-mpi-api.txt", "spawn-from-singleton", - true, FUNC_NAME); - } - return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - } } rank = ompi_comm_rank ( comm );