Search
OpenHPC Build Service
>
Projects
>
OpenHPC
:
1.3
:
Update10
:
Factory
>
openmpi-gnu8
> _service:extract_file:pr.1156.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:extract_file:pr.1156.patch of Package openmpi-gnu8
From 6c14a231b043b7c41d60c65c5c69c5e935fcdb61 Mon Sep 17 00:00:00 2001 From: Ralph Castain <rhc@open-mpi.org> Date: Wed, 11 May 2016 08:24:31 -0700 Subject: [PATCH] Set the transport key for singletons so PSM doesn't bark --- orte/mca/ess/singleton/ess_singleton_module.c | 54 ++++++++++++++++++--------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/orte/mca/ess/singleton/ess_singleton_module.c b/orte/mca/ess/singleton/ess_singleton_module.c index b672114..a01d922 100644 --- a/orte/mca/ess/singleton/ess_singleton_module.c +++ b/orte/mca/ess/singleton/ess_singleton_module.c @@ -6,11 +6,11 @@ * Copyright (c) 2004-2011 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2013-2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -18,9 +18,9 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ * */ @@ -53,6 +53,7 @@ #include "orte/util/name_fns.h" #include "orte/runtime/orte_globals.h" #include "orte/util/nidmap.h" +#include "orte/util/pre_condition_transports.h" #include "orte/util/session_dir.h" #include "orte/mca/ess/ess.h" @@ -78,6 +79,8 @@ static int rte_init(void) uint16_t jobfam; uint32_t hash32; uint32_t bias; + uint64_t unique_key[2]; + char *string_key; /* run the prolog */ if (ORTE_SUCCESS != (rc = orte_ess_base_std_prolog())) { @@ -91,7 +94,7 @@ static int rte_init(void) 0 == strncmp(orte_ess_singleton_server_uri, "FILE", strlen("FILE"))) { char input[1024], *filename; FILE *fp; - + /* it is a file - get the filename */ filename = strchr(orte_ess_singleton_server_uri, ':'); if (NULL == filename) { @@ -101,14 +104,14 @@ static int rte_init(void) return ORTE_ERROR; } ++filename; /* space past the : */ - + if (0 >= strlen(filename)) { /* they forgot to give us the name! */ orte_show_help("help-orterun.txt", "orterun:ompi-server-filename-missing", true, "singleton", orte_ess_singleton_server_uri); return ORTE_ERROR; } - + /* open the file and extract the uri */ fp = fopen(filename, "r"); if (NULL == fp) { /* can't find or read file! */ @@ -140,23 +143,23 @@ static int rte_init(void) /* now define my own name */ /* hash the nodename */ OPAL_HASH_STR(orte_process_info.nodename, hash32); - + bias = (uint32_t)orte_process_info.pid; - + OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output, "ess:singleton: initial bias %ld nodename hash %lu", (long)bias, (unsigned long)hash32)); - + /* fold in the bias */ hash32 = hash32 ^ bias; - + /* now compress to 16-bits */ jobfam = (uint16_t)(((0x0000ffff & (0xffff0000 & hash32) >> 16)) ^ (0x0000ffff & hash32)); - + OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output, "ess:singleton:: final jobfam %lu", (unsigned long)jobfam)); - + /* set the name - if we eventually spawn an HNP, it will use * local jobid 0, so offset us by 1 */ @@ -167,7 +170,7 @@ static int rte_init(void) if (orte_process_info.max_procs < orte_process_info.num_procs) { orte_process_info.max_procs = orte_process_info.num_procs; } - + /* flag that we are not routing since we have no HNP */ orte_routing_is_enabled = false; @@ -191,13 +194,13 @@ static int rte_init(void) ORTE_ERROR_LOG(rc); return rc; } - + /* if one was provided, build my nidmap */ if (ORTE_SUCCESS != (rc = orte_util_nidmap_init(orte_process_info.sync_buf))) { ORTE_ERROR_LOG(rc); return rc; } - + /* set the collective ids */ orte_process_info.peer_modex = 0; orte_process_info.peer_init_barrier = 1; @@ -213,6 +216,21 @@ static int rte_init(void) opal_setenv("OMPI_APP_CTX_NUM_PROCS", "1", 1, &environ); opal_setenv("OMPI_MCA_orte_ess_num_procs", "1", 1, &environ); + /* setup transport keys in case the MPI layer needs them - + * we can use the jobfam and stepid as unique keys + * because they are unique values assigned by the RM + */ + if (NULL == getenv("OMPI_MCA_orte_precondition_transports")) { + unique_key[0] = ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid); + unique_key[1] = ORTE_LOCAL_JOBID(ORTE_PROC_MY_NAME->jobid); + if (NULL == (string_key = orte_pre_condition_transports_print(unique_key))) { + ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); + return ORTE_ERR_OUT_OF_RESOURCE; + } + opal_setenv("OMPI_MCA_orte_precondition_transports", string_key, 1, &environ); + free(string_key); + } + /* push some useful info */ /* store the name of the local leader */ @@ -252,10 +270,10 @@ static int rte_init(void) static int rte_finalize(void) { int ret; - + /* deconstruct my nidmap and jobmap arrays */ orte_util_nidmap_finalize(); - + /* use the default procedure to finish */ if (ORTE_SUCCESS != (ret = orte_ess_base_app_finalize())) { ORTE_ERROR_LOG(ret);