diff --git a/src/mca/oob/base/oob_base_init.c b/src/mca/oob/base/oob_base_init.c index df33bd6030..628a2d020f 100644 --- a/src/mca/oob/base/oob_base_init.c +++ b/src/mca/oob/base/oob_base_init.c @@ -52,6 +52,7 @@ int mca_oob_base_init(bool *user_threads, bool *hidden_threads) OBJ_CONSTRUCT(&mca_oob_name_self, ompi_process_name_t); self = mca_pcm.pcm_self(); if(NULL == self) { + ompi_output(0, "mca_oob_base_init: could not get PCM self pointer"); return OMPI_ERROR; } mca_oob_name_self = *self; diff --git a/src/mca/pcm/base/pcm_base_open.c b/src/mca/pcm/base/pcm_base_open.c index 683aa93f0a..71ae957475 100644 --- a/src/mca/pcm/base/pcm_base_open.c +++ b/src/mca/pcm/base/pcm_base_open.c @@ -21,7 +21,7 @@ /* * Global variables */ -int mca_pcm_base_output = -1; +int mca_pcm_base_output = 0; mca_pcm_base_module_t mca_pcm; ompi_list_t mca_pcm_base_components_available; mca_pcm_base_component_t mca_pcm_base_selected_component; diff --git a/src/tools/mpirun/Makefile.am b/src/tools/mpirun/Makefile.am index f4c5b4814e..2fd83f463d 100644 --- a/src/tools/mpirun/Makefile.am +++ b/src/tools/mpirun/Makefile.am @@ -5,7 +5,23 @@ include $(top_srcdir)/config/Makefile.options +libs = $(top_builddir)/src/libmpi.la + bin_SCRIPTS = mpirun mpiboot EXTRA_DIST = $(bin_SCRIPTS) +bin_PROGRAMS = mpirun2 + +mpirun2_SOURCES = \ + mpirun2.cc +mpirun2_LDADD = \ + $(libs) \ + $(LIBMPI_EXTRA_LIBS) \ + $(LIBOMPI_EXTRA_LIBS) +mpirun2_LDFLAGS = \ + $(LIBMPI_EXTRA_LDFLAGS) \ + $(LIBOMPI_EXTRA_LDFLAGS) +mpirun2_DEPENDENCIES = \ + $(libs) + diff --git a/src/tools/mpirun/mpirun2.cc b/src/tools/mpirun/mpirun2.cc new file mode 100644 index 0000000000..8b2155ef6b --- /dev/null +++ b/src/tools/mpirun/mpirun2.cc @@ -0,0 +1,75 @@ +/* -*- C++ -*- + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "runtime/runtime.h" +#include "mca/base/base.h" +#include "util/cmd_line.h" +#include "include/constants.h" + +#include + + +int +main(int argc, char *argv[]) +{ + bool multi_thread = false; + bool hidden_thread = false; + int ret; + ompi_cmd_line_t *cmd_line = NULL; + + /* + * Intialize our environment + */ + cmd_line = ompi_cmd_line_create(); + + if (OMPI_SUCCESS != ompi_init(argc, argv)) { + /* BWB show_help */ + printf("show_help: ompi_init failed\n"); + return ret; + } + + if (OMPI_SUCCESS != (ret = mca_base_cmd_line_setup(cmd_line))) { + /* BWB show_help */ + printf("show_help: mca_base_cmd_line_setup failed\n"); + return ret; + } + + if (OMPI_SUCCESS != ompi_cmd_line_parse(cmd_line, false, argc, argv) || + ompi_cmd_line_is_taken(cmd_line, "help") || + ompi_cmd_line_is_taken(cmd_line, "h")) { + printf("...showing ompi_info help message...\n"); + exit(1); + } + + if (OMPI_SUCCESS != mca_base_cmd_line_process_args(cmd_line)) { + /* BWB show_help */ + printf("show_help: mca_base_cmd_line_process_args\n"); + return ret; + } + + if (OMPI_SUCCESS != (ret = mca_base_open())) { + /* JMS show_help */ + printf("show_help: mca_base_open failed\n"); + return ret; + } + + if (OMPI_SUCCESS != ompi_rte_init(&multi_thread, &hidden_thread)) { + /* BWB show_help */ + printf("show_help: ompi_rte_init failed\n"); + return ret; + } + + + /* + * Clean up + */ + ompi_rte_finalize(); + mca_base_close(); + ompi_finalize(); + + return 0; +}