1
1
Functionality moved to PMIx

Signed-off-by: Ralph Castain <rhc@open-mpi.org>
(cherry picked from commit cfdd08d309d9ebc48229f0ca68ceec64a7e6389f)
Этот коммит содержится в:
Ralph Castain 2018-10-02 11:54:57 -07:00 коммит произвёл Ralph Castain
родитель 861016c3b2
Коммит 2536b4f869
54 изменённых файлов: 32 добавлений и 8034 удалений

Просмотреть файл

@ -1,27 +0,0 @@
#
# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# main library setup
noinst_LTLIBRARIES = libmca_dfs.la
libmca_dfs_la_SOURCES =
# local files
headers = dfs.h dfs_types.h
libmca_dfs_la_SOURCES += $(headers)
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ortedir = $(orteincludedir)/$(subdir)
nobase_orte_HEADERS = $(headers)
endif
include base/Makefile.am
distclean-local:
rm -f base/static-components.h

Просмотреть файл

@ -1,36 +0,0 @@
#
# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
# Copyright (c) 2017 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources = \
dfs_app.h \
dfs_app_component.c \
dfs_app.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_orte_dfs_app_DSO
component_noinst =
component_install = mca_dfs_app.la
else
component_noinst = libmca_dfs_app.la
component_install =
endif
mcacomponentdir = $(ortelibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_dfs_app_la_SOURCES = $(sources)
mca_dfs_app_la_LDFLAGS = -module -avoid-version
mca_dfs_app_la_LIBADD = $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la
noinst_LTLIBRARIES = $(component_noinst)
libmca_dfs_app_la_SOURCES =$(sources)
libmca_dfs_app_la_LDFLAGS = -module -avoid-version

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,35 +0,0 @@
/*
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
*/
#ifndef MCA_dfs_app_EXPORT_H
#define MCA_dfs_app_EXPORT_H
#include "orte_config.h"
#include "orte/mca/dfs/dfs.h"
BEGIN_C_DECLS
/*
* Local Component structures
*/
ORTE_MODULE_DECLSPEC extern orte_dfs_base_component_t mca_dfs_app_component;
ORTE_DECLSPEC extern orte_dfs_base_module_t orte_dfs_app_module;
END_C_DECLS
#endif /* MCA_dfs_app_EXPORT_H */

Просмотреть файл

@ -1,85 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
*
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "opal/util/output.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/dfs/dfs.h"
#include "orte/mca/dfs/base/base.h"
#include "dfs_app.h"
/*
* Public string for version number
*/
const char *orte_dfs_app_component_version_string =
"ORTE DFS app MCA component version " ORTE_VERSION;
/*
* Local functionality
*/
static int dfs_app_open(void);
static int dfs_app_close(void);
static int dfs_app_component_query(mca_base_module_t **module, int *priority);
/*
* Instantiate the public struct with all of our public information
* and pointer to our public functions in it
*/
orte_dfs_base_component_t mca_dfs_app_component =
{
/* Handle the general mca_component_t struct containing
* meta information about the component
*/
.base_version = {
ORTE_DFS_BASE_VERSION_1_0_0,
/* Component name and version */
.mca_component_name = "app",
MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION),
/* Component open and close functions */
.mca_open_component = dfs_app_open,
.mca_close_component = dfs_app_close,
.mca_query_component = dfs_app_component_query,
},
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
static int dfs_app_open(void)
{
return ORTE_SUCCESS;
}
static int dfs_app_close(void)
{
return ORTE_SUCCESS;
}
static int dfs_app_component_query(mca_base_module_t **module, int *priority)
{
if (ORTE_PROC_IS_APP) {
/* set our priority high as we are the default for apps */
*priority = 1000;
*module = (mca_base_module_t *)&orte_dfs_app_module;
return ORTE_SUCCESS;
}
*priority = -1;
*module = NULL;
return ORTE_ERROR;
}

Просмотреть файл

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

Просмотреть файл

@ -1,15 +0,0 @@
#
# Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
headers += \
base/base.h
libmca_dfs_la_SOURCES += \
base/dfs_base_select.c \
base/dfs_base_frame.c

Просмотреть файл

@ -1,82 +0,0 @@
/*
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*/
#ifndef ORTE_MCA_DFS_BASE_H
#define ORTE_MCA_DFS_BASE_H
/*
* includes
*/
#include "orte_config.h"
#include "orte/types.h"
#include "orte/constants.h"
#include "opal/class/opal_list.h"
#include "opal/mca/event/event.h"
#include "orte/mca/mca.h"
#include "orte/mca/dfs/dfs.h"
BEGIN_C_DECLS
/*
* MCA Framework
*/
ORTE_DECLSPEC extern mca_base_framework_t orte_dfs_base_framework;
/* select a component */
ORTE_DECLSPEC int orte_dfs_base_select(void);
/* tracker for active files */
typedef struct {
opal_list_item_t super;
orte_process_name_t requestor;
orte_process_name_t host_daemon;
char *uri;
char *scheme;
char *filename;
int local_fd;
int remote_fd;
size_t location;
} orte_dfs_tracker_t;
OBJ_CLASS_DECLARATION(orte_dfs_tracker_t);
/* requests */
typedef struct {
opal_list_item_t super;
opal_event_t ev;
uint64_t id;
orte_dfs_cmd_t cmd;
orte_process_name_t target;
char *uri;
int local_fd;
int remote_fd;
uint8_t *read_buffer;
long read_length;
opal_buffer_t *bptr;
opal_buffer_t bucket;
orte_dfs_open_callback_fn_t open_cbfunc;
orte_dfs_close_callback_fn_t close_cbfunc;
orte_dfs_size_callback_fn_t size_cbfunc;
orte_dfs_seek_callback_fn_t seek_cbfunc;
orte_dfs_read_callback_fn_t read_cbfunc;
orte_dfs_post_callback_fn_t post_cbfunc;
orte_dfs_fm_callback_fn_t fm_cbfunc;
orte_dfs_load_callback_fn_t load_cbfunc;
orte_dfs_purge_callback_fn_t purge_cbfunc;
void *cbdata;
} orte_dfs_request_t;
OBJ_CLASS_DECLARATION(orte_dfs_request_t);
END_C_DECLS
#endif

Просмотреть файл

@ -1,163 +0,0 @@
/*
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2013 Intel, Inc. All rights reserved
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/constants.h"
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "orte/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/util/opal_environ.h"
#include "opal/util/output.h"
#include "orte/util/show_help.h"
#include "orte/mca/dfs/base/base.h"
#include "orte/mca/dfs/base/static-components.h"
/*
* Globals
*/
orte_dfs_base_module_t orte_dfs = {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
static int orte_dfs_base_close(void)
{
/* Close selected component */
if (NULL != orte_dfs.finalize) {
orte_dfs.finalize();
}
return mca_base_framework_components_close(&orte_dfs_base_framework, NULL);
}
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
static int orte_dfs_base_open(mca_base_open_flag_t flags)
{
/* Open up all available components */
return mca_base_framework_components_open(&orte_dfs_base_framework, flags);
}
MCA_BASE_FRAMEWORK_DECLARE(orte, dfs, "ORTE Distributed File System",
NULL, orte_dfs_base_open, orte_dfs_base_close,
mca_dfs_base_static_components, 0);
/* instantiate classes */
static void trk_con(orte_dfs_tracker_t *trk)
{
trk->host_daemon.jobid = ORTE_JOBID_INVALID;
trk->host_daemon.vpid = ORTE_VPID_INVALID;
trk->uri = NULL;
trk->scheme = NULL;
trk->filename = NULL;
trk->location = 0;
}
static void trk_des(orte_dfs_tracker_t *trk)
{
if (NULL != trk->uri) {
free(trk->uri);
}
if (NULL != trk->scheme) {
free(trk->scheme);
}
if (NULL != trk->filename) {
free(trk->filename);
}
}
OBJ_CLASS_INSTANCE(orte_dfs_tracker_t,
opal_list_item_t,
trk_con, trk_des);
static void req_const(orte_dfs_request_t *dfs)
{
dfs->id = 0;
dfs->uri = NULL;
dfs->local_fd = -1;
dfs->remote_fd = -1;
dfs->read_length = -1;
dfs->bptr = NULL;
OBJ_CONSTRUCT(&dfs->bucket, opal_buffer_t);
dfs->read_buffer = NULL;
dfs->open_cbfunc = NULL;
dfs->close_cbfunc = NULL;
dfs->size_cbfunc = NULL;
dfs->seek_cbfunc = NULL;
dfs->read_cbfunc = NULL;
dfs->post_cbfunc = NULL;
dfs->fm_cbfunc = NULL;
dfs->load_cbfunc = NULL;
dfs->purge_cbfunc = NULL;
dfs->cbdata = NULL;
}
static void req_dest(orte_dfs_request_t *dfs)
{
if (NULL != dfs->uri) {
free(dfs->uri);
}
OBJ_DESTRUCT(&dfs->bucket);
}
OBJ_CLASS_INSTANCE(orte_dfs_request_t,
opal_list_item_t,
req_const, req_dest);
static void jobfm_const(orte_dfs_jobfm_t *fm)
{
OBJ_CONSTRUCT(&fm->maps, opal_list_t);
}
static void jobfm_dest(orte_dfs_jobfm_t *fm)
{
opal_list_item_t *item;
while (NULL != (item = opal_list_remove_first(&fm->maps))) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&fm->maps);
}
OBJ_CLASS_INSTANCE(orte_dfs_jobfm_t,
opal_list_item_t,
jobfm_const, jobfm_dest);
static void vpidfm_const(orte_dfs_vpidfm_t *fm)
{
OBJ_CONSTRUCT(&fm->data, opal_buffer_t);
fm->num_entries = 0;
}
static void vpidfm_dest(orte_dfs_vpidfm_t *fm)
{
OBJ_DESTRUCT(&fm->data);
}
OBJ_CLASS_INSTANCE(orte_dfs_vpidfm_t,
opal_list_item_t,
vpidfm_const, vpidfm_dest);

Просмотреть файл

@ -1,56 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/constants.h"
#include <string.h>
#include "orte/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/util/output.h"
#include "orte/mca/dfs/base/base.h"
int orte_dfs_base_select(void)
{
int exit_status = ORTE_SUCCESS;
orte_dfs_base_component_t *best_component = NULL;
orte_dfs_base_module_t *best_module = NULL;
/*
* Select the best component
*/
if (OPAL_SUCCESS != mca_base_select("dfs", orte_dfs_base_framework.framework_output,
&orte_dfs_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component, NULL)) {
/* This will only happen if no component was selected, which
* is okay - we don't have to select anything
*/
return ORTE_SUCCESS;
}
/* Save the winner */
orte_dfs = *best_module;
/* Initialize the winner */
if (NULL != best_module && NULL != orte_dfs.init) {
if (ORTE_SUCCESS != orte_dfs.init()) {
exit_status = ORTE_ERROR;
goto cleanup;
}
}
cleanup:
return exit_status;
}

Просмотреть файл

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

Просмотреть файл

@ -1,184 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef ORTE_MCA_DFS_H
#define ORTE_MCA_DFS_H
#include "orte_config.h"
#include "orte/types.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "orte/mca/mca.h"
#include "opal/mca/base/base.h"
#include "orte/mca/dfs/dfs_types.h"
BEGIN_C_DECLS
/*
* Framework Interfaces
*/
/**
* Module initialization function.
*
* @retval ORTE_SUCCESS The operation completed successfully
* @retval ORTE_ERROR An unspecifed error occurred
*/
typedef int (*orte_dfs_base_module_init_fn_t)(void);
/**
* Module finalization function.
*
* @retval ORTE_SUCCESS The operation completed successfully
* @retval ORTE_ERROR An unspecifed error occurred
*/
typedef int (*orte_dfs_base_module_finalize_fn_t)(void);
/* Open a file
*
* Open a possibly remote file for reading. The uri can include file
* system descriptions (e.g., file:///, nfs:///, or hdfs:///). Note
* that this is a full uri - i.e., it may include a hostname to
* indicate where the file is located
*
* The file descriptor will be returned in the cbfunc. It
* represents the number by which the file can be referenced,
* and will be an ORTE error code upon failure
*/
typedef void (*orte_dfs_base_module_open_fn_t)(char *uri,
orte_dfs_open_callback_fn_t cbfunc,
void *cbdata);
/* Close a file
*
* Closes and invalidates the file descriptor
*/
typedef void (*orte_dfs_base_module_close_fn_t)(int fd,
orte_dfs_close_callback_fn_t cbfunc,
void *cbdata);
/* Get the size of a file
*
*/
typedef void (*orte_dfs_base_module_get_file_size_fn_t)(int fd,
orte_dfs_size_callback_fn_t cbfunc,
void *cbdata);
/* Position a file
*
* Move the read position in the file to the specified byte number
* relative to the location specified by whence:
* SEEK_SET => from beginning of file
* SEEK_CUR => from current location
*
* The callback will return the offset, or a negative value if
* the requested seek would take the pointer past the end of the
* file. This is contrary to standard lseek behavior, but is consistent
* with the read-only nature of this framework
*/
typedef void (*orte_dfs_base_module_seek_fn_t)(int fd, long offset, int whence,
orte_dfs_seek_callback_fn_t cbfunc,
void *cbdata);
/* Read bytes from a possibly remote file
*
* Read the specified number of bytes from the given file, using the
* specified offset (in bytes). The status returned in cbfunc is the actual number
* of bytes read, which should match the request unless the requested
* length/offset would read past the end of file. An ORTE error code
* will be returned upon error
*
* Note: the caller is responsible for ensuring the buffer is at least
* length bytes in size
*/
typedef void (*orte_dfs_base_module_read_fn_t)(int fd, uint8_t *buffer,
long length,
orte_dfs_read_callback_fn_t cbfunc,
void *cbdata);
/* Post a file map so others may access it */
typedef void (*orte_dfs_base_module_post_file_map_fn_t)(opal_buffer_t *buf,
orte_dfs_post_callback_fn_t cbfunc,
void *cbdata);
/* Get the file map for a process
*
* Returns the file map associated with the specified process name. If
* NULL is provided, then all known process maps will be returned in the
* byte object. It is the responsibility of the caller to unpack it, so
* applications are free to specify whatever constitutes a "file map" that
* suits their purposes
*/
typedef void (*orte_dfs_base_module_get_file_map_fn_t)(orte_process_name_t *target,
orte_dfs_fm_callback_fn_t cbfunc,
void *cbdata);
/* Load file maps for a job
*/
typedef void (*orte_dfs_base_module_load_file_maps_fn_t)(orte_jobid_t jobid,
opal_buffer_t *buf,
orte_dfs_load_callback_fn_t cbfunc,
void *cbdata);
/* Purge file maps for a job */
typedef void (*orte_dfs_base_module_purge_file_maps_fn_t)(orte_jobid_t jobid,
orte_dfs_purge_callback_fn_t cbfunc,
void *cbdata);
/*
* Module Structure
*/
struct orte_dfs_base_module_1_0_0_t {
/** Initialization Function */
orte_dfs_base_module_init_fn_t init;
/** Finalization Function */
orte_dfs_base_module_finalize_fn_t finalize;
orte_dfs_base_module_open_fn_t open;
orte_dfs_base_module_close_fn_t close;
orte_dfs_base_module_get_file_size_fn_t get_file_size;
orte_dfs_base_module_seek_fn_t seek;
orte_dfs_base_module_read_fn_t read;
orte_dfs_base_module_post_file_map_fn_t post_file_map;
orte_dfs_base_module_get_file_map_fn_t get_file_map;
orte_dfs_base_module_load_file_maps_fn_t load_file_maps;
orte_dfs_base_module_purge_file_maps_fn_t purge_file_maps;
};
typedef struct orte_dfs_base_module_1_0_0_t orte_dfs_base_module_1_0_0_t;
typedef orte_dfs_base_module_1_0_0_t orte_dfs_base_module_t;
ORTE_DECLSPEC extern orte_dfs_base_module_t orte_dfs;
/*
* DFS Component
*/
struct orte_dfs_base_component_1_0_0_t {
/** MCA base component */
mca_base_component_t base_version;
/** MCA base data */
mca_base_component_data_t base_data;
};
typedef struct orte_dfs_base_component_1_0_0_t orte_dfs_base_component_1_0_0_t;
typedef orte_dfs_base_component_1_0_0_t orte_dfs_base_component_t;
/*
* Macro for use in components that are of type errmgr
*/
#define ORTE_DFS_BASE_VERSION_1_0_0 \
ORTE_MCA_BASE_VERSION_2_1_0("dfs", 1, 0, 0)
END_C_DECLS
#endif

Просмотреть файл

@ -1,76 +0,0 @@
/*
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef ORTE_MCA_DFS_TYPES_H
#define ORTE_MCA_DFS_TYPES_H
#include "orte_config.h"
#include "opal/class/opal_list.h"
#include "opal/dss/dss_types.h"
#include "opal/util/proc.h"
BEGIN_C_DECLS
typedef uint8_t orte_dfs_cmd_t;
#define ORTE_DFS_CMD_T OPAL_UINT8
#define ORTE_DFS_OPEN_CMD 1
#define ORTE_DFS_CLOSE_CMD 2
#define ORTE_DFS_SIZE_CMD 3
#define ORTE_DFS_SEEK_CMD 4
#define ORTE_DFS_READ_CMD 5
#define ORTE_DFS_POST_CMD 6
#define ORTE_DFS_GETFM_CMD 7
#define ORTE_DFS_LOAD_CMD 8
#define ORTE_DFS_PURGE_CMD 9
#define ORTE_DFS_RELAY_POSTS_CMD 10
/* file maps */
typedef struct {
opal_list_item_t super;
orte_jobid_t jobid;
opal_list_t maps;
} orte_dfs_jobfm_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_dfs_jobfm_t);
typedef struct {
opal_list_item_t super;
orte_vpid_t vpid;
int num_entries;
opal_buffer_t data;
} orte_dfs_vpidfm_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_dfs_vpidfm_t);
typedef void (*orte_dfs_open_callback_fn_t)(int fd, void *cbdata);
typedef void (*orte_dfs_close_callback_fn_t)(int fd, void *cbdata);
typedef void (*orte_dfs_size_callback_fn_t)(long size, void *cbdata);
typedef void (*orte_dfs_seek_callback_fn_t)(long offset, void *cbdata);
typedef void (*orte_dfs_read_callback_fn_t)(long status,
uint8_t *buffer,
void *cbdata);
typedef void (*orte_dfs_post_callback_fn_t)(void *cbdata);
typedef void (*orte_dfs_fm_callback_fn_t)(opal_buffer_t *fmaps, void *cbdata);
typedef void (*orte_dfs_load_callback_fn_t)(void *cbdata);
typedef void (*orte_dfs_purge_callback_fn_t)(void *cbdata);
END_C_DECLS
#endif

Просмотреть файл

@ -1,36 +0,0 @@
#
# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
# Copyright (c) 2017 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources = \
dfs_orted.h \
dfs_orted_component.c \
dfs_orted.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_orte_dfs_orted_DSO
component_noinst =
component_install = mca_dfs_orted.la
else
component_noinst = libmca_dfs_orted.la
component_install =
endif
mcacomponentdir = $(ortelibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_dfs_orted_la_SOURCES = $(sources)
mca_dfs_orted_la_LDFLAGS = -module -avoid-version
mca_dfs_orted_la_LIBADD = $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la
noinst_LTLIBRARIES = $(component_noinst)
libmca_dfs_orted_la_SOURCES =$(sources)
libmca_dfs_orted_la_LDFLAGS = -module -avoid-version

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,38 +0,0 @@
/*
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
*/
#ifndef MCA_dfs_orted_EXPORT_H
#define MCA_dfs_orted_EXPORT_H
#include "orte_config.h"
#include "orte/mca/dfs/dfs.h"
BEGIN_C_DECLS
/*
* Local Component structures
*/
ORTE_MODULE_DECLSPEC extern orte_dfs_base_component_t mca_dfs_orted_component;
ORTE_DECLSPEC extern orte_dfs_base_module_t orte_dfs_orted_module;
extern int orte_dfs_orted_num_worker_threads;
END_C_DECLS
#endif /* MCA_dfs_orted_EXPORT_H */

Просмотреть файл

@ -1,101 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "opal/util/output.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/dfs/dfs.h"
#include "orte/mca/dfs/base/base.h"
#include "dfs_orted.h"
/*
* Public string for version number
*/
const char *orte_dfs_orted_component_version_string =
"ORTE DFS orted MCA component version " ORTE_VERSION;
int orte_dfs_orted_num_worker_threads = 0;
/*
* Local functionality
*/
static int dfs_orted_register(void);
static int dfs_orted_open(void);
static int dfs_orted_close(void);
static int dfs_orted_component_query(mca_base_module_t **module, int *priority);
/*
* Instantiate the public struct with all of our public information
* and pointer to our public functions in it
*/
orte_dfs_base_component_t mca_dfs_orted_component =
{
/* Handle the general mca_component_t struct containing
* meta information about the component itdefault_orted
*/
.base_version = {
ORTE_DFS_BASE_VERSION_1_0_0,
/* Component name and version */
.mca_component_name = "orted",
MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION),
/* Component open and close functions */
.mca_open_component = dfs_orted_open,
.mca_close_component = dfs_orted_close,
.mca_query_component = dfs_orted_component_query,
.mca_register_component_params = dfs_orted_register,
},
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
static int dfs_orted_register(void)
{
orte_dfs_orted_num_worker_threads = 0;
(void) mca_base_component_var_register(&mca_dfs_orted_component.base_version, "num_worker_threads",
"Number of worker threads to use for processing file requests",
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
&orte_dfs_orted_num_worker_threads);
return ORTE_SUCCESS;
}
static int dfs_orted_open(void)
{
return ORTE_SUCCESS;
}
static int dfs_orted_close(void)
{
return ORTE_SUCCESS;
}
static int dfs_orted_component_query(mca_base_module_t **module, int *priority)
{
if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
/* we are the default component for daemons and HNP */
*priority = 1000;
*module = (mca_base_module_t *)&orte_dfs_orted_module;
return ORTE_SUCCESS;
}
*priority = -1;
*module = NULL;
return ORTE_ERROR;
}

Просмотреть файл

@ -1,7 +0,0 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: maintenance

Просмотреть файл

@ -1,36 +0,0 @@
#
# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
# Copyright (c) 2017 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources = \
dfs_test.h \
dfs_test_component.c \
dfs_test.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_orte_dfs_test_DSO
component_noinst =
component_install = mca_dfs_test.la
else
component_noinst = libmca_dfs_test.la
component_install =
endif
mcacomponentdir = $(ortelibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_dfs_test_la_SOURCES = $(sources)
mca_dfs_test_la_LDFLAGS = -module -avoid-version
mca_dfs_test_la_LIBADD = $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la
noinst_LTLIBRARIES = $(component_noinst)
libmca_dfs_test_la_SOURCES =$(sources)
libmca_dfs_test_la_LDFLAGS = -module -avoid-version

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,35 +0,0 @@
/*
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
*/
#ifndef MCA_dfs_test_EXPORT_H
#define MCA_dfs_test_EXPORT_H
#include "orte_config.h"
#include "orte/mca/dfs/dfs.h"
BEGIN_C_DECLS
/*
* Local Component structures
*/
ORTE_MODULE_DECLSPEC extern orte_dfs_base_component_t mca_dfs_test_component;
ORTE_DECLSPEC extern orte_dfs_base_module_t orte_dfs_test_module;
END_C_DECLS
#endif /* MCA_dfs_test_EXPORT_H */

Просмотреть файл

@ -1,100 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "opal/util/output.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/dfs/dfs.h"
#include "orte/mca/dfs/base/base.h"
#include "dfs_test.h"
/*
* Public string for version number
*/
const char *orte_dfs_test_component_version_string =
"ORTE DFS test MCA component version " ORTE_VERSION;
/*
* Local functionality
*/
static int dfs_test_register(void);
static int dfs_test_open(void);
static int dfs_test_close(void);
static int dfs_test_component_query(mca_base_module_t **module, int *priority);
/*
* Instantiate the public struct with all of our public information
* and pointer to our public functions in it
*/
orte_dfs_base_component_t mca_dfs_test_component =
{
/* Handle the general mca_component_t struct containing
* meta information about the component
*/
.base_version = {
ORTE_DFS_BASE_VERSION_1_0_0,
/* Component name and version */
.mca_component_name = "test",
MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION),
/* Component open and close functions */
.mca_open_component = dfs_test_open,
.mca_close_component = dfs_test_close,
.mca_query_component = dfs_test_component_query,
.mca_register_component_params = dfs_test_register,
},
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
static bool select_me = false;
static int dfs_test_register(void)
{
select_me = false;
(void) mca_base_component_var_register(&mca_dfs_test_component.base_version, "select",
"Apps select the test plug-in for the DFS framework",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_ALL_EQ, &select_me);
return ORTE_SUCCESS;
}
static int dfs_test_open(void)
{
return ORTE_SUCCESS;
}
static int dfs_test_close(void)
{
return ORTE_SUCCESS;
}
static int dfs_test_component_query(mca_base_module_t **module, int *priority)
{
if (ORTE_PROC_IS_APP && select_me) {
/* set our priority high so apps use us */
*priority = 10000;
*module = (mca_base_module_t *)&orte_dfs_test_module;
return ORTE_SUCCESS;
}
*priority = -1;
*module = NULL;
return ORTE_ERROR;
}

Просмотреть файл

@ -45,7 +45,7 @@ static int rte_finalize(void);
orte_ess_base_module_t orte_ess_alps_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
NULL,
NULL /* ft_event */
};

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow

Просмотреть файл

@ -52,7 +52,6 @@
#include "orte/mca/routed/base/base.h"
#include "orte/mca/routed/routed.h"
#include "orte/mca/oob/base/base.h"
#include "orte/mca/dfs/base/base.h"
#include "orte/mca/grpcomm/grpcomm.h"
#include "orte/mca/grpcomm/base/base.h"
#include "orte/mca/iof/base/base.h"
@ -621,18 +620,6 @@ int orte_ess_base_orted_setup(void)
goto error;
}
/* setup the DFS framework */
if (ORTE_SUCCESS != (ret = mca_base_framework_open(&orte_dfs_base_framework, 0))) {
ORTE_ERROR_LOG(ret);
error = "orte_dfs_base_open";
goto error;
}
if (ORTE_SUCCESS != (ret = orte_dfs_base_select())) {
ORTE_ERROR_LOG(ret);
error = "orte_dfs_select";
goto error;
}
return ORTE_SUCCESS;
error:
@ -684,8 +671,6 @@ int orte_ess_base_orted_finalize(void)
(void) mca_base_framework_close(&orte_iof_base_framework);
(void) mca_base_framework_close(&orte_errmgr_base_framework);
(void) mca_base_framework_close(&orte_plm_base_framework);
/* close the dfs so its threads can exit */
(void) mca_base_framework_close(&orte_dfs_base_framework);
/* make sure our local procs are dead */
orte_odls.kill_local_procs(NULL);
(void) mca_base_framework_close(&orte_rtc_base_framework);

2
orte/mca/ess/env/ess_env_module.c поставляемый
Просмотреть файл

@ -77,7 +77,7 @@ static int rte_finalize(void);
orte_ess_base_module_t orte_ess_env_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
NULL,
NULL
};

Просмотреть файл

@ -62,7 +62,6 @@
#include "orte/mca/routed/base/base.h"
#include "orte/mca/routed/routed.h"
#include "orte/mca/rtc/base/base.h"
#include "orte/mca/dfs/base/base.h"
#include "orte/mca/errmgr/base/base.h"
#include "orte/mca/grpcomm/base/base.h"
#include "orte/mca/iof/base/base.h"
@ -699,18 +698,6 @@ static int rte_init(void)
goto error;
}
/* setup the dfs framework */
if (ORTE_SUCCESS != (ret = mca_base_framework_open(&orte_dfs_base_framework, 0))) {
ORTE_ERROR_LOG(ret);
error = "orte_dfs_base_open";
goto error;
}
if (ORTE_SUCCESS != (ret = orte_dfs_base_select())) {
ORTE_ERROR_LOG(ret);
error = "orte_dfs_select";
goto error;
}
/* setup to support debugging */
orte_state.add_job_state(ORTE_JOB_STATE_READY_FOR_DEBUGGERS,
orte_debugger_init_after_spawn,
@ -795,7 +782,6 @@ static int rte_finalize(void)
/* shutdown the pmix server */
pmix_server_finalize();
(void) mca_base_framework_close(&opal_pmix_base_framework);
(void) mca_base_framework_close(&orte_dfs_base_framework);
(void) mca_base_framework_close(&orte_filem_base_framework);
/* output any lingering stdout/err data */
fflush(stdout);

Просмотреть файл

@ -53,7 +53,7 @@ static int rte_finalize(void);
orte_ess_base_module_t orte_ess_lsf_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
NULL,
NULL /* ft_event */
};

Просмотреть файл

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016-2017 Research Organization for Information Science
@ -68,11 +68,12 @@
static int rte_init(void);
static int rte_finalize(void);
static void rte_abort(int status, bool report);
orte_ess_base_module_t orte_ess_singleton_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
rte_abort,
NULL /* ft_event */
};
@ -773,3 +774,25 @@ static int fork_hnp(void)
return ORTE_SUCCESS;
}
}
static void rte_abort(int status, bool report)
{
struct timespec tp = {0, 100000};
OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output,
"%s ess:singleton:abort: abort with status %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
status));
/* PMI doesn't like NULL messages, but our interface
* doesn't provide one - so rig one up here
*/
opal_pmix.abort(status, "N/A", NULL);
/* provide a little delay for the PMIx thread to
* get the info out */
nanosleep(&tp, NULL);
/* Now Exit */
_exit(status);
}

Просмотреть файл

@ -54,7 +54,7 @@ static int rte_finalize(void);
orte_ess_base_module_t orte_ess_slurm_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
NULL,
NULL /* ft_event */
};

Просмотреть файл

@ -53,7 +53,7 @@ static int rte_finalize(void);
orte_ess_base_module_t orte_ess_tm_module = {
rte_init,
rte_finalize,
orte_ess_base_app_abort,
NULL,
NULL /* ft_event */
};

Просмотреть файл

@ -1,39 +0,0 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# 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 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# main library setup
noinst_LTLIBRARIES = libmca_notifier.la
libmca_notifier_la_SOURCES =
# local files
headers = notifier.h
libmca_notifier_la_SOURCES += $(headers)
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ortedir = $(includedir)/openmpi/$(subdir)
nobase_orte_HEADERS = $(headers)
endif
include base/Makefile.am
distclean-local:
rm -f base/static-components.h

Просмотреть файл

@ -1,27 +0,0 @@
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# 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) 2009 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
headers += \
base/base.h
libmca_notifier_la_SOURCES += \
base/notifier_base_frame.c \
base/notifier_base_select.c \
base/notifier_base_fns.c

Просмотреть файл

@ -1,87 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2009 Cisco Systems, Inc. All rights reserved.
*
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*/
#ifndef MCA_NOTIFIER_BASE_H
#define MCA_NOTIFIER_BASE_H
/*
* includes
*/
#include "orte_config.h"
#include "opal/class/opal_list.h"
#include "opal/mca/base/base.h"
#include "opal/mca/event/event.h"
#include "orte/mca/notifier/notifier.h"
BEGIN_C_DECLS
/*
* MCA Framework
*/
ORTE_DECLSPEC extern mca_base_framework_t orte_notifier_base_framework;
typedef struct {
opal_event_base_t *ev_base;
bool ev_base_active;
opal_list_t modules;
orte_notifier_severity_t severity_level;
char *default_actions;
char *emerg_actions;
char *alert_actions;
char *crit_actions;
char *warn_actions;
char *notice_actions;
char *info_actions;
char *debug_actions;
char *error_actions;
} orte_notifier_base_t;
/*
* Type for holding selected module / component pairs
*/
typedef struct {
opal_list_item_t super;
/* Component */
orte_notifier_base_component_t *component;
/* Module */
orte_notifier_base_module_t *module;
} orte_notifier_active_module_t;
OBJ_CLASS_DECLARATION(orte_notifier_active_module_t);
ORTE_DECLSPEC extern orte_notifier_base_t orte_notifier_base;
/* select a component */
ORTE_DECLSPEC int orte_notifier_base_select(void);
/* base functions */
ORTE_DECLSPEC void orte_notifier_base_log(int sd, short args, void *cbdata);
ORTE_DECLSPEC void orte_notifier_base_event(int sd, short args, void *cbdata);
ORTE_DECLSPEC void orte_notifier_base_report(int sd, short args, void *cbdata);
/* severity to string */
ORTE_DECLSPEC const char* orte_notifier_base_sev2str(orte_notifier_severity_t severity);
END_C_DECLS
#endif

Просмотреть файл

@ -1,200 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2008-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/constants.h"
#include "opal/util/argv.h"
#include "orte/util/attr.h"
#include "orte/util/threads.h"
#include "orte/mca/notifier/base/base.h"
static void orte_notifier_base_identify_modules(char ***modules,
orte_notifier_request_t *req);
void orte_notifier_base_log(int sd, short args, void *cbdata)
{
orte_notifier_request_t *req = (orte_notifier_request_t*)cbdata;
char **modules = NULL;
orte_notifier_active_module_t *imod;
int i;
ORTE_ACQUIRE_OBJECT(req);
/* if no modules are active, then there is nothing to do */
if (0 == opal_list_get_size(&orte_notifier_base.modules)) {
return;
}
/* check if the severity is >= severity level set for
* reporting - note that the severity enum value goes up
* as severity goes down */
if (orte_notifier_base.severity_level < req->severity ) {
return;
}
orte_notifier_base_identify_modules(&modules, req);
/* no modules selected then nothing to do */
if (NULL == modules) {
return;
}
for (i=0; NULL != modules[i]; i++) {
OPAL_LIST_FOREACH(imod, &orte_notifier_base.modules, orte_notifier_active_module_t) {
if (NULL != imod->module->log &&
0 == strcmp(imod->component->base_version.mca_component_name, modules[i]))
imod->module->log(req);
}
}
opal_argv_free(modules);
}
void orte_notifier_base_event(int sd, short args, void *cbdata)
{
orte_notifier_request_t *req = (orte_notifier_request_t*)cbdata;
char **modules = NULL;
orte_notifier_active_module_t *imod;
int i;
ORTE_ACQUIRE_OBJECT(req);
/* if no modules are active, then there is nothing to do */
if (0 == opal_list_get_size(&orte_notifier_base.modules)) {
return;
}
/* check if the severity is >= severity level set for
* reporting - note that the severity enum value goes up
* as severity goes down */
if (orte_notifier_base.severity_level < req->severity ) {
return;
}
orte_notifier_base_identify_modules(&modules, req);
/* no modules selected then nothing to do */
if (NULL == modules) {
return;
}
for (i=0; NULL != modules[i]; i++) {
OPAL_LIST_FOREACH(imod, &orte_notifier_base.modules, orte_notifier_active_module_t) {
if (NULL != imod->module->log &&
0 == strcmp(imod->component->base_version.mca_component_name, modules[i]))
imod->module->event(req);
}
}
opal_argv_free(modules);
}
void orte_notifier_base_report(int sd, short args, void *cbdata)
{
orte_notifier_request_t *req = (orte_notifier_request_t*)cbdata;
char **modules = NULL;
orte_notifier_active_module_t *imod;
int i;
ORTE_ACQUIRE_OBJECT(req);
/* if no modules are active, then there is nothing to do */
if (0 == opal_list_get_size(&orte_notifier_base.modules)) {
return;
}
/* see if the job requested any notifications */
if (!orte_get_attribute(&req->jdata->attributes, ORTE_JOB_NOTIFICATIONS, (void**)modules, OPAL_STRING)) {
return;
}
/* need to process the notification string to get the names of the modules */
if (NULL == modules) {
orte_notifier_base_identify_modules(&modules, req);
/* no modules selected then nothing to do */
if (NULL == modules) {
return;
}
}
for (i=0; NULL != modules[i]; i++) {
OPAL_LIST_FOREACH(imod, &orte_notifier_base.modules, orte_notifier_active_module_t) {
if (NULL != imod->module->log &&
0 == strcmp(imod->component->base_version.mca_component_name, modules[i]))
imod->module->report(req);
}
}
opal_argv_free(modules);
}
const char* orte_notifier_base_sev2str(orte_notifier_severity_t severity)
{
switch (severity) {
case ORTE_NOTIFIER_EMERG: return "EMERGENCY"; break;
case ORTE_NOTIFIER_ALERT: return "ALERT"; break;
case ORTE_NOTIFIER_CRIT: return "CRITICAL"; break;
case ORTE_NOTIFIER_ERROR: return "ERROR"; break;
case ORTE_NOTIFIER_WARN: return "WARNING"; break;
case ORTE_NOTIFIER_NOTICE: return "NOTICE"; break;
case ORTE_NOTIFIER_INFO: return "INFO"; break;
case ORTE_NOTIFIER_DEBUG: return "DEBUG"; break;
default: return "UNKNOWN"; break;
}
}
static void orte_notifier_base_identify_modules(char ***modules,
orte_notifier_request_t *req)
{
if (NULL != req->action) {
*modules = opal_argv_split(req->action, ',');
} else {
if (ORTE_NOTIFIER_EMERG == req->severity &&
(NULL != orte_notifier_base.emerg_actions)) {
*modules = opal_argv_split(orte_notifier_base.emerg_actions, ',');
} else if (ORTE_NOTIFIER_ALERT == req->severity &&
(NULL != orte_notifier_base.alert_actions)) {
*modules = opal_argv_split(orte_notifier_base.alert_actions, ',');
} else if (ORTE_NOTIFIER_CRIT == req->severity &&
(NULL != orte_notifier_base.crit_actions)) {
*modules = opal_argv_split(orte_notifier_base.crit_actions, ',');
} else if (ORTE_NOTIFIER_WARN == req->severity &&
(NULL != orte_notifier_base.warn_actions)) {
*modules = opal_argv_split(orte_notifier_base.warn_actions, ',');
} else if (ORTE_NOTIFIER_NOTICE == req->severity &&
(NULL != orte_notifier_base.notice_actions)) {
*modules = opal_argv_split(orte_notifier_base.notice_actions, ',');
} else if (ORTE_NOTIFIER_INFO == req->severity &&
(NULL != orte_notifier_base.info_actions)) {
*modules = opal_argv_split(orte_notifier_base.info_actions, ',');
} else if (ORTE_NOTIFIER_DEBUG == req->severity &&
(NULL != orte_notifier_base.debug_actions)) {
*modules = opal_argv_split(orte_notifier_base.debug_actions, ',');
} else if (ORTE_NOTIFIER_ERROR == req->severity &&
(NULL != orte_notifier_base.error_actions)) {
*modules = opal_argv_split(orte_notifier_base.error_actions, ',');
} else if (NULL != orte_notifier_base.default_actions) {
*modules = opal_argv_split(orte_notifier_base.default_actions, ',');
}
}
return;
}

Просмотреть файл

@ -1,266 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2008-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/constants.h"
#include <string.h>
#include "orte/mca/mca.h"
#include "opal/util/argv.h"
#include "opal/util/fd.h"
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/runtime/opal_progress_threads.h"
#include "orte/mca/notifier/base/base.h"
/* default module to use for logging*/
#define ORTE_NOTIFIER_DEFAULT_MODULE "syslog"
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#include "orte/mca/notifier/base/static-components.h"
/*
* Global variables
*/
opal_list_t orte_notifier_base_components_available = {{0}};
int orte_notifier_debug_output = -1;
orte_notifier_base_t orte_notifier_base = {0};
static char *notifier_severity = NULL;
static bool use_progress_thread = false;
/**
* Function for selecting a set of components from all those that are
* available.
*
* Examples:
* 1)
* -mca notifier syslog,smtp
* --> syslog and smtp are selected for the loging
*/
static int orte_notifier_base_register(mca_base_register_flag_t flags)
{
(void) mca_base_var_register("orte", "notifier", "base", "use_progress_thread",
"Use a dedicated progress thread for notifications [default: false]",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&use_progress_thread);
/* let the user define a base level of severity to report */
(void) mca_base_var_register("orte", "notifier", "base", "severity_level",
"Report all events at or above this severity [default: error]",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&notifier_severity);
if (NULL == notifier_severity) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_ERROR;
} else if (0 == strncasecmp(notifier_severity, "emerg", strlen("emerg"))) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_EMERG;
} else if (0 == strncasecmp(notifier_severity, "alert", strlen("alert"))) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_ALERT;
} else if (0 == strncasecmp(notifier_severity, "crit", strlen("crit"))) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_CRIT;
} else if (0 == strncasecmp(notifier_severity, "warn", strlen("warn"))) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_WARN;
} else if (0 == strncasecmp(notifier_severity, "notice", strlen("notice"))) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_NOTICE;
} else if (0 == strncasecmp(notifier_severity, "info", strlen("info"))) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_INFO;
} else if (0 == strncasecmp(notifier_severity, "debug", strlen("debug"))) {
orte_notifier_base.severity_level = ORTE_NOTIFIER_DEBUG;
} else {
orte_notifier_base.severity_level = ORTE_NOTIFIER_ERROR;
}
/* let the user define a base default actions */
orte_notifier_base.default_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "default_actions",
"Report all events to the default actions:NONE,syslog,smtp",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.default_actions);
if (NULL == orte_notifier_base.default_actions) {
orte_notifier_base.default_actions = strdup(ORTE_NOTIFIER_DEFAULT_MODULE);
}
/* let the user define a action for emergency events */
orte_notifier_base.emerg_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "emerg_event_actions",
"Report emergency events to the specified actions: example 'smtp'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.emerg_actions);
/* let the user define a action for alert events */
orte_notifier_base.alert_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "alert_event_actions",
"Report alert events to the specified actions: example 'smtp'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.alert_actions);
/* let the user define a action for critical events */
orte_notifier_base.crit_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "crit_event_actions",
"Report critical events to the specified actions: example 'syslog'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.crit_actions);
/* let the user define a action for warning events */
orte_notifier_base.warn_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "warn_event_actions",
"Report warning events to the specified actions: example 'syslog'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.warn_actions);
/* let the user define a action for notice events */
orte_notifier_base.notice_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "notice_event_actions",
"Report notice events to the specified actions: example 'syslog'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.notice_actions);
/* let the user define a action for info events */
orte_notifier_base.info_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "info_event_actions",
"Report info events to the specified actions: example 'syslog'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.info_actions);
/* let the user define a action for debug events */
orte_notifier_base.debug_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "debug_event_actions",
"Report debug events to the specified actions: example 'syslog'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.debug_actions);
/* let the user define a action for error events */
orte_notifier_base.error_actions = NULL;
(void) mca_base_var_register("orte", "notifier", "base", "error_event_actions",
"Report error events to the specified actions: example 'syslog'",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&orte_notifier_base.error_actions);
return ORTE_SUCCESS;
}
static int orte_notifier_base_close(void)
{
orte_notifier_active_module_t *i_module;
if (orte_notifier_base.ev_base_active) {
orte_notifier_base.ev_base_active = false;
opal_progress_thread_finalize("notifier");
}
OPAL_LIST_FOREACH(i_module, &orte_notifier_base.modules, orte_notifier_active_module_t) {
if (NULL != i_module->module->finalize) {
i_module->module->finalize();
}
}
OPAL_LIST_DESTRUCT(&orte_notifier_base.modules);
/* close all remaining available components */
return mca_base_framework_components_close(&orte_notifier_base_framework, NULL);
}
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
static int orte_notifier_base_open(mca_base_open_flag_t flags)
{
int rc;
/* construct the array of modules */
OBJ_CONSTRUCT(&orte_notifier_base.modules, opal_list_t);
/* if requested, create our own event base */
if (use_progress_thread) {
orte_notifier_base.ev_base_active = true;
if (NULL == (orte_notifier_base.ev_base =
opal_progress_thread_init("notifier"))) {
orte_notifier_base.ev_base_active = false;
return ORTE_ERROR;
}
} else {
orte_notifier_base.ev_base = orte_event_base;
}
/* Open up all available components */
rc = mca_base_framework_components_open(&orte_notifier_base_framework,
flags);
orte_notifier_debug_output = orte_notifier_base_framework.framework_output;
return rc;
}
MCA_BASE_FRAMEWORK_DECLARE(orte, notifier, "ORTE Notifier Framework",
orte_notifier_base_register,
orte_notifier_base_open, orte_notifier_base_close,
mca_notifier_base_static_components, 0);
OBJ_CLASS_INSTANCE (orte_notifier_active_module_t,
opal_list_item_t,
NULL, NULL);
static void req_cons (orte_notifier_request_t *r)
{
r->jdata = NULL;
r->msg = NULL;
r->t = 0;
}
static void req_des(orte_notifier_request_t *r)
{
if (NULL != r->jdata) {
OBJ_RELEASE(r->jdata);
}
}
OBJ_CLASS_INSTANCE (orte_notifier_request_t,
opal_object_t,
req_cons, req_des);

Просмотреть файл

@ -1,127 +0,0 @@
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include <string.h>
#include "orte/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "opal/class/opal_pointer_array.h"
#include "orte/mca/notifier/base/base.h"
/* Global variables */
/*
* orte_notifier_base_selected is set to true if at least 1 module has
* been selected for the notifier log API interface.
*/
static bool orte_notifier_base_selected = false;
/**
* Function for weeding out notifier components that don't want to run.
*
* Call the init function on all available compoenent to find out if
* they want to run. Select all components that don't fail. Failing
* Components will be closed and unloaded. The selected modules will
* be returned to the called in a opal_list_t.
*/
int orte_notifier_base_select(void)
{
mca_base_component_list_item_t *cli = NULL;
orte_notifier_base_component_t *component = NULL;
mca_base_module_t *module = NULL;
int priority;
orte_notifier_active_module_t *tmp_module;
orte_notifier_base_module_t *bmod;
if (orte_notifier_base_selected) {
return ORTE_SUCCESS;
}
orte_notifier_base_selected = true;
opal_output_verbose(10, orte_notifier_base_framework.framework_output,
"notifier:base:select: Auto-selecting components");
/*
* Traverse the list of available components.
* For each call their 'query' functions to see if they are available.
*/
OPAL_LIST_FOREACH(cli, &orte_notifier_base_framework.framework_components, mca_base_component_list_item_t) {
component = (orte_notifier_base_component_t *) cli->cli_component;
/*
* If there is a query function then use it.
*/
if (NULL == component->base_version.mca_query_component) {
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:base:select Skipping component [%s]. It does not implement a query function",
component->base_version.mca_component_name );
continue;
}
/*
* Query this component for the module and priority
*/
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:base:select Querying component [%s]",
component->base_version.mca_component_name);
component->base_version.mca_query_component(&module, &priority);
/*
* If no module was returned or negative priority, then skip component
*/
if (NULL == module || priority < 0) {
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:base:select Skipping component [%s]. Query failed to return a module",
component->base_version.mca_component_name );
continue;
}
bmod = (orte_notifier_base_module_t*)module;
/* see if it can be init'd */
if (NULL != bmod->init) {
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:base:init module called with priority [%s] %d",
component->base_version.mca_component_name, priority);
if (ORTE_SUCCESS != bmod->init()) {
continue;
}
}
/*
* Append them to the list
*/
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:base:select adding component [%s]",
component->base_version.mca_component_name);
tmp_module = OBJ_NEW(orte_notifier_active_module_t);
tmp_module->component = component;
tmp_module->module = (orte_notifier_base_module_t*)module;
opal_list_append(&orte_notifier_base.modules, (void*)tmp_module);
}
return ORTE_SUCCESS;
}

Просмотреть файл

@ -1,234 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2009 Cisco Systems, Inc. All Rights Reserved.
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The OpenRTE Notifier Framework
*
* The OpenRTE Notifier framework provides a mechanism for notifying
* system administrators or other fault monitoring systems that a
* problem with the underlying cluster has been detected - e.g., a
* failed connection in a network fabric
*/
#ifndef MCA_NOTIFIER_H
#define MCA_NOTIFIER_H
/*
* includes
*/
#include "orte_config.h"
#include <stdarg.h>
#include <limits.h>
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif
#include "orte/mca/mca.h"
#include "orte/constants.h"
#include "orte/types.h"
#include "orte/runtime/orte_globals.h"
#include "orte/util/threads.h"
BEGIN_C_DECLS
/* make the verbose channel visible here so everyone
* doesn't have to include notifier/base/base.h */
ORTE_DECLSPEC extern int orte_notifier_debug_output;
/* The maximum size of any on-stack buffers used in the notifier
* so we can try to avoid calling malloc in OUT_OF_RESOURCES conditions.
* The code has NOT been auditied for use of malloc, so this still
* may fail to get the "OUT_OF_RESOURCE" message out. Oh Well.
*/
#define ORTE_NOTIFIER_MAX_BUF 512
/* Severities */
typedef enum {
#ifdef HAVE_SYSLOG_H
ORTE_NOTIFIER_EMERG = LOG_EMERG,
ORTE_NOTIFIER_ALERT = LOG_ALERT,
ORTE_NOTIFIER_CRIT = LOG_CRIT,
ORTE_NOTIFIER_ERROR = LOG_ERR,
ORTE_NOTIFIER_WARN = LOG_WARNING,
ORTE_NOTIFIER_NOTICE = LOG_NOTICE,
ORTE_NOTIFIER_INFO = LOG_INFO,
ORTE_NOTIFIER_DEBUG = LOG_DEBUG
#else
ORTE_NOTIFIER_EMERG,
ORTE_NOTIFIER_ALERT,
ORTE_NOTIFIER_CRIT,
ORTE_NOTIFIER_ERROR,
ORTE_NOTIFIER_WARN,
ORTE_NOTIFIER_NOTICE,
ORTE_NOTIFIER_INFO,
ORTE_NOTIFIER_DEBUG
#endif
} orte_notifier_severity_t;
typedef struct {
opal_object_t super;
opal_event_t ev;
orte_job_t *jdata;
orte_job_state_t state;
orte_notifier_severity_t severity;
int errcode;
const char *msg;
const char *action;
time_t t;
} orte_notifier_request_t;
OBJ_CLASS_DECLARATION(orte_notifier_request_t);
/*
* Component functions - all MUST be provided!
*/
/* initialize the selected module */
typedef int (*orte_notifier_base_module_init_fn_t)(void);
/* finalize the selected module */
typedef void (*orte_notifier_base_module_finalize_fn_t)(void);
/* Log an internal error - this will include the job that caused the
* error to occur */
typedef void (*orte_notifier_base_module_log_fn_t)(orte_notifier_request_t *req);
/* Report a system event - e.g., a temperature out-of-bound */
typedef void (*orte_notifier_base_module_event_fn_t)(orte_notifier_request_t *req);
/* Report a job state */
typedef void (*orte_notifier_base_module_report_fn_t)(orte_notifier_request_t *req);
#define ORTE_NOTIFIER_INTERNAL_ERROR(j, st, s, e, m) \
do { \
orte_notifier_request_t *_n; \
opal_output_verbose(2, orte_notifier_debug_output, \
"%s notifier:internal:error[%s:%d] " \
"job %s error %s severity %s", \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, \
ORTE_JOBID_PRINT((NULL == (j)) ? \
ORTE_JOBID_INVALID : \
(j)->jobid), \
ORTE_ERROR_NAME((e)), \
orte_notifier_base_sev2str(s)); \
_n = OBJ_NEW(orte_notifier_request_t); \
_n->jdata = (j); \
_n->state = (st); \
_n->severity = (s); \
_n->errcode = (e); \
_n->msg = (m); \
_n->t = time(NULL); \
_n->action = (NULL); \
/* add the event */ \
opal_event_set(orte_notifier_base.ev_base, &(_n)->ev, -1, \
OPAL_EV_WRITE, orte_notifier_base_log, (_n)); \
opal_event_set_priority(&(_n)->ev, ORTE_ERROR_PRI); \
ORTE_POST_OBJECT(_n); \
opal_event_active(&(_n)->ev, OPAL_EV_WRITE, 1); \
} while(0);
#define ORTE_NOTIFIER_JOB_STATE(j, st, m) \
do { \
orte_notifier_request_t *_n; \
opal_output_verbose(2, orte_notifier_debug_output, \
"%s notifier[%s:%d] job %s state %s", \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, \
ORTE_JOBID_PRINT((NULL == (j)) ? \
ORTE_JOBID_INVALID : \
(j)->jobid), \
orte_job_state_to_str(st)); \
_n = OBJ_NEW(orte_notifier_request_t); \
_n->jdata = (j); \
_n->state = (st); \
_n->msg = (m); \
_n->t = time(NULL); \
_n->action = (NULL); \
/* add the event */ \
opal_event_set(orte_notifier_base.ev_base, &(_n)->ev, -1, \
OPAL_EV_WRITE, orte_notifier_base_report, (_n)); \
opal_event_set_priority(&(_n)->ev, ORTE_ERROR_PRI); \
ORTE_POST_OBJECT(_n); \
opal_event_active(&(_n)->ev, OPAL_EV_WRITE, 1); \
} while(0);
#define ORTE_NOTIFIER_SYSTEM_EVENT(s, m, a) \
do { \
orte_notifier_request_t *_n; \
opal_output_verbose(2, orte_notifier_debug_output, \
"%s notifier:sys:event[%s:%d] event %s", \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__, \
orte_notifier_base_sev2str(s)); \
_n = OBJ_NEW(orte_notifier_request_t); \
_n->jdata = (NULL); \
_n->state = (NULL); \
_n->jdata = NULL; \
_n->msg = (m); \
_n->t = time(NULL); \
_n->severity = (s); \
_n->action = (a); \
/* add the event */ \
opal_event_set(orte_notifier_base.ev_base, &(_n)->ev, -1, \
OPAL_EV_WRITE, orte_notifier_base_event, (_n)); \
opal_event_set_priority(&(_n)->ev, ORTE_ERROR_PRI); \
ORTE_POST_OBJECT(_n); \
opal_event_active(&(_n)->ev, OPAL_EV_WRITE, 1); \
} while(0);
/*
* Ver 1.0
*/
typedef struct {
orte_notifier_base_module_init_fn_t init;
orte_notifier_base_module_finalize_fn_t finalize;
orte_notifier_base_module_log_fn_t log;
orte_notifier_base_module_event_fn_t event;
orte_notifier_base_module_report_fn_t report;
} orte_notifier_base_module_t;
/*
* the standard component data structure
*/
typedef struct {
mca_base_component_t base_version;
mca_base_component_data_t base_data;
} orte_notifier_base_component_t;
/*
* Macro for use in components that are of type notifier v1.0.0
*/
#define ORTE_NOTIFIER_BASE_VERSION_1_0_0 \
/* notifier v1.0 is chained to MCA v2.0 */ \
ORTE_MCA_BASE_VERSION_2_1_0("notifier", 1, 0, 0)
END_C_DECLS
#endif /* MCA_NOTIFIER_H */

Просмотреть файл

Просмотреть файл

@ -1,54 +0,0 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# 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) 2009-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# Copyright (c) 2017 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AM_CPPFLAGS = $(notifier_smtp_CPPFLAGS)
dist_ortedata_DATA = \
help-orte-notifier-smtp.txt
sources = \
notifier_smtp.h \
notifier_smtp_module.c \
notifier_smtp_component.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_orte_notifier_smtp_DSO
component_noinst =
component_install = mca_notifier_smtp.la
else
component_noinst = libmca_notifier_smtp.la
component_install =
endif
mcacomponentdir = $(ortelibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_notifier_smtp_la_SOURCES = $(sources)
mca_notifier_smtp_la_LDFLAGS = -module -avoid-version $(notifier_smtp_LDFLAGS)
mca_notifier_smtp_la_LIBADD = $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la \
$(notifier_smtp_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_notifier_smtp_la_SOURCES =$(sources)
libmca_notifier_smtp_la_LDFLAGS = -module -avoid-version $(notifier_smtp_LDFLAGS)
libmca_notifier_smtp_la_LIBADD = $(notifier_smtp_LIBS)

Просмотреть файл

@ -1,39 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# 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) 2009-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_notifier_smtp_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_notifier_smtp_CONFIG], [
AC_CONFIG_FILES([orte/mca/notifier/smtp/Makefile])
AC_CHECK_TYPES( [include/libesmtp.h],
[libesmtp*],
[libesmtp.h],
[esmtp],
[smtp_create_session],
[],
[orte_notifier_want_smtp=1],
[orte_notifier_want_smtp=0])
AS_IF([test "$orte_notifier_want_smtp" = 1],
[$1],
[$2])
])dnl

Просмотреть файл

@ -1,33 +0,0 @@
# -*- text -*-
#
# Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is the US/English help file for Open MPI's SMTP notifier support
#
[to/from not specified]
Error: the Open MPI SMTP notifier component had no "to" and/or "from"
email addresses specified.
#
[server not specified]
Error: the Open MPI SMTP notifier component had no SMTP server name or
IP address specified.
#
[unable to resolve server]
Sorry, Open MPI's SMTP notifier component was unable to resolve the IP
address of the server provided.
Server: %s
#
[send_email failed]
Oops! Open MPI's SMTP notifier failed to send an email.
Reason: %s
libESMTP function: %s
libESMTP message: %s
Message: %s
#

Просмотреть файл

@ -1,68 +0,0 @@
/* -*- C -*-
*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#ifndef NOTIFIER_SMTP_H
#define NOTIFIER_SMTP_H
#include "orte_config.h"
#include <netdb.h>
#include "libesmtp.h"
#include "orte/mca/notifier/notifier.h"
BEGIN_C_DECLS
typedef struct {
orte_notifier_base_component_t super;
/* libesmtp version */
char *version;
/* SMTP server name and port */
char *server;
int port;
/* To, From, Subject */
char *to, **to_argv, *from_name, *from_addr, *subject;
/* Mail body prefix and suffix */
char *body_prefix, *body_suffix;
/* struct hostent from resolved SMTP server name */
struct hostent *server_hostent;
/* Priority of this component */
int priority;
} orte_notifier_smtp_component_t;
/*
* Notifier interfaces
*/
ORTE_MODULE_DECLSPEC extern orte_notifier_smtp_component_t
mca_notifier_smtp_component;
extern orte_notifier_base_module_t orte_notifier_smtp_module;
END_C_DECLS
#endif

Просмотреть файл

@ -1,197 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* Simple smtp notifier (using libesmtp)
*/
#include "orte_config.h"
#include "opal/mca/base/mca_base_var.h"
#include "orte/constants.h"
#include "orte/util/show_help.h"
#include "notifier_smtp.h"
static int smtp_component_query(mca_base_module_t **module, int *priority);
static int smtp_close(void);
static int smtp_register(void);
/*
* Struct of function pointers that need to be initialized
*/
orte_notifier_smtp_component_t mca_notifier_smtp_component = {
{
.base_version = {
ORTE_NOTIFIER_BASE_VERSION_1_0_0,
.mca_component_name = "smtp",
MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION),
.mca_close_component = smtp_close,
.mca_query_component = smtp_component_query,
.mca_register_component_params = smtp_register,
},
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
},
};
static int smtp_register(void)
{
char version[256];
/* Server stuff */
mca_notifier_smtp_component.server = strdup("localhost");
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "server",
"SMTP server name or IP address",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.server);
mca_notifier_smtp_component.port = 25;
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "port",
"SMTP server port",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.port);
/* Email stuff */
mca_notifier_smtp_component.to = NULL;
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "to",
"Comma-delimited list of email addresses to send to",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.to);
mca_notifier_smtp_component.from_addr = NULL;
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "from_addr",
"Email address that messages will be from",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.from_addr);
mca_notifier_smtp_component.from_name = strdup("ORTE Notifier");
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "from_name",
"Email name that messages will be from",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.from_name);
mca_notifier_smtp_component.subject = strdup("ORTE Notifier");
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "subject",
"Email subject",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.subject);
/* Mail body prefix and suffix */
mca_notifier_smtp_component.body_prefix = strdup("The ORTE SMTP notifier wishes to inform you of the following message:\n\n");
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "body_prefix",
"Text to put at the beginning of the mail message",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.body_prefix);
mca_notifier_smtp_component.body_suffix = strdup("\n\nSincerely,\nOscar the ORTE Owl");
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "body_prefix",
"Text to put at the end of the mail message",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.body_suffix);
/* Priority */
mca_notifier_smtp_component.priority = 10;
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "priority",
"Priority of this component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.priority);
/* Libesmtp version */
smtp_version(version, sizeof(version), 0);
version[sizeof(version) - 1] = '\0';
mca_notifier_smtp_component.version = strdup(version);
(void) mca_base_component_var_register(&mca_notifier_smtp_component.super.base_version, "libesmtp_version",
"Version of libesmtp that this component is linked against",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_notifier_smtp_component.version);
return ORTE_SUCCESS;
}
static int smtp_close(void)
{
return ORTE_SUCCESS;
}
static int smtp_component_query(mca_base_module_t **module,
int *priority)
{
*priority = 0;
*module = NULL;
/* If there's no to or from, there's no love */
if (NULL == mca_notifier_smtp_component.to ||
'\0' == mca_notifier_smtp_component.to[0] ||
NULL == mca_notifier_smtp_component.from_addr ||
'\0' == mca_notifier_smtp_component.from_addr[0]) {
orte_show_help("help-orte-notifier-smtp.txt",
"to/from not specified", true);
return ORTE_ERR_NOT_FOUND;
}
/* Sanity checks */
if (NULL == mca_notifier_smtp_component.server ||
'\0' == mca_notifier_smtp_component.server[0]) {
orte_show_help("help-orte-notifier-smtp.txt",
"server not specified", true);
return ORTE_ERR_NOT_FOUND;
}
/* Since we have to open a socket later, try to resolve the IP
address of the server now. Save the result, or abort if we
can't resolve it. */
mca_notifier_smtp_component.server_hostent =
gethostbyname(mca_notifier_smtp_component.server);
if (NULL == mca_notifier_smtp_component.server_hostent) {
orte_show_help("help-orte-notifier-smtp.txt",
"unable to resolve server",
true, mca_notifier_smtp_component.server);
return ORTE_ERR_NOT_FOUND;
}
*priority = 10;
*module = (mca_base_module_t *)&orte_notifier_smtp_module;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -1,316 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2007 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* Send an email upon notifier events.
*/
#include "orte_config.h"
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#include "opal/util/show_help.h"
#include "opal/util/argv.h"
#include "orte/constants.h"
#include "orte/mca/ess/ess.h"
#include "orte/util/error_strings.h"
#include "orte/util/name_fns.h"
#include "orte/util/show_help.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/notifier/base/base.h"
#include "notifier_smtp.h"
/* Static API's */
static void mylog(orte_notifier_base_severity_t severity, int errcode,
const char *msg, va_list ap);
/* Module */
orte_notifier_base_module_t orte_notifier_smtp_module = {
.log = mylog
};
typedef enum {
SENT_NONE,
SENT_HEADER,
SENT_BODY_PREFIX,
SENT_BODY,
SENT_BODY_SUFFIX,
SENT_ALL
} sent_flag_t;
typedef struct {
sent_flag_t sent_flag;
char *msg;
char *prev_string;
} message_status_t;
/*
* Convert lone \n's to \r\n
*/
static char *crnl(char *orig)
{
int i, j, max, count;
char *str;
return strdup(orig);
/* Count how much space we need */
count = max = strlen(orig);
for (i = 0; i < max; ++i) {
if (orig[i] == '\n' && i > 0 && orig[i - 1] != '\r') {
++count;
}
}
/* Copy, changing \n to \r\n */
str = malloc(count + 1);
for (j = i = 0; i < max; ++i) {
if (orig[i] == '\n' && i > 0 && orig[i - 1] != '\r') {
str[j++] = '\n';
}
str[j++] = orig[i];
}
str[j] = '\0';
return str;
}
/*
* Callback function invoked via smtp_start_session()
*/
static const char *message_cb(void **buf, int *len, void *arg)
{
message_status_t *ms = (message_status_t*) arg;
if (NULL == *buf) {
*buf = malloc(8192);
}
if (NULL == len) {
ms->sent_flag = SENT_NONE;
return NULL;
}
/* Free the previous string */
if (NULL != ms->prev_string) {
free(ms->prev_string);
ms->prev_string = NULL;
}
switch (ms->sent_flag) {
case SENT_NONE:
/* Send a blank line to signify the end of the header */
ms->sent_flag = SENT_HEADER;
ms->prev_string = NULL;
*len = 2;
return "\r\n";
case SENT_HEADER:
if (NULL != mca_notifier_smtp_component.body_prefix) {
ms->sent_flag = SENT_BODY_PREFIX;
ms->prev_string = crnl(mca_notifier_smtp_component.body_prefix);
*len = strlen(ms->prev_string);
return ms->prev_string;
}
case SENT_BODY_PREFIX:
ms->sent_flag = SENT_BODY;
ms->prev_string = crnl(ms->msg);
*len = strlen(ms->prev_string);
return ms->prev_string;
case SENT_BODY:
if (NULL != mca_notifier_smtp_component.body_suffix) {
ms->sent_flag = SENT_BODY_SUFFIX;
ms->prev_string = crnl(mca_notifier_smtp_component.body_suffix);
*len = strlen(ms->prev_string);
return ms->prev_string;
}
case SENT_BODY_SUFFIX:
case SENT_ALL:
default:
ms->sent_flag = SENT_ALL;
*len = 0;
return NULL;
}
}
/*
* Back-end function to actually send the email
*/
static int send_email(char *msg)
{
int i, err = ORTE_SUCCESS;
char *str = NULL;
char *errmsg = NULL;
struct sigaction sig, oldsig;
bool set_oldsig = false;
smtp_session_t session = NULL;
smtp_message_t message = NULL;
message_status_t ms;
orte_notifier_smtp_component_t *c = &mca_notifier_smtp_component;
if (NULL == c->to_argv) {
c->to_argv = opal_argv_split(c->to, ',');
if (NULL == c->to_argv ||
NULL == c->to_argv[0]) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
}
ms.sent_flag = SENT_NONE;
ms.prev_string = NULL;
ms.msg = msg;
/* Temporarily disable SIGPIPE so that if remote servers timeout
or hang up on us, it doesn't kill this application. We'll
restore the original SIGPIPE handler when we're done. */
sig.sa_handler = SIG_IGN;
sigemptyset(&sig.sa_mask);
sig.sa_flags = 0;
sigaction(SIGPIPE, &sig, &oldsig);
set_oldsig = true;
/* Try to get a libesmtp session. If so, assume that libesmtp is
happy and proceeed */
session = smtp_create_session();
if (NULL == session) {
err = ORTE_ERR_NOT_SUPPORTED;
errmsg = "stmp_create_session";
goto error;
}
/* Create the message */
message = smtp_add_message(session);
if (NULL == message) {
err = ORTE_ERROR;
errmsg = "stmp_add_message";
goto error;
}
/* Set the SMTP server (yes, it's a weird return status!) */
asprintf(&str, "%s:%d", c->server, c->port);
if (0 == smtp_set_server(session, str)) {
err = ORTE_ERROR;
errmsg = "stmp_set_server";
goto error;
}
free(str);
str = NULL;
/* Add the sender */
if (0 == smtp_set_reverse_path(message, c->from_addr)) {
err = ORTE_ERROR;
errmsg = "stmp_set_reverse_path";
goto error;
}
/* Set the subject and some headers */
asprintf(&str, "Open MPI SMTP Notifier v%d.%d.%d",
c->super.base_version.mca_component_major_version,
c->super.base_version.mca_component_minor_version,
c->super.base_version.mca_component_release_version);
if (0 == smtp_set_header(message, "Subject", c->subject) ||
0 == smtp_set_header_option(message, "Subject", Hdr_OVERRIDE, 1) ||
0 == smtp_set_header(message, "To", NULL, NULL) ||
0 == smtp_set_header(message, "From",
(NULL != c->from_name ?
c->from_name : c->from_addr),
c->from_addr) ||
0 == smtp_set_header(message, "X-Mailer", str) ||
0 == smtp_set_header_option(message, "Subject", Hdr_OVERRIDE, 1)) {
err = ORTE_ERROR;
errmsg = "smtp_set_header";
goto error;
}
free(str);
str = NULL;
/* Add the recipients */
for (i = 0; NULL != c->to_argv[i]; ++i) {
if (NULL == smtp_add_recipient(message, c->to_argv[i])) {
err = ORTE_ERR_OUT_OF_RESOURCE;
errmsg = "stmp_add_recipient";
goto error;
}
}
/* Set the callback to get the message */
if (0 == smtp_set_messagecb(message, message_cb, &ms)) {
err = ORTE_ERROR;
errmsg = "smtp_set_messagecb";
goto error;
}
/* Send it! */
if (0 == smtp_start_session(session)) {
err = ORTE_ERROR;
errmsg = "smtp_start_session";
goto error;
}
/* Fall through */
error:
if (NULL != str) {
free(str);
}
if (NULL != session) {
smtp_destroy_session(session);
}
/* Restore the SIGPIPE handler */
if (set_oldsig) {
sigaction(SIGPIPE, &oldsig, NULL);
}
if (ORTE_SUCCESS != err) {
int e;
char em[256];
e = smtp_errno();
smtp_strerror(e, em, sizeof(em));
orte_show_help("help-orte-notifier-smtp.txt",
"send_email failed",
true, "libesmtp library call failed",
errmsg, em, e, msg);
}
return err;
}
static void mylog(orte_notifier_base_severity_t severity, int errcode,
const char *msg, va_list ap)
{
char *output;
/* If there was a message, output it */
vasprintf(&output, msg, ap);
if (NULL != output) {
send_email(output);
free(output);
}
}

Просмотреть файл

@ -1,47 +0,0 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# 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 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# Copyright (c) 2017 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources = \
notifier_syslog.h \
notifier_syslog_module.c \
notifier_syslog_component.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_orte_notifier_syslog_DSO
component_noinst =
component_install = mca_notifier_syslog.la
else
component_noinst = libmca_notifier_syslog.la
component_install =
endif
mcacomponentdir = $(ortelibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_notifier_syslog_la_SOURCES = $(sources)
mca_notifier_syslog_la_LDFLAGS = -module -avoid-version
mca_notifier_syslog_la_LIBADD = $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la
noinst_LTLIBRARIES = $(component_noinst)
libmca_notifier_syslog_la_SOURCES =$(sources)
libmca_notifier_syslog_la_LDFLAGS = -module -avoid-version

Просмотреть файл

@ -1,31 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2017 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_notifier_syslog_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_notifier_syslog_CONFIG], [
AC_CONFIG_FILES([orte/mca/notifier/syslog/Makefile])
OPAL_VAR_SCOPE_PUSH([orte_notifier_syslog_happy])
# Per https://github.com/open-mpi/ompi/issues/4373 and
# https://github.com/open-mpi/ompi/pull/4374, we need to check
# that syslog.h is compilable. If syslog.h is not compilable,
# disable this component.
AC_CHECK_HEADER([syslog.h],
[orte_notifier_syslog_happy=1],
[orte_notifier_syslog_happy=0])
AS_IF([test $orte_notifier_syslog_happy -eq 1],
[$1],
[$2])
OPAL_VAR_SCOPE_POP
])dnl

Просмотреть файл

@ -1,40 +0,0 @@
/* -*- C -*-
*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#ifndef NOTIFIER_SYSLOG_H
#define NOTIFIER_SYSLOG_H
#include "orte_config.h"
#include "orte/mca/notifier/notifier.h"
BEGIN_C_DECLS
/*
* Notifier interfaces
*/
ORTE_MODULE_DECLSPEC extern orte_notifier_base_component_t mca_notifier_syslog_component;
extern orte_notifier_base_module_t orte_notifier_syslog_module;
END_C_DECLS
#endif

Просмотреть файл

@ -1,60 +0,0 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* includes
*/
#include "orte_config.h"
#include "orte/constants.h"
#include "notifier_syslog.h"
static int orte_notifier_syslog_component_query(mca_base_module_t **module,
int *priority);
/*
* Struct of function pointers that need to be initialized
*/
orte_notifier_base_component_t mca_notifier_syslog_component = {
.base_version = {
ORTE_NOTIFIER_BASE_VERSION_1_0_0,
.mca_component_name = "syslog",
MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION),
.mca_query_component = orte_notifier_syslog_component_query,
},
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
static int orte_notifier_syslog_component_query(mca_base_module_t **module,
int *priority)
{
*priority = 1;
*module = (mca_base_module_t *)&orte_notifier_syslog_module;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -1,132 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* 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) 2007 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/constants.h"
#include <string.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif
#include <stdarg.h>
#include "opal/util/show_help.h"
#include "orte/util/error_strings.h"
#include "orte/util/name_fns.h"
#include "orte/mca/notifier/base/base.h"
#include "notifier_syslog.h"
/* Static API's */
static int init(void);
static void finalize(void);
static void mylog(orte_notifier_request_t *req);
static void myevent(orte_notifier_request_t *req);
static void myreport(orte_notifier_request_t *req);
/* Module def */
orte_notifier_base_module_t orte_notifier_syslog_module = {
.init = init,
.finalize = finalize,
.log = mylog,
.event = myevent,
.report = myreport
};
static int init(void)
{
int opts;
opts = LOG_CONS | LOG_PID;
openlog("OpenRTE Error Report:", opts, LOG_USER);
return ORTE_SUCCESS;
}
static void finalize(void)
{
closelog();
}
static void mylog(orte_notifier_request_t *req)
{
char tod[48];
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:syslog:mylog function called with severity %d errcode %d and messg %s",
(int)req->severity, req->errcode, req->msg);
/* If there was a message, output it */
(void)ctime_r(&req->t, tod);
/* trim the newline */
tod[strlen(tod)] = '\0';
syslog(req->severity, "[%s]%s %s: JOBID %s REPORTS ERROR %s: %s", tod,
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
orte_notifier_base_sev2str(req->severity),
ORTE_JOBID_PRINT((NULL == req->jdata) ?
ORTE_JOBID_INVALID : req->jdata->jobid),
orte_job_state_to_str(req->state),
(NULL == req->msg) ? "<N/A>" : req->msg);
}
static void myevent(orte_notifier_request_t *req)
{
char tod[48];
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:syslog:myevent function called with severity %d and messg %s",
(int)req->severity, req->msg);
/* If there was a message, output it */
(void)ctime_r(&req->t, tod);
/* trim the newline */
tod[strlen(tod)] = '\0';
syslog(req->severity, "[%s]%s %s SYSTEM EVENT : %s", tod,
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
orte_notifier_base_sev2str(req->severity),
(NULL == req->msg) ? "<N/A>" : req->msg);
}
static void myreport(orte_notifier_request_t *req)
{
char tod[48];
opal_output_verbose(5, orte_notifier_base_framework.framework_output,
"notifier:syslog:myreport function called with severity %d state %s and messg %s",
(int)req->severity, orte_job_state_to_str(req->state),
req->msg);
/* If there was a message, output it */
(void)ctime_r(&req->t, tod);
/* trim the newline */
tod[strlen(tod)] = '\0';
syslog(req->severity, "[%s]%s JOBID %s REPORTS STATE %s: %s", tod,
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_JOBID_PRINT((NULL == req->jdata) ?
ORTE_JOBID_INVALID : req->jdata->jobid),
orte_job_state_to_str(req->state),
(NULL == req->msg) ? "<N/A>" : req->msg);
}

Просмотреть файл

@ -75,7 +75,6 @@
#include "orte/mca/schizo/schizo.h"
#include "orte/mca/state/state.h"
#include "orte/mca/filem/filem.h"
#include "orte/mca/dfs/dfs.h"
#include "orte/util/context_fns.h"
#include "orte/util/name_fns.h"
@ -446,13 +445,6 @@ int orte_odls_base_default_get_add_procs_data(opal_buffer_t *buffer,
return ORTE_SUCCESS;
}
static void fm_release(void *cbdata)
{
opal_buffer_t *bptr = (opal_buffer_t*)cbdata;
OBJ_RELEASE(bptr);
}
static void ls_cbunc(int status, void *cbdata)
{
opal_pmix_lock_t *lock = (opal_pmix_lock_t*)cbdata;
@ -809,15 +801,6 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *buffer,
lock.active = false; // we won't get a callback
}
/* if we have a file map, then we need to load it */
if (orte_get_attribute(&jdata->attributes, ORTE_JOB_FILE_MAPS, (void**)&bptr, OPAL_BUFFER)) {
if (NULL != orte_dfs.load_file_maps) {
orte_dfs.load_file_maps(jdata->jobid, bptr, fm_release, bptr);
} else {
OBJ_RELEASE(bptr);
}
}
/* load any controls into the job */
orte_rtc.assign(jdata);

Просмотреть файл

@ -14,7 +14,7 @@
* Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2007-2017 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -81,7 +81,6 @@
#include "opal/class/opal_pointer_array.h"
#include "opal/dss/dss.h"
#include "orte/mca/dfs/dfs.h"
#include "orte/mca/odls/odls.h"
#include "orte/mca/rml/rml.h"
#include "orte/mca/state/state.h"

Просмотреть файл

@ -269,8 +269,6 @@ const char *orte_attr_key_to_str(orte_attribute_key_t key)
return "JOB-LAUNCH-MSG-RECVD";
case ORTE_JOB_MAX_LAUNCH_MSG_RECVD:
return "JOB-MAX-LAUNCH-MSG-RECVD";
case ORTE_JOB_FILE_MAPS:
return "JOB-FILE-MAPS";
case ORTE_JOB_CKPT_STATE:
return "JOB-CKPT-STATE";
case ORTE_JOB_SNAPSHOT_REF:

Просмотреть файл

@ -101,7 +101,6 @@ typedef uint16_t orte_job_flags_t;
#define ORTE_JOB_LAUNCH_MSG_SENT (ORTE_JOB_START_KEY + 1) // timeval - time launch message was sent
#define ORTE_JOB_LAUNCH_MSG_RECVD (ORTE_JOB_START_KEY + 2) // timeval - time launch message was recvd
#define ORTE_JOB_MAX_LAUNCH_MSG_RECVD (ORTE_JOB_START_KEY + 3) // timeval - max time for launch msg to be received
#define ORTE_JOB_FILE_MAPS (ORTE_JOB_START_KEY + 4) // opal_buffer_t - file maps associates with this job
#define ORTE_JOB_CKPT_STATE (ORTE_JOB_START_KEY + 5) // size_t - ckpt state
#define ORTE_JOB_SNAPSHOT_REF (ORTE_JOB_START_KEY + 6) // string - snapshot reference
#define ORTE_JOB_SNAPSHOT_LOC (ORTE_JOB_START_KEY + 7) // string - snapshot location