diff --git a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c index d421730844d..241bf220063 100644 --- a/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c +++ b/src/mpid/ch3/src/ch3u_comm_spawn_multiple.c @@ -126,105 +126,12 @@ int MPIDI_Comm_spawn_multiple(int count, char **commands, /* --END ERROR HANDLING-- */ /* Spawn the processes */ -#ifdef USE_PMI2_API - MPIR_Assert(count > 0); - { - int *argcs = MPL_malloc(count*sizeof(int), MPL_MEM_DYNAMIC); - struct MPIR_Info preput; - struct MPIR_Info *preput_p[1] = { &preput }; - - MPIR_Assert(argcs); - /* - info_keyval_sizes = MPL_malloc(count * sizeof(int), MPL_MEM_DYNAMIC); - */ - - /* FIXME cheating on constness */ - preput.key = (char *)PARENT_PORT_KVSKEY; - preput.value = port_name; - preput.next = NULL; - - /* compute argcs array */ - for (i = 0; i < count; ++i) { - argcs[i] = 0; - if (argvs != NULL && argvs[i] != NULL) { - while (argvs[i][argcs[i]]) { - ++argcs[i]; - } - } - - /* a fib for now */ - /* - info_keyval_sizes[i] = 0; - */ - } - /* XXX DJG don't need this, PMI API is thread-safe? */ - /*MPID_THREAD_CS_ENTER(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);*/ - /* release the global CS for spawn PMI calls */ - MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); - pmi_errno = PMI2_Job_Spawn(count, (const char **)commands, - argcs, (const char ***)argvs, - maxprocs, - info_keyval_sizes, (const MPIR_Info **)info_ptrs, - 1, (const struct MPIR_Info **)preput_p, - NULL, 0, - /*jobId, jobIdSize,*/ /* XXX DJG job stuff? */ - pmi_errcodes); - MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX); - /*MPID_THREAD_CS_EXIT(POBJ, MPIR_THREAD_POBJ_PMI_MUTEX);*/ - MPL_free(argcs); - if (pmi_errno != PMI2_SUCCESS) { - MPIR_ERR_SETANDJUMP1(mpi_errno, MPI_ERR_OTHER, - "**pmi_spawn_multiple", "**pmi_spawn_multiple %d", pmi_errno); - } - } -#else - /* FIXME: This is *really* awkward. We should either - Fix on MPI-style info data structures for PMI (avoid unnecessary - duplication) or add an MPIU_Info_getall(...) that creates - the necessary arrays of key/value pairs */ - - /* convert the infos into PMI keyvals */ - info_keyval_sizes = (int *) MPL_malloc(count * sizeof(int), MPL_MEM_DYNAMIC); - info_keyval_vectors = - (PMI_keyval_t**) MPL_malloc(count * sizeof(PMI_keyval_t*), MPL_MEM_DYNAMIC); - if (!info_keyval_sizes || !info_keyval_vectors) { - MPIR_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**nomem"); - } - - if (!info_ptrs) { - for (i=0; i