From 80ef1af8bab635946d104fe2513e2f5829e3a3f4 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 30 Dec 2010 20:54:58 +0000 Subject: [PATCH] Add psm key generator program This commit was SVN r24197. --- orte/test/system/Makefile | 2 +- orte/test/system/psm_keygen.c | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 orte/test/system/psm_keygen.c diff --git a/orte/test/system/Makefile b/orte/test/system/Makefile index c8996f1763..2cc04d23bc 100644 --- a/orte/test/system/Makefile +++ b/orte/test/system/Makefile @@ -1,4 +1,4 @@ -PROGS = no_op sigusr_trap spin orte_nodename orte_spawn orte_loop_spawn orte_loop_child orte_abort get_limits orte_ring spawn_child orte_tool orte_no_op binom oob_stress iof_stress iof_delay radix orte_barrier orte_mcast opal_interface mcast mcast_recv orte_spin segfault sysinfo orte_exit orte_db orte_sensor test-time event-threads +PROGS = no_op sigusr_trap spin orte_nodename orte_spawn orte_loop_spawn orte_loop_child orte_abort get_limits orte_ring spawn_child orte_tool orte_no_op binom oob_stress iof_stress iof_delay radix orte_barrier orte_mcast opal_interface mcast mcast_recv orte_spin segfault sysinfo orte_exit orte_db orte_sensor test-time event-threads psm_keygen all: $(PROGS) diff --git a/orte/test/system/psm_keygen.c b/orte/test/system/psm_keygen.c new file mode 100644 index 0000000000..d3a393c558 --- /dev/null +++ b/orte/test/system/psm_keygen.c @@ -0,0 +1,50 @@ +/* -*- C -*- + * + * $HEADER$ + * + * Generate a key for PSM transports + */ + +#include +#include "orte/constants.h" +#include "orte/runtime/runtime.h" + +#include "orte/util/pre_condition_transports.h" + +int main(int argc, char* argv[]) +{ + orte_job_t *jdata; + orte_app_context_t *app; + int i; + + if (ORTE_SUCCESS != orte_init(&argc, &argv, ORTE_PROC_NON_MPI)) { + fprintf(stderr, "Failed orte_init\n"); + exit(1); + } + + jdata = OBJ_NEW(orte_job_t); + app = OBJ_NEW(orte_app_context_t); + opal_pointer_array_set_item(jdata->apps, 0, app); + jdata->num_apps = 1; + + if (ORTE_SUCCESS != orte_pre_condition_transports(jdata)) { + fprintf(stderr, "Failed to generate PSM key\n"); + exit(1); + } + + for (i=0; NULL != app->env[i]; i++) { + if (0 == strncmp("OMPI_MCA_orte_precondition_transports", app->env[i], + strlen("OMPI_MCA_orte_precondition_transports"))) { + fprintf(stderr, "%s\n", app->env[i]); + break; + } + } + + OBJ_RELEASE(jdata); + + if (ORTE_SUCCESS != orte_finalize()) { + fprintf(stderr, "Failed orte_finalize\n"); + exit(1); + } + return 0; +}