Adding preliminary ompi daemon
This commit was SVN r1932.
Этот коммит содержится в:
родитель
2060091238
Коммит
5e22c1edfe
@ -934,6 +934,7 @@ AC_CONFIG_FILES([
|
||||
src/mpi/f90/Makefile
|
||||
|
||||
src/tools/Makefile
|
||||
src/tools/ompid/Makefile
|
||||
src/tools/ompi_info/Makefile
|
||||
src/tools/mpirun/Makefile
|
||||
src/tools/wrappers/Makefile
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
include $(top_srcdir)/config/Makefile.options
|
||||
|
||||
SUBDIRS = ompi_info mpirun wrappers
|
||||
SUBDIRS = ompi_info mpirun wrappers ompid
|
||||
|
||||
DIST_SUBDIRS = $(SUBDIRS) openmpi
|
||||
|
||||
|
38
src/tools/ompid/Makefile.am
Обычный файл
38
src/tools/ompid/Makefile.am
Обычный файл
@ -0,0 +1,38 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
include $(top_srcdir)/config/Makefile.options
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DOMPI_PREFIX="\"$(prefix)\"" \
|
||||
-DOMPI_BINDIR="\"$(bindir)\"" \
|
||||
-DOMPI_LIBDIR="\"$(libdir)\"" \
|
||||
-DOMPI_INCDIR="\"$(includedir)\"" \
|
||||
-DOMPI_PKGLIBDIR="\"$(pkglibdir)\"" \
|
||||
-DOMPI_SYSCONFDIR="\"$(sysconfdir)\"" \
|
||||
-DOMPI_CONFIGURE_USER="\"@OMPI_CONFIGURE_USER@\"" \
|
||||
-DOMPI_CONFIGURE_HOST="\"@OMPI_CONFIGURE_HOST@\"" \
|
||||
-DOMPI_CONFIGURE_DATE="\"@OMPI_CONFIGURE_DATE@\"" \
|
||||
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
|
||||
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
|
||||
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \
|
||||
-DOMPI_BUILD_CXXCPPFLAGS="\"@CXXCPPFLAGS@\"" \
|
||||
-DOMPI_BUILD_FFLAGS="\"@FFLAGS@\"" \
|
||||
-DOMPI_BUILD_FCFLAGS="\"@FCFLAGS@\"" \
|
||||
-DOMPI_BUILD_LDFLAGS="\"@LDFLAGS@\"" \
|
||||
-DOMPI_BUILD_LIBS="\"@LIBS@\""
|
||||
|
||||
libs = $(top_builddir)/src/libmpi.la
|
||||
|
||||
bin_PROGRAMS = ompid
|
||||
ompid_SOURCES = \
|
||||
ompid.h \
|
||||
ompid.cc
|
||||
|
||||
ompid_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS) $(LIBOMPI_EXTRA_LIBS)
|
||||
ompid_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS) $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
ompid_DEPENDENCIES = $(libs)
|
||||
|
||||
clean-local:
|
||||
test -z "$(OMPI_CXX_TEMPLATE_REPOSITORY)" || $(RM) -rf $(OMPI_CXX_TEMPLATE_REPOSITORY)
|
84
src/tools/ompid/base/base.h
Обычный файл
84
src/tools/ompid/base/base.h
Обычный файл
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file:
|
||||
*/
|
||||
|
||||
#ifndef MCA_NS_BASE_H
|
||||
#define MCA_NS_BASE_H
|
||||
|
||||
/*
|
||||
* includes
|
||||
*/
|
||||
#include "ompi_config.h"
|
||||
#include "class/ompi_list.h"
|
||||
#include "mca/mca.h"
|
||||
#include "mca/ns/ns.h"
|
||||
|
||||
|
||||
/*
|
||||
* Global functions for MCA overall collective open and close
|
||||
*/
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
int mca_ns_base_open(void);
|
||||
int mca_ns_base_select(bool *allow_multi_user_threads,
|
||||
bool *have_hidden_threads);
|
||||
int mca_ns_base_close(void);
|
||||
|
||||
/*
|
||||
* Base functions that are common to all implementations - can be overridden
|
||||
*/
|
||||
|
||||
ompi_process_name_t* ns_base_create_process_name(mca_ns_base_cellid_t cell,
|
||||
mca_ns_base_jobid_t job,
|
||||
mca_ns_base_vpid_t vpid);
|
||||
|
||||
char* ns_base_get_proc_name_string(const ompi_process_name_t* name);
|
||||
|
||||
char* ns_base_get_vpid_string(const ompi_process_name_t* name);
|
||||
|
||||
char* ns_base_get_jobid_string(const ompi_process_name_t* name);
|
||||
|
||||
char* ns_base_get_cellid_string(const ompi_process_name_t* name);
|
||||
|
||||
mca_ns_base_vpid_t ns_base_get_vpid(const ompi_process_name_t* name);
|
||||
|
||||
mca_ns_base_jobid_t ns_base_get_jobid(const ompi_process_name_t* name);
|
||||
|
||||
mca_ns_base_cellid_t ns_base_get_cellid(const ompi_process_name_t* name);
|
||||
|
||||
int ns_base_compare(ompi_ns_cmp_bitmask_t fields,
|
||||
const ompi_process_name_t* name1,
|
||||
const ompi_process_name_t* name2);
|
||||
|
||||
mca_ns_base_cellid_t ns_base_create_cellid(void);
|
||||
|
||||
mca_ns_base_jobid_t ns_base_create_jobid(void);
|
||||
|
||||
mca_ns_base_vpid_t ns_base_reserve_range(mca_ns_base_jobid_t job, mca_ns_base_vpid_t range);
|
||||
|
||||
int ns_base_free_name(ompi_process_name_t* name);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* globals that might be needed
|
||||
*/
|
||||
|
||||
extern int mca_ns_base_output;
|
||||
extern mca_ns_base_module_t ompi_name_server; /* holds selected module's function pointers */
|
||||
extern ompi_process_name_t mca_ns_my_replica;
|
||||
extern bool mca_ns_base_selected;
|
||||
extern ompi_list_t mca_ns_base_components_available;
|
||||
extern mca_ns_base_component_t mca_ns_base_selected_component;
|
||||
|
||||
/*
|
||||
* external API functions will be documented in the mca/ns/ns.h file
|
||||
*/
|
||||
|
||||
#endif
|
131
src/tools/ompid/ompid.cc
Обычный файл
131
src/tools/ompid/ompid.cc
Обычный файл
@ -0,0 +1,131 @@
|
||||
//
|
||||
// $HEADER$
|
||||
//
|
||||
/** @file **/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <list>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/param.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "runtime/runtime.h"
|
||||
#include "util/output.h"
|
||||
#include "util/cmd_line.h"
|
||||
#include "communicator/communicator.h"
|
||||
#include "mca/base/base.h"
|
||||
#include "tools/ompid/ompid.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ompid;
|
||||
|
||||
|
||||
//
|
||||
// Public variables
|
||||
//
|
||||
|
||||
bool ompid::pretty = true;
|
||||
ompi_cmd_line_t *ompid::cmd_line = NULL;
|
||||
|
||||
const string ompid::type_all = "all";
|
||||
const string ompid::type_ompi = "ompi";
|
||||
const string ompid::type_base = "base";
|
||||
ompid::type_vector_t ompid::mca_types;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
bool acted = false;
|
||||
bool want_all = false;
|
||||
|
||||
// Start OMPI process
|
||||
|
||||
if (OMPI_SUCCESS != ompi_init(argc, argv)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Initialize the argv parsing handle
|
||||
|
||||
cmd_line = ompi_cmd_line_create();
|
||||
if (NULL == cmd_line) {
|
||||
ret = errno;
|
||||
#if 0
|
||||
show_help(NULL, "lib-call-fail", "ompi_cmd_line_create", NULL);
|
||||
#endif
|
||||
exit(ret);
|
||||
}
|
||||
ompi_cmd_line_make_opt(cmd_line, 'v', "version", 2,
|
||||
"Show version of Open MPI or a component");
|
||||
ompi_cmd_line_make_opt(cmd_line, 'h', "help", 0,
|
||||
"Show this help message");
|
||||
|
||||
// Call some useless functions in order to guarantee to link in some
|
||||
// global variables. Only check the return value so that the
|
||||
// compiler doesn't optimize out the useless function.
|
||||
|
||||
if (OMPI_SUCCESS != ompi_comm_link_function()) {
|
||||
// Stop .. or I'll say stop again!
|
||||
++ret;
|
||||
} else {
|
||||
--ret;
|
||||
}
|
||||
|
||||
// Get MCA parameters, if any */
|
||||
|
||||
mca_base_open();
|
||||
mca_base_cmd_line_setup(cmd_line);
|
||||
|
||||
// Do the parsing
|
||||
|
||||
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")) {
|
||||
#if 1
|
||||
printf("...showing ompid help message...\n");
|
||||
#else
|
||||
show_help("ompid", "usage", NULL);
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
||||
mca_base_cmd_line_process_args(cmd_line);
|
||||
|
||||
ompid::mca_types.push_back("base");
|
||||
|
||||
|
||||
// Execute the desired action(s)
|
||||
|
||||
if (ompi_cmd_line_is_taken(cmd_line, "version")) {
|
||||
//do_version(want_all, cmd_line);
|
||||
acted = true;
|
||||
}
|
||||
|
||||
|
||||
// If no command line args are specified, show default set
|
||||
|
||||
if (!acted) {
|
||||
//ompid::show_ompi_version(ver_full);
|
||||
}
|
||||
|
||||
// Add in the calls to start up the RTE
|
||||
|
||||
// Add in the calls to initialize the services
|
||||
|
||||
// Add the swection for the event loop...
|
||||
|
||||
// All done
|
||||
|
||||
//ompid::close_components();
|
||||
ompi_cmd_line_free(cmd_line);
|
||||
mca_base_close();
|
||||
ompi_finalize();
|
||||
return 0;
|
||||
}
|
99
src/tools/ompid/ompid.h
Обычный файл
99
src/tools/ompid/ompid.h
Обычный файл
@ -0,0 +1,99 @@
|
||||
//
|
||||
// $HEADER$
|
||||
//
|
||||
|
||||
#ifndef OMPID_H
|
||||
#define OMPID_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "class/ompi_list.h"
|
||||
#include "util/cmd_line.h"
|
||||
#include "mca/mca.h"
|
||||
|
||||
|
||||
namespace ompid {
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
|
||||
typedef std::vector<std::string> type_vector_t;
|
||||
|
||||
extern bool pretty;
|
||||
extern ompi_cmd_line_t *cmd_line;
|
||||
|
||||
extern const std::string type_all;
|
||||
extern const std::string type_ompi;
|
||||
extern const std::string type_base;
|
||||
extern type_vector_t mca_types;
|
||||
|
||||
//
|
||||
// Version-related strings and functions
|
||||
//
|
||||
|
||||
extern const std::string ver_full;
|
||||
extern const std::string ver_major;
|
||||
extern const std::string ver_minor;
|
||||
extern const std::string ver_release;
|
||||
extern const std::string ver_alpha;
|
||||
extern const std::string ver_beta;
|
||||
extern const std::string ver_svn;
|
||||
|
||||
void do_version(bool want_all, ompi_cmd_line_t *cmd_line);
|
||||
void show_ompi_version(const std::string& scope);
|
||||
void show_component_version(const std::string& type_name,
|
||||
const std::string& component_name,
|
||||
const std::string& scope,
|
||||
const std::string& ver_type);
|
||||
|
||||
//
|
||||
// Parameter/configuration-related functions
|
||||
//
|
||||
|
||||
extern std::string component_all;
|
||||
extern std::string param_all;
|
||||
|
||||
extern std::string path_prefix;
|
||||
extern std::string path_bindir;
|
||||
extern std::string path_libdir;
|
||||
extern std::string path_incdir;
|
||||
extern std::string path_pkglibdir;
|
||||
extern std::string path_sysconfdir;
|
||||
|
||||
void do_params();
|
||||
void show_mca_params(const std::string& type, const std::string& component,
|
||||
const std::string& param);
|
||||
|
||||
void do_path(bool want_all, ompi_cmd_line_t *cmd_line);
|
||||
void show_path(const std::string& type, const std::string& value);
|
||||
|
||||
void do_arch(ompi_cmd_line_t *cmd_line);
|
||||
void do_config(bool want_all);
|
||||
|
||||
//
|
||||
// Output-related functions
|
||||
//
|
||||
void out(const std::string& pretty_message,
|
||||
const std::string &plain_message,
|
||||
int value);
|
||||
void out(const std::string& pretty_message,
|
||||
const std::string &plain_message,
|
||||
const std::string& value);
|
||||
|
||||
//
|
||||
// Component-related functions
|
||||
//
|
||||
|
||||
typedef std::map<std::string, ompi_list_t *> component_map_t;
|
||||
|
||||
extern component_map_t component_map;
|
||||
|
||||
//void open_components();
|
||||
//void close_components();
|
||||
|
||||
}
|
||||
|
||||
#endif /* OMPID_H */
|
Загрузка…
Ссылка в новой задаче
Block a user