1
1

Merge pull request #1952 from rhc54/topic/pmixcov

Update to latest PMIx toolext branch
Этот коммит содержится в:
rhc54 2016-08-11 14:24:13 -07:00 коммит произвёл GitHub
родитель 8d0baf140f 73544d2e00
Коммит 82240f579a
214 изменённых файлов: 24487 добавлений и 5879 удалений

6
.gitignore поставляемый
Просмотреть файл

@ -305,6 +305,12 @@ opal/mca/pmix/pmix*/pmix/include/pmix/autogen/config.h
opal/mca/pmix/pmix*/pmix/include/pmix/autogen/config.h.in
opal/mca/pmix/pmix*/pmix/src/include/private/autogen/config.h.in
opal/mca/pmix/pmix*/pmix/src/include/private/autogen/config.h
opal/mca/hwloc/base/static-components.h.new.extern
opal/mca/hwloc/base/static-components.h.new.struct
opal/mca/pmix/pmix2x/pmix/src/include/frameworks.h
opal/mca/pmix/pmix2x/pmix/src/mca/pinstalldirs/config/pinstall_dirs.h
opal/mca/pmix/pmix2x/pmix/config/autogen_found_items.m4
opal/mca/pmix/pmix2x/pmix/src/include/pmix_config.h
opal/tools/opal-checkpoint/opal-checkpoint
opal/tools/opal-checkpoint/opal-checkpoint.1

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

@ -66,7 +66,7 @@ AC_DEFUN([MCA_opal_pmix_ext20_CONFIG],[
OPAL_CHECK_PACKAGE([opal_pmix_ext20],
[pmix.h],
[pmix],
[PMIx_Query_info],
[PMIx_Query_info_nb],
[-lpmix],
[$pmix_ext_install_dir],
[$pmix_ext_install_dir/lib],

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

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

@ -4,7 +4,6 @@
* All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -12,8 +11,8 @@
* $HEADER$
*/
#ifndef MCA_PMIX_EXT20_H
#define MCA_PMIX_EXT20_H
#ifndef MCA_PMIX_PMIX2X_H
#define MCA_PMIX_PMIX2X_H
#include "opal_config.h"
@ -31,7 +30,7 @@
#include "opal/mca/pmix/pmix.h"
#include "pmix_server.h"
#include "pmix/pmix_common.h"
#include "pmix_common.h"
BEGIN_C_DECLS
@ -56,16 +55,16 @@ typedef struct {
opal_list_item_t super;
opal_jobid_t jobid;
char nspace[PMIX_MAX_NSLEN + 1];
} opal_pmix20_jobid_trkr_t;
OBJ_CLASS_DECLARATION(opal_pmix20_jobid_trkr_t);
} opal_ext20_jobid_trkr_t;
OBJ_CLASS_DECLARATION(opal_ext20_jobid_trkr_t);
typedef struct {
opal_list_item_t super;
size_t index;
int code;
opal_pmix_notification_fn_t handler;
} opal_pmix20_single_event_t;
OBJ_CLASS_DECLARATION(opal_pmix20_single_event_t);
} opal_ext20_single_event_t;
OBJ_CLASS_DECLARATION(opal_ext20_single_event_t);
typedef struct {
opal_list_item_t super;
@ -73,15 +72,15 @@ typedef struct {
int *codes;
size_t ncodes;
opal_pmix_notification_fn_t handler;
} opal_pmix20_multi_event_t;
OBJ_CLASS_DECLARATION(opal_pmix20_multi_event_t);
} opal_ext20_multi_event_t;
OBJ_CLASS_DECLARATION(opal_ext20_multi_event_t);
typedef struct {
opal_list_item_t super;
size_t index;
opal_pmix_notification_fn_t handler;
} opal_pmix20_default_event_t;
OBJ_CLASS_DECLARATION(opal_pmix20_default_event_t);
} opal_ext20_default_event_t;
OBJ_CLASS_DECLARATION(opal_ext20_default_event_t);
typedef struct {
opal_list_item_t super;
@ -91,13 +90,13 @@ typedef struct {
pmix_data_range_t range;
opal_list_t *info;
opal_list_t results;
opal_pmix20_single_event_t *sing;
opal_pmix20_multi_event_t *multi;
opal_pmix20_default_event_t *def;
opal_ext20_single_event_t *sing;
opal_ext20_multi_event_t *multi;
opal_ext20_default_event_t *def;
opal_pmix_op_cbfunc_t final_cbfunc;
void *final_cbdata;
} opal_pmix20_event_chain_t;
OBJ_CLASS_DECLARATION(opal_pmix20_event_chain_t);
} opal_ext20_event_chain_t;
OBJ_CLASS_DECLARATION(opal_ext20_event_chain_t);
typedef struct {
opal_object_t super;
@ -118,8 +117,8 @@ typedef struct {
opal_pmix_lookup_cbfunc_t lkcbfunc;
opal_pmix_spawn_cbfunc_t spcbfunc;
void *cbdata;
} pmix20_opcaddy_t;
OBJ_CLASS_DECLARATION(pmix20_opcaddy_t);
} ext20_opcaddy_t;
OBJ_CLASS_DECLARATION(ext20_opcaddy_t);
typedef struct {
opal_object_t super;
@ -131,15 +130,13 @@ typedef struct {
pmix_modex_cbfunc_t mdxcbfunc;
pmix_lookup_cbfunc_t lkupcbfunc;
pmix_spawn_cbfunc_t spwncbfunc;
#if HAVE_PMIX_QUERY_FUNCTION
pmix_info_cbfunc_t infocbfunc;
pmix_tool_connection_cbfunc_t toolcbfunc;
#endif
void *cbdata;
opal_pmix_release_cbfunc_t odmdxfunc;
void *ocbdata;
} pmix20_opalcaddy_t;
OBJ_CLASS_DECLARATION(pmix20_opalcaddy_t);
} ext20_opalcaddy_t;
OBJ_CLASS_DECLARATION(ext20_opalcaddy_t);
typedef struct {
opal_object_t super;
@ -159,157 +156,167 @@ typedef struct {
opal_pmix_evhandler_reg_cbfunc_t cbfunc;
opal_pmix_op_cbfunc_t opcbfunc;
void *cbdata;
} pmix20_threadshift_t;
OBJ_CLASS_DECLARATION(pmix20_threadshift_t);
} ext20_threadshift_t;
OBJ_CLASS_DECLARATION(ext20_threadshift_t);
#define OPAL_PMIX_OPCD_THREADSHIFT(i, s, sr, if, nif, fn, cb, cd) \
do { \
pmix20_opalcaddy_t *_cd; \
_cd = OBJ_NEW(pmix20_opalcaddy_t); \
_cd->id = (i); \
_cd->status = (s); \
_cd->source = (sr); \
_cd->info = (i); \
_cd->evcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
ext20_opalcaddy_t *_cd; \
_cd = OBJ_NEW(ext20_opalcaddy_t); \
_cd->id = (i); \
_cd->status = (s); \
_cd->source = (sr); \
_cd->info = (i); \
_cd->evcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
#define OPAL_PMIX_OP_THREADSHIFT(e, fn, cb, cd) \
do { \
pmix20_threadshift_t *_cd; \
_cd = OBJ_NEW(pmix20_threadshift_t); \
_cd->handler = (e); \
_cd->opcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
ext20_threadshift_t *_cd; \
_cd = OBJ_NEW(ext20_threadshift_t); \
_cd->handler = (e); \
_cd->opcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
#define OPAL_PMIX_THREADSHIFT(e, i, eh, fn, cb, cd) \
do { \
pmix20_threadshift_t *_cd; \
_cd = OBJ_NEW(pmix20_threadshift_t); \
_cd->event_codes = (e); \
_cd->info = (i); \
_cd->evhandler = (eh); \
_cd->cbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
ext20_threadshift_t *_cd; \
_cd = OBJ_NEW(ext20_threadshift_t); \
_cd->event_codes = (e); \
_cd->info = (i); \
_cd->evhandler = (eh); \
_cd->cbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
#define OPAL_PMIX_NOTIFY_THREADSHIFT(s, sr, r, i, fn, cb, cd) \
do { \
pmix20_threadshift_t *_cd; \
_cd = OBJ_NEW(pmix20_threadshift_t); \
_cd->status = (s); \
_cd->source = (sr); \
_cd->range = (r); \
_cd->info = (i); \
_cd->opcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
ext20_threadshift_t *_cd; \
_cd = OBJ_NEW(ext20_threadshift_t); \
_cd->status = (s); \
_cd->source = (sr); \
_cd->range = (r); \
_cd->info = (i); \
_cd->opcbfunc = (cb); \
_cd->cbdata = (cd); \
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
-1, EV_WRITE, (fn), (_cd)); \
event_active(&((_cd)->ev), EV_WRITE, 1); \
} while(0)
/**** CLIENT FUNCTIONS ****/
OPAL_MODULE_DECLSPEC int pmix20_client_init(void);
OPAL_MODULE_DECLSPEC int pmix20_client_finalize(void);
OPAL_MODULE_DECLSPEC int pmix20_initialized(void);
OPAL_MODULE_DECLSPEC int pmix20_abort(int flag, const char *msg,
opal_list_t *procs);
OPAL_MODULE_DECLSPEC int pmix20_commit(void);
OPAL_MODULE_DECLSPEC int pmix20_fence(opal_list_t *procs, int collect_data);
OPAL_MODULE_DECLSPEC int pmix20_fencenb(opal_list_t *procs, int collect_data,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_put(opal_pmix_scope_t scope,
opal_value_t *val);
OPAL_MODULE_DECLSPEC int pmix20_get(const opal_process_name_t *proc, const char *key,
opal_list_t *info, opal_value_t **val);
OPAL_MODULE_DECLSPEC int pmix20_getnb(const opal_process_name_t *proc, const char *key,
opal_list_t *info,
opal_pmix_value_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_publish(opal_list_t *info);
OPAL_MODULE_DECLSPEC int pmix20_publishnb(opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_lookup(opal_list_t *data, opal_list_t *info);
OPAL_MODULE_DECLSPEC int pmix20_lookupnb(char **keys, opal_list_t *info,
opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_unpublish(char **keys, opal_list_t *info);
OPAL_MODULE_DECLSPEC int pmix20_unpublishnb(char **keys, opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid);
OPAL_MODULE_DECLSPEC int pmix20_spawnnb(opal_list_t *job_info, opal_list_t *apps,
opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_connect(opal_list_t *procs);
OPAL_MODULE_DECLSPEC int pmix20_connectnb(opal_list_t *procs,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_disconnect(opal_list_t *procs);
OPAL_MODULE_DECLSPEC int pmix20_disconnectnb(opal_list_t *procs,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_resolve_peers(const char *nodename, opal_jobid_t jobid,
opal_list_t *procs);
OPAL_MODULE_DECLSPEC int pmix20_resolve_nodes(opal_jobid_t jobid, char **nodelist);
OPAL_MODULE_DECLSPEC int ext20_client_init(void);
OPAL_MODULE_DECLSPEC int ext20_client_finalize(void);
OPAL_MODULE_DECLSPEC int ext20_initialized(void);
OPAL_MODULE_DECLSPEC int ext20_abort(int flag, const char *msg,
opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext20_commit(void);
OPAL_MODULE_DECLSPEC int ext20_fence(opal_list_t *procs, int collect_data);
OPAL_MODULE_DECLSPEC int ext20_fencenb(opal_list_t *procs, int collect_data,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_put(opal_pmix_scope_t scope,
opal_value_t *val);
OPAL_MODULE_DECLSPEC int ext20_get(const opal_process_name_t *proc, const char *key,
opal_list_t *info, opal_value_t **val);
OPAL_MODULE_DECLSPEC int ext20_getnb(const opal_process_name_t *proc, const char *key,
opal_list_t *info,
opal_pmix_value_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_publish(opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext20_publishnb(opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_lookup(opal_list_t *data, opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext20_lookupnb(char **keys, opal_list_t *info,
opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_unpublish(char **keys, opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext20_unpublishnb(char **keys, opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid);
OPAL_MODULE_DECLSPEC int ext20_spawnnb(opal_list_t *job_info, opal_list_t *apps,
opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_connect(opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext20_connectnb(opal_list_t *procs,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_disconnect(opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext20_disconnectnb(opal_list_t *procs,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_resolve_peers(const char *nodename, opal_jobid_t jobid,
opal_list_t *procs);
OPAL_MODULE_DECLSPEC int ext20_resolve_nodes(opal_jobid_t jobid, char **nodelist);
/**** COMMON FUNCTIONS ****/
OPAL_MODULE_DECLSPEC int pmix20_store_local(const opal_process_name_t *proc,
opal_value_t *val);
OPAL_MODULE_DECLSPEC int ext20_store_local(const opal_process_name_t *proc,
opal_value_t *val);
/**** SERVER SOUTHBOUND FUNCTIONS ****/
OPAL_MODULE_DECLSPEC int pmix20_server_init(opal_pmix_server_module_t *module,
opal_list_t *info);
OPAL_MODULE_DECLSPEC int pmix20_server_finalize(void);
OPAL_MODULE_DECLSPEC int pmix20_server_gen_regex(const char *input, char **regex);
OPAL_MODULE_DECLSPEC int pmix20_server_gen_ppn(const char *input, char **ppn);
OPAL_MODULE_DECLSPEC int pmix20_server_register_nspace(opal_jobid_t jobid,
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC void pmix20_server_deregister_nspace(opal_jobid_t jobid,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_server_register_client(const opal_process_name_t *proc,
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC void pmix20_server_deregister_client(const opal_process_name_t *proc,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_server_setup_fork(const opal_process_name_t *proc, char ***env);
OPAL_MODULE_DECLSPEC int pmix20_server_dmodex(const opal_process_name_t *proc,
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int pmix20_server_notify_event(int status,
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_server_init(opal_pmix_server_module_t *module,
opal_list_t *info);
OPAL_MODULE_DECLSPEC int ext20_server_finalize(void);
OPAL_MODULE_DECLSPEC int ext20_server_gen_regex(const char *input, char **regex);
OPAL_MODULE_DECLSPEC int ext20_server_gen_ppn(const char *input, char **ppn);
OPAL_MODULE_DECLSPEC int ext20_server_register_nspace(opal_jobid_t jobid,
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC void ext20_server_deregister_nspace(opal_jobid_t jobid,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_server_register_client(const opal_process_name_t *proc,
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC void ext20_server_deregister_client(const opal_process_name_t *proc,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_server_setup_fork(const opal_process_name_t *proc, char ***env);
OPAL_MODULE_DECLSPEC int ext20_server_dmodex(const opal_process_name_t *proc,
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata);
OPAL_MODULE_DECLSPEC int ext20_server_notify_event(int status,
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
/**** COMPONENT UTILITY FUNCTIONS ****/
OPAL_MODULE_DECLSPEC void pmix20_event_hdlr(size_t evhdlr_registration_id,
pmix_status_t status, const pmix_proc_t *source,
pmix_info_t info[], size_t ninfo,
pmix_info_t results[], size_t nresults,
pmix_event_notification_cbfunc_fn_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC pmix_status_t pmix20_convert_opalrc(int rc);
OPAL_MODULE_DECLSPEC int pmix20_convert_rc(pmix_status_t rc);
OPAL_MODULE_DECLSPEC pmix_scope_t pmix20_convert_opalscope(opal_pmix_scope_t scope);
OPAL_MODULE_DECLSPEC pmix_data_range_t pmix20_convert_opalrange(opal_pmix_data_range_t range);
OPAL_MODULE_DECLSPEC opal_pmix_data_range_t pmix20_convert_range(pmix_data_range_t range);
OPAL_MODULE_DECLSPEC void pmix20_value_load(pmix_value_t *v,
opal_value_t *kv);
OPAL_MODULE_DECLSPEC int pmix20_value_unload(opal_value_t *kv,
const pmix_value_t *v);
OPAL_MODULE_DECLSPEC void ext20_event_hdlr(size_t evhdlr_registration_id,
pmix_status_t status, const pmix_proc_t *source,
pmix_info_t info[], size_t ninfo,
pmix_info_t results[], size_t nresults,
pmix_event_notification_cbfunc_fn_t cbfunc,
void *cbdata);
OPAL_MODULE_DECLSPEC pmix_status_t ext20_convert_opalrc(int rc);
OPAL_MODULE_DECLSPEC int ext20_convert_rc(pmix_status_t rc);
OPAL_MODULE_DECLSPEC opal_vpid_t ext20_convert_rank(int rank);
OPAL_MODULE_DECLSPEC pmix_rank_t ext20_convert_opalrank(opal_vpid_t vpid);
OPAL_MODULE_DECLSPEC opal_pmix_scope_t ext20_convert_scope(pmix_scope_t scope);
OPAL_MODULE_DECLSPEC pmix_scope_t ext20_convert_opalscope(opal_pmix_scope_t scope);
OPAL_MODULE_DECLSPEC pmix_data_range_t ext20_convert_opalrange(opal_pmix_data_range_t range);
OPAL_MODULE_DECLSPEC opal_pmix_data_range_t ext20_convert_range(pmix_data_range_t range);
OPAL_MODULE_DECLSPEC opal_pmix_persistence_t ext20_convert_persist(pmix_persistence_t scope);
OPAL_MODULE_DECLSPEC pmix_persistence_t ext20_convert_opalpersist(opal_pmix_persistence_t scope);
OPAL_MODULE_DECLSPEC void ext20_value_load(pmix_value_t *v,
opal_value_t *kv);
OPAL_MODULE_DECLSPEC int ext20_value_unload(opal_value_t *kv,
const pmix_value_t *v);
END_C_DECLS

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

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

@ -49,30 +49,30 @@ mca_pmix_ext20_component_t mca_pmix_ext20_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */
.base_version = {
/* Indicate that we are a pmix v1.1.0 component (which also
implies a specific MCA version) */
.base_version = {
/* Indicate that we are a pmix v1.1.0 component (which also
implies a specific MCA version) */
OPAL_PMIX_BASE_VERSION_2_0_0,
OPAL_PMIX_BASE_VERSION_2_0_0,
/* Component name and version */
/* Component name and version */
.mca_component_name = "ext20",
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION),
.mca_component_name = "ext20",
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION),
/* Component open and close functions */
/* Component open and close functions */
.mca_open_component = external_open,
.mca_close_component = external_close,
.mca_query_component = external_component_query,
.mca_register_component_params = external_register,
},
/* Next the MCA v1.0.0 component meta data */
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
}
.mca_open_component = external_open,
.mca_close_component = external_close,
.mca_query_component = external_component_query,
.mca_register_component_params = external_register,
},
/* Next the MCA v1.0.0 component meta data */
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
}
},
.native_launch = false
};
@ -81,10 +81,10 @@ static int external_register(void)
{
mca_pmix_ext20_component.cache_size = 256;
mca_base_component_var_register(&mca_pmix_ext20_component.super.base_version,
"cache_size", "Size of the ring buffer cache for events",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_CONSTANT,
&mca_pmix_ext20_component.cache_size);
"cache_size", "Size of the ring buffer cache for events",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_5,
MCA_BASE_VAR_SCOPE_CONSTANT,
&mca_pmix_ext20_component.cache_size);
return OPAL_SUCCESS;
}
@ -119,12 +119,12 @@ static int external_component_query(mca_base_module_t **module, int *priority)
/* see if a PMIx server is present */
if (NULL != (t = getenv("PMIX_SERVER_URI")) ||
NULL != (id = getenv("PMIX_ID"))) {
/* if PMIx is present, then we are a client and need to use it */
*priority = 100;
NULL != (id = getenv("PMIX_ID"))) {
/* if PMIx is present, then we are a client and need to use it */
*priority = 100;
} else {
/* we could be a server, so we still need to be considered */
*priority = 5;
/* we could be a server, so we still need to be considered */
*priority = 5;
}
*module = (mca_base_module_t *)&opal_pmix_ext20_module;
return OPAL_SUCCESS;

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

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

@ -53,26 +53,26 @@ static size_t errhdler_ref = 0;
#define PMIX_WAIT_FOR_COMPLETION(a) \
do { \
while ((a)) { \
usleep(10); \
} \
while ((a)) { \
usleep(10); \
} \
} while (0)
static void errreg_cbfunc (pmix_status_t status,
size_t errhandler_ref,
void *cbdata)
size_t errhandler_ref,
void *cbdata)
{
volatile bool *active = (volatile bool*)cbdata;
errhdler_ref = errhandler_ref;
opal_output_verbose(5, opal_pmix_base_framework.framework_output,
"PMIX server errreg_cbfunc - error handler registered status=%d, reference=%lu",
status, (unsigned long)errhandler_ref);
"PMIX server errreg_cbfunc - error handler registered status=%d, reference=%lu",
status, (unsigned long)errhandler_ref);
*active = false;
}
int pmix20_server_init(opal_pmix_server_module_t *module,
opal_list_t *info)
int ext20_server_init(opal_pmix_server_module_t *module,
opal_list_t *info)
{
pmix_status_t rc;
int dbg;
@ -82,28 +82,28 @@ int pmix20_server_init(opal_pmix_server_module_t *module,
volatile bool active;
if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) {
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
putenv(dbgvalue);
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
putenv(dbgvalue);
}
/* convert the list to an array of pmix_info_t */
if (NULL != info) {
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
pmix20_value_load(&pinfo[n].value, kv);
++n;
}
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
ext20_value_load(&pinfo[n].value, kv);
++n;
}
} else {
sz = 0;
pinfo = NULL;
sz = 0;
pinfo = NULL;
}
if (PMIX_SUCCESS != (rc = PMIx_server_init(&mymodule, pinfo, sz))) {
PMIX_INFO_FREE(pinfo, sz);
return pmix20_convert_rc(rc);
PMIX_INFO_FREE(pinfo, sz);
return ext20_convert_rc(rc);
}
PMIX_INFO_FREE(pinfo, sz);
@ -112,7 +112,7 @@ int pmix20_server_init(opal_pmix_server_module_t *module,
/* register the default event handler */
active = true;
PMIx_Register_event_handler(NULL, 0, NULL, 0, pmix20_event_hdlr, errreg_cbfunc, (void*)&active);
PMIx_Register_event_handler(NULL, 0, NULL, 0, ext20_event_hdlr, errreg_cbfunc, (void*)&active);
PMIX_WAIT_FOR_COMPLETION(active);
return OPAL_SUCCESS;
@ -124,7 +124,7 @@ static void fincb(pmix_status_t status, void *cbdata)
*active = false;
}
int pmix20_server_finalize(void)
int ext20_server_finalize(void)
{
pmix_status_t rc;
volatile bool active;
@ -135,52 +135,52 @@ int pmix20_server_finalize(void)
PMIX_WAIT_FOR_COMPLETION(active);
rc = PMIx_server_finalize();
return pmix20_convert_rc(rc);
return ext20_convert_rc(rc);
}
int pmix20_server_gen_regex(const char *input, char **regex)
int ext20_server_gen_regex(const char *input, char **regex)
{
pmix_status_t rc;
rc = PMIx_generate_regex(input, regex);
return pmix20_convert_rc(rc);
return ext20_convert_rc(rc);
}
int pmix20_server_gen_ppn(const char *input, char **ppn)
int ext20_server_gen_ppn(const char *input, char **ppn)
{
pmix_status_t rc;
rc = PMIx_generate_ppn(input, ppn);
return pmix20_convert_rc(rc);
return ext20_convert_rc(rc);
}
static void opcbfunc(pmix_status_t status, void *cbdata)
{
pmix20_opcaddy_t *op = (pmix20_opcaddy_t*)cbdata;
ext20_opcaddy_t *op = (ext20_opcaddy_t*)cbdata;
if (NULL != op->opcbfunc) {
op->opcbfunc(pmix20_convert_rc(status), op->cbdata);
op->opcbfunc(ext20_convert_rc(status), op->cbdata);
}
if (op->active) {
op->status = status;
op->active = false;
op->status = status;
op->active = false;
} else {
OBJ_RELEASE(op);
OBJ_RELEASE(op);
}
}
static void _reg_nspace(int sd, short args, void *cbdata)
{
pmix20_threadshift_t *cd = (pmix20_threadshift_t*)cbdata;
ext20_threadshift_t *cd = (ext20_threadshift_t*)cbdata;
opal_value_t *kv, *k2;
pmix_info_t *pinfo = NULL, *pmap;
size_t sz, szmap, m, n;
char nspace[PMIX_MAX_NSLEN];
pmix_status_t rc;
opal_list_t *pmapinfo;
opal_pmix20_jobid_trkr_t *job;
pmix20_opcaddy_t op;
opal_ext20_jobid_trkr_t *job;
ext20_opcaddy_t op;
/* we must threadshift this request as we might not be in an event
* and we are going to access framework-global lists/objects */
@ -189,74 +189,75 @@ static void _reg_nspace(int sd, short args, void *cbdata)
(void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, cd->jobid);
/* store this job in our list of known nspaces */
job = OBJ_NEW(opal_pmix20_jobid_trkr_t);
job = OBJ_NEW(opal_ext20_jobid_trkr_t);
(void)strncpy(job->nspace, nspace, PMIX_MAX_NSLEN);
job->jobid = cd->jobid;
opal_list_append(&mca_pmix_ext20_component.jobids, &job->super);
/* convert the list to an array of pmix_info_t */
if (NULL != cd->info) {
sz = opal_list_get_size(cd->info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, cd->info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) {
pinfo[n].value.type = PMIX_INFO_ARRAY;
/* the value contains a list of values - convert
* that list to another array */
pmapinfo = (opal_list_t*)kv->data.ptr;
szmap = opal_list_get_size(pmapinfo);
PMIX_INFO_CREATE(pmap, szmap);
pinfo[n].value.data.array.array = (struct pmix_info_t*)pmap;
pinfo[n].value.data.array.size = szmap;
m = 0;
OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) {
(void)strncpy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN);
pmix20_value_load(&pmap[m].value, k2);
++m;
}
} else {
pmix20_value_load(&pinfo[n].value, kv);
}
++n;
}
sz = opal_list_get_size(cd->info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, cd->info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) {
pinfo[n].value.type = PMIX_DATA_ARRAY;
/* the value contains a list of values - convert
* that list to another array */
pmapinfo = (opal_list_t*)kv->data.ptr;
szmap = opal_list_get_size(pmapinfo);
PMIX_INFO_CREATE(pmap, szmap);
pinfo[n].value.data.darray.type = PMIX_INFO;
pinfo[n].value.data.darray.array = (struct pmix_info_t*)pmap;
pinfo[n].value.data.darray.size = szmap;
m = 0;
OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) {
(void)strncpy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN);
ext20_value_load(&pmap[m].value, k2);
++m;
}
} else {
ext20_value_load(&pinfo[n].value, kv);
}
++n;
}
} else {
sz = 0;
pinfo = NULL;
sz = 0;
pinfo = NULL;
}
OBJ_CONSTRUCT(&op, pmix20_opcaddy_t);
OBJ_CONSTRUCT(&op, ext20_opcaddy_t);
op.active = true;
rc = PMIx_server_register_nspace(nspace, cd->status, pinfo, sz,
opcbfunc, (void*)&op);
opcbfunc, (void*)&op);
if (PMIX_SUCCESS == rc) {
PMIX_WAIT_FOR_COMPLETION(op.active);
PMIX_WAIT_FOR_COMPLETION(op.active);
} else {
op.status = rc;
op.status = rc;
}
/* ensure we execute the cbfunc so the caller doesn't hang */
if (NULL != cd->opcbfunc) {
cd->opcbfunc(pmix20_convert_rc(op.status), cd->cbdata);
cd->opcbfunc(ext20_convert_rc(op.status), cd->cbdata);
}
if (NULL != pinfo) {
PMIX_INFO_FREE(pinfo, sz);
PMIX_INFO_FREE(pinfo, sz);
}
OBJ_DESTRUCT(&op);
OBJ_RELEASE(cd);
}
int pmix20_server_register_nspace(opal_jobid_t jobid,
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
int ext20_server_register_nspace(opal_jobid_t jobid,
int nlocalprocs,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
pmix20_threadshift_t *cd;
ext20_threadshift_t *cd;
/* we must threadshift this request as it touches
* shared lists of objects */
cd = OBJ_NEW(pmix20_threadshift_t);
cd = OBJ_NEW(ext20_threadshift_t);
cd->jobid = jobid;
cd->status = nlocalprocs;
cd->info = info;
@ -265,11 +266,11 @@ int pmix20_server_register_nspace(opal_jobid_t jobid,
/* if the cbfunc is NULL, then the caller is in an event
* and we can directly call the processing function */
if (NULL == cbfunc) {
_reg_nspace(0, 0, cd);
_reg_nspace(0, 0, cd);
} else {
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _reg_nspace, cd);
event_active(&cd->ev, EV_WRITE, 1);
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _reg_nspace, cd);
event_active(&cd->ev, EV_WRITE, 1);
}
return OPAL_SUCCESS;
@ -277,144 +278,144 @@ int pmix20_server_register_nspace(opal_jobid_t jobid,
static void tdcbfunc(pmix_status_t status, void *cbdata)
{
pmix20_threadshift_t *cd = (pmix20_threadshift_t*)cbdata;
ext20_threadshift_t *cd = (ext20_threadshift_t*)cbdata;
if (NULL != cd->opcbfunc) {
cd->opcbfunc(pmix20_convert_rc(status), cd->cbdata);
cd->opcbfunc(ext20_convert_rc(status), cd->cbdata);
}
if (cd->active) {
cd->active = false;
cd->active = false;
} else {
OBJ_RELEASE(cd);
OBJ_RELEASE(cd);
}
}
static void _dereg_nspace(int sd, short args, void *cbdata)
{
pmix20_threadshift_t *cd = (pmix20_threadshift_t*)cbdata;
opal_pmix20_jobid_trkr_t *jptr;
ext20_threadshift_t *cd = (ext20_threadshift_t*)cbdata;
opal_ext20_jobid_trkr_t *jptr;
/* if we don't already have it, we can ignore this */
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext20_component.jobids, opal_pmix20_jobid_trkr_t) {
if (jptr->jobid == cd->jobid) {
/* found it - tell the server to deregister */
cd->active = true;
PMIx_server_deregister_nspace(jptr->nspace, tdcbfunc, cd);
PMIX_WAIT_FOR_COMPLETION(cd->active);
OBJ_RELEASE(cd);
/* now get rid of it from our list */
opal_list_remove_item(&mca_pmix_ext20_component.jobids, &jptr->super);
OBJ_RELEASE(jptr);
return;
}
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext20_component.jobids, opal_ext20_jobid_trkr_t) {
if (jptr->jobid == cd->jobid) {
/* found it - tell the server to deregister */
cd->active = true;
PMIx_server_deregister_nspace(jptr->nspace, tdcbfunc, cd);
PMIX_WAIT_FOR_COMPLETION(cd->active);
OBJ_RELEASE(cd);
/* now get rid of it from our list */
opal_list_remove_item(&mca_pmix_ext20_component.jobids, &jptr->super);
OBJ_RELEASE(jptr);
return;
}
}
/* must release the caller */
tdcbfunc(PMIX_ERR_NOT_FOUND, cd);
}
void pmix20_server_deregister_nspace(opal_jobid_t jobid,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
void ext20_server_deregister_nspace(opal_jobid_t jobid,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
pmix20_threadshift_t *cd;
ext20_threadshift_t *cd;
/* we must threadshift this request as it touches
* shared lists of objects */
cd = OBJ_NEW(pmix20_threadshift_t);
cd = OBJ_NEW(ext20_threadshift_t);
cd->jobid = jobid;
cd->opcbfunc = cbfunc;
cd->cbdata = cbdata;
if (NULL == cbfunc) {
_dereg_nspace(0, 0, cd);
_dereg_nspace(0, 0, cd);
} else {
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _dereg_nspace, cd);
event_active(&cd->ev, EV_WRITE, 1);
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _dereg_nspace, cd);
event_active(&cd->ev, EV_WRITE, 1);
}
}
int pmix20_server_register_client(const opal_process_name_t *proc,
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
int ext20_server_register_client(const opal_process_name_t *proc,
uid_t uid, gid_t gid,
void *server_object,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
pmix_status_t rc;
pmix_proc_t p;
pmix20_opcaddy_t op;
ext20_opcaddy_t op;
/* convert the jobid */
(void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid);
p.rank = proc->vpid;
p.rank = ext20_convert_opalrank(proc->vpid);
OBJ_CONSTRUCT(&op, pmix20_opcaddy_t);
OBJ_CONSTRUCT(&op, ext20_opcaddy_t);
op.active = true;
rc = PMIx_server_register_client(&p, uid, gid, server_object,
opcbfunc, (void*)&op);
opcbfunc, (void*)&op);
if (PMIX_SUCCESS == rc) {
PMIX_WAIT_FOR_COMPLETION(op.active);
rc = op.status;
PMIX_WAIT_FOR_COMPLETION(op.active);
rc = op.status;
}
OBJ_DESTRUCT(&op);
return pmix20_convert_rc(rc);
return ext20_convert_rc(rc);
}
static void _dereg_client(int sd, short args, void *cbdata)
{
pmix20_threadshift_t *cd = (pmix20_threadshift_t*)cbdata;
opal_pmix20_jobid_trkr_t *jptr;
ext20_threadshift_t *cd = (ext20_threadshift_t*)cbdata;
opal_ext20_jobid_trkr_t *jptr;
pmix_proc_t p;
/* if we don't already have it, we can ignore this */
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext20_component.jobids, opal_pmix20_jobid_trkr_t) {
if (jptr->jobid == cd->source->jobid) {
/* found it - tell the server to deregister */
(void)strncpy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN);
p.rank = cd->source->vpid;
cd->active = true;
PMIx_server_deregister_client(&p, tdcbfunc, (void*)cd);
PMIX_WAIT_FOR_COMPLETION(cd->active);
break;
}
OPAL_LIST_FOREACH(jptr, &mca_pmix_ext20_component.jobids, opal_ext20_jobid_trkr_t) {
if (jptr->jobid == cd->source->jobid) {
/* found it - tell the server to deregister */
(void)strncpy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN);
p.rank = ext20_convert_opalrank(cd->source->vpid);
cd->active = true;
PMIx_server_deregister_client(&p, tdcbfunc, (void*)cd);
PMIX_WAIT_FOR_COMPLETION(cd->active);
break;
}
}
OBJ_RELEASE(cd);
}
/* tell the local PMIx server to cleanup this client as it is
* done executing */
void pmix20_server_deregister_client(const opal_process_name_t *proc,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
void ext20_server_deregister_client(const opal_process_name_t *proc,
opal_pmix_op_cbfunc_t cbfunc,
void *cbdata)
{
pmix20_threadshift_t *cd;
ext20_threadshift_t *cd;
/* we must threadshift this request as we might not be in an event
* and we are going to access framework-global lists/objects */
cd = OBJ_NEW(pmix20_threadshift_t);
cd = OBJ_NEW(ext20_threadshift_t);
cd->source = proc;
cd->opcbfunc = cbfunc;
cd->cbdata = cbdata;
if (NULL == cbfunc) {
_dereg_client(0, 0, cd);
_dereg_client(0, 0, cd);
} else {
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _dereg_client, cd);
event_active(&cd->ev, EV_WRITE, 1);
event_assign(&cd->ev, opal_pmix_base.evbase,
-1, EV_WRITE, _dereg_client, cd);
event_active(&cd->ev, EV_WRITE, 1);
}
}
/* have the local PMIx server setup the environment for this client */
int pmix20_server_setup_fork(const opal_process_name_t *proc, char ***env)
int ext20_server_setup_fork(const opal_process_name_t *proc, char ***env)
{
pmix_status_t rc;
pmix_proc_t p;
/* convert the jobid */
(void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid);
p.rank = proc->vpid;
p.rank = ext20_convert_opalrank(proc->vpid);
rc = PMIx_server_setup_fork(&p, env);
return pmix20_convert_rc(rc);
return ext20_convert_rc(rc);
}
/* this is the call back up from the embedded PMIx server that
@ -423,87 +424,87 @@ int pmix20_server_setup_fork(const opal_process_name_t *proc, char ***env)
static void dmdx_response(pmix_status_t status, char *data, size_t sz, void *cbdata)
{
int rc;
pmix20_opcaddy_t *op = (pmix20_opcaddy_t*)cbdata;
ext20_opcaddy_t *op = (ext20_opcaddy_t*)cbdata;
rc = pmix20_convert_rc(status);
rc = ext20_convert_rc(status);
if (NULL != op->mdxcbfunc) {
op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL);
op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL);
}
OBJ_RELEASE(op);
}
/* request modex data for a local proc from the PMIx server */
int pmix20_server_dmodex(const opal_process_name_t *proc,
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata)
int ext20_server_dmodex(const opal_process_name_t *proc,
opal_pmix_modex_cbfunc_t cbfunc, void *cbdata)
{
pmix20_opcaddy_t *op;
ext20_opcaddy_t *op;
pmix_status_t rc;
/* setup the caddy */
op = OBJ_NEW(pmix20_opcaddy_t);
op = OBJ_NEW(ext20_opcaddy_t);
op->mdxcbfunc = cbfunc;
op->cbdata = cbdata;
/* convert the jobid */
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, proc->jobid);
op->p.rank = proc->vpid;
op->p.rank = ext20_convert_opalrank(proc->vpid);
/* find the internally-cached data for this proc */
rc = PMIx_server_dmodex_request(&op->p, dmdx_response, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
OBJ_RELEASE(op);
}
return pmix20_convert_rc(rc);
return ext20_convert_rc(rc);
}
/* tell the PMIx server to notify its local clients of an event */
int pmix20_server_notify_event(int status,
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata)
int ext20_server_notify_event(int status,
const opal_process_name_t *source,
opal_list_t *info,
opal_pmix_op_cbfunc_t cbfunc, void *cbdata)
{
opal_value_t *kv;
pmix_info_t *pinfo;
size_t sz, n;
pmix_status_t rc;
pmix20_opcaddy_t *op;
ext20_opcaddy_t *op;
/* convert the list to an array of pmix_info_t */
if (NULL != info) {
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
pmix20_value_load(&pinfo[n].value, kv);
}
sz = opal_list_get_size(info);
PMIX_INFO_CREATE(pinfo, sz);
n = 0;
OPAL_LIST_FOREACH(kv, info, opal_value_t) {
(void)strncpy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN);
ext20_value_load(&pinfo[n].value, kv);
}
} else {
sz = 0;
pinfo = NULL;
sz = 0;
pinfo = NULL;
}
/* setup the caddy */
op = OBJ_NEW(pmix20_opcaddy_t);
op = OBJ_NEW(ext20_opcaddy_t);
op->info = pinfo;
op->sz = sz;
op->opcbfunc = cbfunc;
op->cbdata = cbdata;
/* convert the jobid */
if (NULL == source) {
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, OPAL_JOBID_INVALID);
op->p.rank = OPAL_VPID_INVALID;
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, OPAL_JOBID_INVALID);
op->p.rank = ext20_convert_opalrank(OPAL_VPID_INVALID);
} else {
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, source->jobid);
op->p.rank = source->vpid;
(void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, source->jobid);
op->p.rank = ext20_convert_opalrank(source->vpid);
}
rc = pmix20_convert_opalrc(status);
rc = ext20_convert_opalrc(status);
/* the range is irrelevant here as the server is passing
* the event down to its local clients */
rc = PMIx_Notify_event(rc, &op->p, PMIX_RANGE_LOCAL,
pinfo, sz, opcbfunc, op);
pinfo, sz, opcbfunc, op);
if (PMIX_SUCCESS != rc) {
OBJ_RELEASE(op);
OBJ_RELEASE(op);
}
return pmix20_convert_rc(rc);
return ext20_convert_rc(rc);
}

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

@ -55,7 +55,7 @@ AC_DEFUN([MCA_opal_pmix_pmix2x_CONFIG],[
AS_IF([test $opal_pmix_pmix2x_happy -eq 1],
[PMIX_VERSION="internal v`$srcdir/$opal_pmix_pmix2x_basedir/pmix/config/pmix_get_version.sh $srcdir/$opal_pmix_pmix2x_basedir/pmix/VERSION`"
# Build flags for our Makefile.am
opal_pmix_pmix2x_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_pmix_pmix2x_basedir"'/pmix/libpmix.la'
opal_pmix_pmix2x_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_pmix_pmix2x_basedir"'/pmix/src/libpmix.la'
opal_pmix_pmix2x_CPPFLAGS='-I$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix2x/pmix/include/pmix -I$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix2x/pmix/include -I$(OPAL_TOP_BUILDDIR)/opal/mca/pmix/pmix2x/pmix -I$(OPAL_TOP_SRCDIR)/opal/mca/pmix/pmix2x/pmix'
AC_SUBST([opal_pmix_pmix2x_LIBS])
AC_SUBST([opal_pmix_pmix2x_CPPFLAGS])])

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

@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# $COPYRIGHT$
@ -23,64 +23,28 @@
# via AC_CONFIG_MACRO_DIR in configure.ac.
ACLOCAL_AMFLAGS = -I ./config
SUBDIRS = config include src
headers =
sources =
nodist_headers =
EXTRA_DIST =
EXTRA_DIST = AUTHORS README INSTALL VERSION LICENSE autogen.pl
# Only install the valgrind suppressions file if we're building in
# standalone mode
# Only install the valgrind suppressions file and man pages
# if we're building in standalone mode
dist_pmixdata_DATA =
man_MANS =
if ! PMIX_EMBEDDED_MODE
dist_pmixdata_DATA += contrib/pmix-valgrind.supp
man_MANS += \
man/man3/pmix_init.3 \
man/man3/pmix_finalize.3 \
man/man3/pmix_initialized.3 \
man/man3/pmix_abort.3 \
man/man3/pmix_put.3 \
man/man3/pmix_commit.3 \
man/man3/pmix_fence.3 \
man/man3/pmix_get.3 \
man/man7/pmix.7 \
man/man7/pmix_constants.7
if PMIX_HAVE_PANDOC
SUBDIRS += man
endif
include config/Makefile.am
include include/Makefile.am
include src/class/Makefile.am
include src/include/Makefile.am
include src/buffer_ops/Makefile.am
include src/util/Makefile.am
include src/usock/Makefile.am
include src/client/Makefile.am
include src/server/Makefile.am
include src/sec/Makefile.am
include src/event/Makefile.am
include src/common/Makefile.am
include src/tool/Makefile.am
if WANT_DSTORE
include src/sm/Makefile.am
include src/dstore/Makefile.am
endif
if PMIX_EMBEDDED_MODE
noinst_LTLIBRARIES = libpmix.la
libpmix_la_SOURCES = $(headers) $(sources)
libpmix_la_LDFLAGS =
else
lib_LTLIBRARIES = libpmix.la
libpmix_la_SOURCES = $(headers) $(sources)
libpmix_la_LDFLAGS = -version-info $(libpmix_so_version)
endif
if PMIX_TESTS_EXAMPLES
SUBDIRS = . test examples
SUBDIRS += . test examples
endif
if WANT_INSTALL_HEADERS
@ -93,19 +57,7 @@ noinst_HEADERS = $(headers)
endif
nroff:
@for file in $(man_MANS); do \
source=`echo $$file | sed -e 's@/man[0-9]@@'`; \
contrib/md2nroff.pl --source=$$source.md; \
done
EXTRA_DIST += AUTHORS README INSTALL VERSION LICENSE autogen.sh \
config/pmix_get_version.sh $(man_MANS) \
contrib/platform/optimized \
test/test_common.h test/cli_stages.h \
test/server_callbacks.h test/test_fence.h \
test/test_publish.h test/test_resolve_peers.h \
test/test_spawn.h test/utils.h test/test_cd.h
(cd man; $(MAKE) nroff)
dist-hook:
env LS_COLORS= sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(PMIX_VERSION)" "$(PMIX_REPO_REV)"

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

@ -30,7 +30,7 @@ greek=
# command, or with the date (if "git describe" fails) in the form of
# "date<date>".
repo_rev=git23ee156
repo_rev=gitc2e543b
# If tarball_version is not empty, it is used as the version string in
# the tarball filename, regardless of all other versions listed in
@ -44,7 +44,7 @@ tarball_version=
# The date when this release was created
date="Aug 07, 2016"
date="Aug 10, 2016"
# The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library

739
opal/mca/pmix/pmix2x/pmix/autogen.pl Исполняемый файл
Просмотреть файл

@ -0,0 +1,739 @@
#!/usr/bin/env perl
#
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2015 IBM Corporation. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
use strict;
use Cwd;
use File::Basename;
use File::Find;
use Data::Dumper;
use Getopt::Long;
#
# Global variables
#
# Sentinel file to remove if we fail
my $sentinel;
# The m4 file we'll write at the end
my $m4_output_file = "config/autogen_found_items.m4";
my $m4;
# Sanity check file
my $topdir_file = "include/pmix.h";
my $dnl_line = "dnl ---------------------------------------------------------------------------";
# Data structures to fill up with all the stuff we find
my $mca_found;
my @subdirs;
# Command line parameters
my $quiet_arg = 0;
my $debug_arg = 0;
my $help_arg = 0;
my $include_arg = 0;
my $exclude_arg = 0;
my $force_arg = 0;
# Include/exclude lists
my $include_list;
my $exclude_list;
# Minimum versions
my $pmix_automake_version = "1.12.2";
my $pmix_autoconf_version = "2.69";
my $pmix_libtool_version = "2.4.2";
# Search paths
my $pmix_autoconf_search = "autoconf";
my $pmix_automake_search = "automake";
my $pmix_libtoolize_search = "libtoolize;glibtoolize";
# One-time setup
my $username;
my $hostname;
my $full_hostname;
$username = getpwuid($>);
$full_hostname = `hostname`;
chomp($full_hostname);
$hostname = $full_hostname;
$hostname =~ s/^([\w\-]+)\..+/\1/;
##############################################################################
sub my_die {
unlink($sentinel)
if ($sentinel);
die @_;
}
sub my_exit {
my ($ret) = @_;
unlink($sentinel)
if ($sentinel && $ret != 0);
exit($ret);
}
##############################################################################
sub verbose {
print @_
if (!$quiet_arg);
}
sub debug {
print @_
if ($debug_arg);
}
sub debug_dump {
my $d = new Data::Dumper([@_]);
$d->Purity(1)->Indent(1);
debug $d->Dump;
}
##############################################################################
sub mca_process_component {
my ($framework, $component) = @_;
my $cdir = "src/mca/$framework/$component";
return
if (! -d $cdir);
# Process this directory
my $found_component;
$found_component = {
name => $component,
framework_name => $framework,
abs_dir => $cdir,
};
# Does this directory have a configure.m4 file?
if (-f "$cdir/configure.m4") {
$found_component->{"configure.m4"} = 1;
verbose " Found configure.m4 file\n";
}
# Push the results onto the $mca_found hash array
push(@{$mca_found->{$framework}->{"components"}},
$found_component);
}
##############################################################################
sub ignored {
my ($dir) = @_;
# If this directory does not have .pmix_ignore, or if it has a
# .pmix_unignore that has my username in it, then add it to the
# list of components.
my $ignored = 0;
if (-f "$dir/.pmix_ignore") {
$ignored = 1;
}
if (-f "$dir/.pmix_unignore") {
open(UNIGNORE, "$dir/.pmix_unignore") ||
my_die "Can't open $dir/.pmix_unignore file";
my $unignore;
$unignore .= $_
while (<UNIGNORE>);
close(UNIGNORE);
$ignored = 0
if ($unignore =~ /^$username$/m ||
$unignore =~ /^$username\@$hostname$/m ||
$unignore =~ /^$username\@$full_hostname$/m);
}
return $ignored;
}
##############################################################################
sub mca_process_framework {
my ($framework) = @_;
# Does this framework have a configure.m4 file?
my $dir = "src/mca/$framework";
if (-f "$dir/configure.m4") {
$mca_found->{$framework}->{"configure.m4"} = 1;
verbose " Found framework configure.m4 file\n";
}
# Did we exclude all components for this framework?
if (exists($exclude_list->{$framework}) &&
$exclude_list->{$framework}[0] eq "AGEN_EXCLUDE_ALL") {
verbose " => Excluded\n";
} else {
# Look for component directories in this framework
if (-d $dir) {
$mca_found->{$framework}->{found} = 1;
opendir(DIR, $dir) ||
my_die "Can't open $dir directory";
foreach my $d (readdir(DIR)) {
# Skip any non-directory, "base", or any dir that
# begins with "."
next
if (! -d "$dir/$d" || $d eq "base" ||
substr($d, 0, 1) eq ".");
# Skip any component that doesn't have a configure.m4
# or Makefile.am as we couldn't build it anyway
if (! -f "$dir/$d/configure.m4" &&
! -f "$dir/$d/Makefile.am" &&
! -f "$dir/$d/configure.ac" &&
! -f "$dir/$d/configure.in") {
verbose " => No sentinel file found in $dir/$d -> Excluded\n";
next;
}
verbose "--- Found pmix / $framework / $d component: src/mca/$framework/$d\n";
# Skip if specifically excluded
if (exists($exclude_list->{$framework}) &&
$exclude_list->{$framework}[0] eq $d) {
verbose " => Excluded\n";
next;
}
# Skip if the framework is on the include list, but
# doesn't contain this component
if (exists($include_list->{$framework})) {
my $tst = 0;
foreach my $ck (@{$include_list->{$framework}}) {
if ($ck ne $d) {
verbose " => Not included\n";
$tst = 1;
last;
}
}
if ($tst) {
next;
}
}
# Check ignore status
if (ignored("$dir/$d")) {
verbose " => Ignored (found .pmix_ignore file)\n";
} else {
mca_process_component($framework, $d);
}
}
}
closedir(DIR);
}
}
##############################################################################
sub mca_generate_framework_header(\$\@) {
my (@frameworks) = @_;
my $framework_array_output="";
my $framework_decl_output="";
foreach my $framework (@frameworks) {
# There is no common framework object
if ($framework ne "common") {
my $framework_name = "pmix_${framework}_base_framework";
$framework_array_output .= " &$framework_name,\n";
$framework_decl_output .= "extern pmix_mca_base_framework_t $framework_name;\n";
}
}
my $ifdef_string = uc "pmix_FRAMEWORKS_H";
open(FRAMEWORKS_OUT, ">src/include/frameworks.h");
printf FRAMEWORKS_OUT "%s", "/*
* This file is autogenerated by autogen.pl. Do not edit this file by hand.
*/
#ifndef $ifdef_string
#define $ifdef_string
#include <pmix/mca/base/mca_base_framework.h>
$framework_decl_output
static pmix_mca_base_framework_t *pmix_frameworks[] = {
$framework_array_output NULL
};
#endif /* $ifdef_string */\n\n";
close(FRAMEWORKS_OUT);
}
##############################################################################
sub mca_process_project {
# Look for framework directories
my $dir = "src/mca";
opendir(DIR, $dir) ||
my_die "Can't open $dir directory";
my @my_dirs = readdir(DIR);
@my_dirs = sort(@my_dirs);
foreach my $d (@my_dirs) {
# Skip any non-directory, "base", or any dir that begins with "."
next
if (! -d "$dir/$d" || $d eq "base" || substr($d, 0, 1) eq ".");
# If this directory has a $dir.h file and a base/
# subdirectory, or its name is "common", then it's a
# framework.
if ("common" eq $d ||
(-f "$dir/$d/$d.h" && -d "$dir/$d/base")) {
verbose "\n=== Found pmix framework: src/mca/$d\n";
mca_process_framework($d);
}
}
closedir(DIR);
}
##############################################################################
sub mca_run_global {
# Go find a list of frameworks, and for each of
# those, go find a list of components.
mca_process_project();
# Debugging output
debug_dump($mca_found);
$m4 .= "\n$dnl_line
$dnl_line
$dnl_line
dnl MCA information\n";
# Array for all the m4_includes that we'll need to pick up the
# configure.m4's.
my @includes;
# Write the list of frameworks
my $frameworks_comma;
# Print out project-level info
my @mykeys = keys(%{$mca_found});
@mykeys = sort(@mykeys);
# Ensure that the "common" framework is listed first
# (if it exists)
my @tmp;
push(@tmp, "common")
if (grep(/common/, @mykeys));
foreach my $f (@mykeys) {
push(@tmp, $f)
if ($f ne "common");
}
@mykeys = @tmp;
foreach my $f (@mykeys) {
$frameworks_comma .= ", $f";
# Does this framework have a configure.m4 file?
push(@includes, "src/mca/$f/configure.m4")
if (exists($mca_found->{$f}->{"configure.m4"}));
# This framework does have a Makefile.am (or at least,
# it should!)
my_die "Missing src/mca/$f/Makefile.am"
if (! -f "src/mca/$f/Makefile.am");
}
$frameworks_comma =~ s/^, //;
&mca_generate_framework_header("src", @mykeys);
$m4 .= "$dnl_line
dnl Frameworks in the pmix project and their corresponding directories
m4_define([mca_pmix_framework_list], [$frameworks_comma])
";
# Print out framework-level info
foreach my $f (@mykeys) {
my $components;
my $m4_config_component_list;
my $no_config_component_list;
# Troll through each of the found components
foreach my $comp (@{$mca_found->{$f}->{components}}) {
my $c = $comp->{name};
$components .= "$c ";
# Does this component have a configure.m4 file?
if (exists($comp->{"configure.m4"})) {
push(@includes, "src/mca/$f/$c/configure.m4");
$m4_config_component_list .= ", $c";
} else {
$no_config_component_list .= ", $c";
}
}
$m4_config_component_list =~ s/^, //;
$no_config_component_list =~ s/^, //;
$m4 .= "dnl Components in the pmix / $f framework
m4_define([mca_pmix_${f}_m4_config_component_list], [$m4_config_component_list])
m4_define([mca_pmix_${f}_no_config_component_list], [$no_config_component_list])
";
}
# List out all the m4_include
$m4 .= "$dnl_line
dnl List of configure.m4 files to include\n";
foreach my $i (@includes) {
$m4 .= "m4_include([$i])\n";
}
}
##############################################################################
# Find and remove stale files
sub find_and_delete {
foreach my $file (@_) {
my $removed = 0;
if (-f $file) {
unlink($file);
$removed = 1;
}
if (-f "config/$file") {
unlink("config/$file");
$removed = 1;
}
debug " Removed stale copy of $file\n"
if ($removed);
}
}
##############################################################################
# Find a specific executable and ensure that it is a recent enough
# version.
sub find_and_check {
my ($app, $app_name, $req_version) = @_;
my @search_path = split(/;/, $app_name);
my @min_version = split(/\./, $req_version);
my @versions_found = ();
foreach (@search_path) {
verbose " Searching for $_\n";
my $version = `$_ --version`;
if (!defined($version)) {
verbose " $_ not found\n";
next;
}
# Matches a version string with 1 or more parts possibly prefixed with a letter (ex:
# v2.2) or followed by a letter (ex: 2.2.6b). This regex assumes there is a space
# before the version string and that the version is ok if there is no version.
if (!($version =~ m/\s[vV]?(\d[\d\.]*\w?)/m)) {
verbose " WARNING: $_ does not appear to support --version. Assuming it is ok\n";
return;
}
$version = $1;
verbose " Found $_ version $version; checking version...\n";
push(@versions_found, $version);
my @parts = split(/\./, $version);
my $i = 0;
# Check every component of the version number
while ($i <= $#min_version) {
verbose " Found version component $parts[$i] -- need $min_version[$i]\n";
# Check to see if there are any characters (!) in the
# version number (e.g., Libtool's "2.2.6b" -- #%@#$%!!!).
# Do separate comparisons between the number and any
# trailing digits. You can't just "lt" compare the whole
# string because "10 lt 2b" will return true. #@$@#$#@$
# Libtool!!
$parts[$i] =~ m/(\d+)([a-z]*)/i;
my $pn = $1;
my $pa = $2;
$min_version[$i] =~ m/(\d+)([a-z]*)/i;
my $mn = $1;
my $ma = $2;
# If the version is higher, we're done.
if ($pn > $mn) {
verbose " ==> ACCEPTED\n";
return;
}
# If the version is lower, we're done.
elsif ($pn < $mn ||
($pn == $mn && $pa lt $ma)) {
verbose " ==> Too low! Skipping this version\n";
last;
}
# If the version was equal, keep checking.
++$i;
}
# If we found a good version, return.
if ($i > $#min_version) {
verbose " ==> ACCEPTED\n";
return;
}
}
# if no acceptable version found, reject it
print "
=================================================================
I could not find a recent enough copy of $app.
I need at least $req_version, but only found the following versions:\n\n";
my $i = 0;
foreach (@search_path) {
print " $_: $versions_found[$i]\n";
$i++;
}
print "\nI am gonna abort. :-(
Please make sure you are using at least the following versions of the
tools:
GNU Autoconf: $pmix_autoconf_version
GNU Automake: $pmix_automake_version
GNU Libtool: $pmix_libtool_version
=================================================================\n";
my_exit(1);
}
##############################################################################
sub safe_system {
print "Running: " . join(/ /, @_) . "\n";
my $ret = system(@_);
$ret >>= 8;
if (0 != $ret) {
print "Command failed: @_\n";
my_exit($ret);
}
$ret;
}
##############################################################################
sub in_tarball {
my $tarball = 0;
open(IN, "VERSION") || my_die "Can't open VERSION";
# If repo_rev is not an empty string, we are in a tarball
while (<IN>) {
my $line = $_;
my @fields = split(/=/,$line);
if ($fields[0] eq "repo_rev") {
if ($fields[1] ne "\n") {
$tarball = 1;
last;
}
}
}
close(IN);
return $tarball;
}
##############################################################################
##############################################################################
## main - do the real work...
##############################################################################
##############################################################################
# Command line parameters
my $ok = Getopt::Long::GetOptions("quiet|q" => \$quiet_arg,
"debug|d" => \$debug_arg,
"help|h" => \$help_arg,
"include=s" => \$include_arg,
"exclude=s" => \$exclude_arg,
"force|f" => \$force_arg,
);
if (!$ok || $help_arg) {
print "Invalid command line argument.\n\n"
if (!$ok);
print "Options:
--quiet | -q Do not display normal verbose output
--debug | -d Output lots of debug information
--help | -h This help list
--include | -i Comma-separated list of framework-component pairs
to be exclusively built - i.e., all other components
will be ignored and only those specified will be marked
to build
--exclude | -e Comma-separated list of framework or framework-component
to be excluded from the build
--force | -f Run even if invoked from the source tree of an expanded
distribution tarball\n";
my_exit($ok ? 0 : 1);
}
#---------------------------------------------------------------------------
# Check for project existence
my $project_name_long = "PMIx";
my $project_name_short = "PMIx";
#---------------------------------------------------------------------------
$full_hostname = `hostname`;
chomp($full_hostname);
$m4 = "dnl
dnl \$HEADER\$
dnl
$dnl_line
dnl This file is automatically created by autogen.pl; it should not
dnl be edited by hand!!
dnl
dnl Generated by $username at " . localtime(time) . "
dnl on $full_hostname.
$dnl_line\n\n";
#---------------------------------------------------------------------------
# Verify that we're in the PMIx root directory by checking for a token file.
my_die "Not at the root directory of an PMIx source tree"
if (! -f "config/pmix_mca.m4");
$force_arg = 1;
my_die "autogen.pl has been invoked in the source tree of a PMIx distribution tarball; aborting...
You likely do not need to invoke \"autogen.pl\" -- you can probably run \"configure\" directly.
If you really know what you are doing, and really need to run autogen.pl, use the \"--force\" flag."
if (!$force_arg && in_tarball());
# Now that we've verified that we're in the top-level OMPI directory,
# set the sentinel file to remove if we abort.
$sentinel = Cwd::cwd() . "/configure";
#---------------------------------------------------------------------------
my $step = 1;
verbose "PMIx autogen (buckle up!)
$step. Checking tool versions\n\n";
# Check the autotools revision levels
&find_and_check("autoconf", $pmix_autoconf_search, $pmix_autoconf_version);
&find_and_check("libtool", $pmix_libtoolize_search, $pmix_libtool_version);
&find_and_check("automake", $pmix_automake_search, $pmix_automake_version);
#---------------------------------------------------------------------------
# No platform file -- write an empty list
$m4 .= "m4_define([autogen_platform_file], [])\n\n";
if ($exclude_arg) {
debug "Using exclude list: $exclude_arg";
my @list = split(/,/, $exclude_arg);
foreach (@list) {
my @pairs = split(/-/, $_);
if (exists($pairs[1])) {
# Remove any trailing newlines
chomp($pairs[1]);
debug " Adding ".$pairs[0]."->".$pairs[1]." to exclude list\n";
push(@{$exclude_list->{$pairs[0]}}, $pairs[1]);
} else {
debug " Adding $pairs[0] to exclude list\n";
push(@{$exclude_list->{$pairs[0]}}, "AGEN_EXCLUDE_ALL");
}
}
}
if ($include_arg) {
debug "Using include list: $include_arg";
my @list = split(/,/, $include_arg);
foreach (@list) {
my @pairs = split(/-/, $_);
if (exists($pairs[1])) {
# Remove any trailing newlines
chomp($pairs[1]);
debug " Adding ".$pairs[0]."->".$pairs[1]." to include list\n";
push(@{$include_list->{$pairs[0]}}, $pairs[1]);
}
# NOTE: it makes no sense to include all as that is the default
# so ignore that scenario here, if given
}
}
#---------------------------------------------------------------------------
# Find frameworks, components
++$step;
verbose "\n$step. Searching for MCA frameworks and components\n";
my $ret;
# Figure out if we're at the top level of the PMIx tree or not.
if (! (-f "VERSION" && -f "configure.ac" && -f $topdir_file)) {
print("\n\nYou must run this script from the top-level directory of the PMIx tree.\n\n");
my_exit(1);
}
$m4 .= "\ndnl Project names
m4_define([project_name_long], [$project_name_long])
m4_define([project_name_short], [$project_name_short])\n";
# Setup MCA
mca_run_global();
#---------------------------------------------------------------------------
# If we got here, all was good. Run the auto tools.
++$step;
verbose "\n$step. Running autotools on top-level tree\n\n";
# Remove old versions of the files (this is probably overkill, but...)
verbose "==> Remove stale files\n";
find_and_delete(qw/config.guess config.sub depcomp compile install-sh ltconfig
ltmain.sh missing mkinstalldirs libtool/);
# Remove the old m4 file and write the new one
verbose "==> Writing m4 file with autogen.pl results\n";
unlink($m4_output_file);
open(M4, ">$m4_output_file") ||
my_die "Can't open $m4_output_file";
print M4 $m4;
close(M4);
# Run autoreconf
verbose "==> Running autoreconf\n";
my $cmd = "autoreconf -ivf --warnings=all,no-obsolete,no-override -I config";
safe_system($cmd);
#---------------------------------------------------------------------------
verbose "
================================================
PMIx autogen: completed successfully. w00t!
================================================\n\n";
# Done!
exit(0);

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

@ -1,5 +0,0 @@
#!/bin/sh
# Run all the rest of the Autotools
echo "==> Running autoreconf";
autoreconf ${autoreconf_args:-"-ivf"}

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

@ -1,10 +1,7 @@
# PMIx copyrights:
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
#
#########################
#
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
@ -15,10 +12,10 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010 Oracle and/or its affiliates. All rights
# reserved.
#########################
# Copyright (c) 2016 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -26,28 +23,28 @@
# $HEADER$
#
EXTRA_DIST += \
config/c_get_alignment.m4 \
config/pmix_get_version.sh \
config/distscript.sh \
config/pmix_check_attributes.m4 \
config/pmix_check_broken_qsort.m4 \
config/pmix_check_compiler_version.m4 \
config/pmix_check_icc.m4 \
config/pmix_check_ident.m4 \
config/pmix_check_munge.m4 \
config/pmix_check_package.m4 \
config/pmix_check_sasl.m4 \
config/pmix_check_vendor.m4 \
config/pmix_check_visibility.m4 \
config/pmix_ensure_contains_optflags.m4 \
config/pmix_functions.m4 \
config/pmix.m4 \
config/pmix_search_libs.m4 \
config/pmix_setup_cc.m4 \
config/pmix_setup_hwloc.m4 \
config/pmix_setup_libevent.m4
EXTRA_DIST = \
c_get_alignment.m4 \
pmix_get_version.sh \
distscript.sh \
pmix_check_attributes.m4 \
pmix_check_broken_qsort.m4 \
pmix_check_compiler_version.m4 \
pmix_check_icc.m4 \
pmix_check_ident.m4 \
pmix_check_package.m4 \
pmix_check_vendor.m4 \
pmix_check_visibility.m4 \
pmix_config_subdir.m4 \
pmix_ensure_contains_optflags.m4 \
pmix_functions.m4 \
pmix.m4 \
pmix_search_libs.m4 \
pmix_setup_cc.m4 \
pmix_setup_hwloc.m4 \
pmix_setup_libevent.m4 \
pmix_mca_priority_sort.pl
maintainer-clean-local:
rm -f config/pmix_get_version.sh
rm -f pmix_get_version.sh

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

@ -10,19 +10,18 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009 IBM Corporation. All rights reserved.
dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
dnl Copyright (c) 2013-2016 Intel, Inc. All rights reserved
dnl Copyright (c) 2013-2015 Intel, Inc. All rights reserved
dnl Copyright (c) 2015 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2016 Mellanox Technologies, Inc.
dnl All rights reserved.
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
dnl
dnl $COPYRIGHT$
dnl
@ -78,12 +77,13 @@ AC_DEFUN([PMIX_SETUP_CORE],[
if test "$?" != "0"; then
AC_MSG_ERROR([Cannot continue])
fi
PMIX_RELEASE_DATE="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release-date`"
AC_MSG_RESULT([$PMIX_VERSION])
AC_SUBST(PMIX_VERSION)
AC_DEFINE_UNQUOTED([PMIX_VERSION], ["$PMIX_VERSION"],
[The library version is always available, contrary to VERSION])
PMIX_RELEASE_DATE="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release-date`"
AC_SUBST(PMIX_RELEASE_DATE)
AC_MSG_RESULT([$PMIX_VERSION])
# Save the breakdown the version information
AC_MSG_CHECKING([for pmix major version])
@ -92,31 +92,25 @@ AC_DEFUN([PMIX_SETUP_CORE],[
AC_MSG_ERROR([Cannot continue])
fi
AC_SUBST(PMIX_MAJOR_VERSION)
AC_DEFINE_UNQUOTED([PMIX_MAJOR_VERSION], ["$PMIX_MAJOR_VERSION"],
AC_DEFINE_UNQUOTED([PMIX_MAJOR_VERSION], [$PMIX_MAJOR_VERSION],
[The library major version is always available, contrary to VERSION])
AC_DEFINE_UNQUOTED([PMIX_VERSION_MAJOR], [${PMIX_MAJOR_VERSION}L],
[The library major version as integer])
AC_MSG_CHECKING([for pmix minor version])
PMIX_MINOR_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --minor`"
if test "$?" != "0"; then
AC_MSG_ERROR([Cannot continue])
fi
AC_SUBST(PMIX_MINOR_VERSION)
AC_DEFINE_UNQUOTED([PMIX_MINOR_VERSION], ["$PMIX_MINOR_VERSION"],
AC_DEFINE_UNQUOTED([PMIX_MINOR_VERSION], [$PMIX_MINOR_VERSION],
[The library minor version is always available, contrary to VERSION])
AC_DEFINE_UNQUOTED([PMIX_VERSION_MINOR], [${PMIX_MINOR_VERSION}L],
[The library minor version as integer])
AC_MSG_CHECKING([for pmix release version])
PMIX_RELEASE_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release`"
if test "$?" != "0"; then
AC_MSG_ERROR([Cannot continue])
fi
AC_SUBST(PMIX_RELEASE_VERSION)
AC_DEFINE_UNQUOTED([PMIX_RELEASE_VERSION], ["$PMIX_RELEASE_VERSION"],
AC_DEFINE_UNQUOTED([PMIX_RELEASE_VERSION], [$PMIX_RELEASE_VERSION],
[The library release version is always available, contrary to VERSION])
# Debug mode?
@ -136,29 +130,11 @@ AC_DEFUN([PMIX_SETUP_CORE],[
AC_MSG_CHECKING([for pmix directory prefix])
AC_MSG_RESULT(m4_ifval([$1], pmix_config_prefix, [(none)]))
AC_CONFIG_HEADERS(pmix_config_prefix[include/pmix/autogen/config.h])
# What prefix are we using?
AC_MSG_CHECKING([for pmix symbol prefix])
AS_IF([test "$pmix_symbol_prefix_value" = ""],
[AS_IF([test "$with_pmix_symbol_prefix" = ""],
[pmix_symbol_prefix_value=pmix_],
[pmix_symbol_prefix_value=$with_pmix_symbol_prefix])])
AC_DEFINE_UNQUOTED(PMIX_SYM_PREFIX, [$pmix_symbol_prefix_value],
[The pmix symbol prefix])
# Ensure to [] escape the whole next line so that we can get the
# proper tr tokens
[pmix_symbol_prefix_value_caps="`echo $pmix_symbol_prefix_value | tr '[:lower:]' '[:upper:]'`"]
AC_DEFINE_UNQUOTED(PMIX_SYM_PREFIX_CAPS, [$pmix_symbol_prefix_value_caps],
[The pmix symbol prefix in all caps])
AC_MSG_RESULT([$pmix_symbol_prefix_value])
# Give an easy #define to know if we need to transform all the
# pmix names
AH_TEMPLATE([PMIX_SYM_TRANSFORM], [Whether we need to re-define all the pmix public symbols or not])
AS_IF([test "$pmix_symbol_prefix_value" = "pmix_"],
[AC_DEFINE([PMIX_SYM_TRANSFORM], [0])],
[AC_DEFINE([PMIX_SYM_TRANSFORM], [1])])
# Note that private/config.h *MUST* be listed first so that it
# becomes the "main" config header file. Any AC-CONFIG-HEADERS
# after that (pmix/config.h) will only have selective #defines
# replaced, not the entire file.
AC_CONFIG_HEADERS(pmix_config_prefix[src/include/pmix_config.h])
# GCC specifics.
if test "x$GCC" = "xyes"; then
@ -324,13 +300,14 @@ AC_DEFUN([PMIX_SETUP_CORE],[
sys/wait.h syslog.h \
time.h unistd.h dirent.h \
crt_externs.h signal.h \
ioLib.h sockLib.h hostLib.h limits.h])
ioLib.h sockLib.h hostLib.h limits.h \
sys/statfs.h sys/statvfs.h])
# Note that sometimes we have <stdbool.h>, but it doesn't work (e.g.,
# have both Portland and GNU installed; using pgcc will find GNU's
# <stdbool.h>, which all it does -- by standard -- is define "bool" to
# "_Bool" [see
# http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html],
# http://pmixw.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html],
# and Portland has no idea what to do with _Bool).
# So first figure out if we have <stdbool.h> (i.e., check the value of
@ -467,6 +444,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
[#include <sys/types.h>
#include <sys/socket.h> ])
#
# Check for ptrdiff type. Yes, there are platforms where
# sizeof(void*) != sizeof(long) (64 bit Windows, apparently).
#
@ -487,6 +465,34 @@ AC_DEFUN([PMIX_SETUP_CORE],[
[type to use for ptrdiff_t])
AC_MSG_RESULT([$pmix_ptrdiff_t (size: $pmix_ptrdiff_size)])
##################################
# Linker characteristics
##################################
AC_MSG_CHECKING([the linker for support for the -fini option])
PMIX_VAR_SCOPE_PUSH([LDFLAGS_save])
LDFLAGS_save=$LDFLAGS
LDFLAGS="$LDFLAGS_save -Wl,-fini -Wl,finalize"
AC_TRY_LINK([void finalize (void) {}], [], [AC_MSG_RESULT([yes])
pmix_ld_have_fini=1], [AC_MSG_RESULT([no])
pmix_ld_have_fini=0])
LDFLAGS=$LDFLAGS_save
PMIX_VAR_SCOPE_POP
pmix_destructor_use_fini=0
pmix_no_destructor=0
if test x$pmix_cv___attribute__destructor = x0 ; then
if test x$pmix_ld_have_fini = x1 ; then
pmix_destructor_use_fini=1
else
pmix_no_destructor=1;
fi
fi
AC_DEFINE_UNQUOTED(PMIX_NO_LIB_DESTRUCTOR, [$pmix_no_destructor],
[Whether libraries can be configured with destructor functions])
AM_CONDITIONAL(PMIX_DESTRUCTOR_USE_FINI, [test x$pmix_destructor_use_fini = x1])
##################################
# Libraries
##################################
@ -501,14 +507,14 @@ AC_DEFUN([PMIX_SETUP_CORE],[
# Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
PMIX_SEARCH_LIBS_CORE([ceil], [m])
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep getpeereid strnlen])
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep statfs statvfs getpeereid strnlen])
# On some hosts, htonl is a define, so the AC_CHECK_FUNC will get
# confused. On others, it's in the standard library, but stubbed with
# the magic glibc foo as not implemented. and on other systems, it's
# just not there. This covers all cases.
AC_CACHE_CHECK([for htonl define],
[ompi_cv_htonl_define],
[pmix_cv_htonl_define],
[AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@ -522,12 +528,16 @@ AC_DEFUN([PMIX_SETUP_CORE],[
#ifndef ntohl
#error "ntohl not defined"
#endif
])], [ompi_cv_htonl_define=yes], [ompi_cv_htonl_define=no])])
AC_CHECK_FUNC([htonl], [ompi_have_htonl=yes], [ompi_have_htonl=no])
AS_IF([test "$ompi_cv_htonl_define" = "yes" || test "$ompi_have_htonl" = "yes"],
])], [pmix_cv_htonl_define=yes], [pmix_cv_htonl_define=no])])
AC_CHECK_FUNC([htonl], [pmix_have_htonl=yes], [pmix_have_htonl=no])
AS_IF([test "$pmix_cv_htonl_define" = "yes" || test "$pmix_have_htonl" = "yes"],
[AC_DEFINE_UNQUOTED([HAVE_UNIX_BYTESWAP], [1],
[whether unix byteswap routines -- htonl, htons, nothl, ntohs -- are available])])
# check pandoc separately so we can setup an AM_CONDITIONAL off it
AC_CHECK_PROG([pmix_have_pandoc], [pandoc], [yes], [no])
AM_CONDITIONAL([PMIX_HAVE_PANDOC], [test "x$pmix_have_pandoc" = "xyes"])
#
# Make sure we can copy va_lists (need check declared, not linkable)
#
@ -595,6 +605,18 @@ AC_DEFUN([PMIX_SETUP_CORE],[
PMIX_MUNGE_CONFIG
##################################
# MCA
##################################
pmix_show_title "Modular Component Architecture (MCA) setup"
AC_MSG_CHECKING([for subdir args])
PMIX_CONFIG_SUBDIR_ARGS([pmix_subdir_args])
AC_MSG_RESULT([$pmix_subdir_args])
PMIX_MCA
############################################################################
# final compiler config
############################################################################
@ -636,7 +658,14 @@ AC_DEFUN([PMIX_SETUP_CORE],[
pmix_show_subtitle "Final output"
AC_CONFIG_FILES(pmix_config_prefix[Makefile])
AC_CONFIG_FILES(
pmix_config_prefix[Makefile]
pmix_config_prefix[config/Makefile]
pmix_config_prefix[include/Makefile]
pmix_config_prefix[src/Makefile]
pmix_config_prefix[src/util/keyval/Makefile]
pmix_config_prefix[src/mca/base/Makefile]
)
# Success
$2
@ -654,6 +683,16 @@ AC_DEFUN([PMIX_DEFINE_ARGS],[
[pmix_mode=standalone
AC_MSG_RESULT([no])])
# Rename symbols?
AC_ARG_WITH([pmix-symbol-rename],
AC_HELP_STRING([--with-pmix-symbol-rename=FILE],
[Provide an include file that contains directives to rename PMIx symbols]))
AS_IF([test ! -z "$with_pmix_symbol_rename" && test "$with_pmix_symbol_rename" != "yes"],
[pmix_symbol_rename="$with_pmix_symbol_rename"],
[pmix_symbol_rename=\"src/include/rename.h\"])
AC_DEFINE_UNQUOTED(PMIX_SYMBOL_RENAME, [$pmix_symbol_rename],
[The pmix symbol rename include directive])
# Install tests and examples?
AC_MSG_CHECKING([if tests and examples are to be installed])
AC_ARG_WITH([tests-examples],
@ -665,11 +704,6 @@ AC_DEFUN([PMIX_DEFINE_ARGS],[
[pmix_tests=yes
AC_MSG_RESULT([yes])])
# Change the symbol prefix?
AC_ARG_WITH([pmix-symbol-prefix],
AC_HELP_STRING([--with-pmix-symbol-prefix=STRING],
[STRING can be any valid C symbol name. It will be prefixed to all public PMIx symbols. Default: "pmix_"]))
#
# Is this a developer copy?
#
@ -751,6 +785,20 @@ else
fi
AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1)
#
# Support per-user config files?
#
AC_ARG_ENABLE([per-user-config-files],
[AC_HELP_STRING([--enable-per-user-config-files],
[Disable per-user configuration files, to save disk accesses during job start-up. This is likely desirable for large jobs. Note that this can also be acheived by environment variables at run-time. (default: enabled)])])
if test "$enable_per_user_config_files" = "no" ; then
result=0
else
result=1
fi
AC_DEFINE_UNQUOTED([PMIX_WANT_HOME_CONFIG_FILES], [$result],
[Enable per-user config files])
#
# Do we want the pretty-print stack trace feature?
#
@ -770,26 +818,6 @@ AC_DEFINE_UNQUOTED([PMIX_WANT_PRETTY_PRINT_STACKTRACE],
[$WANT_PRETTY_PRINT_STACKTRACE],
[if want pretty-print stack trace feature])
#
# Do we want the shared memory datastore usage?
#
AC_MSG_CHECKING([if want special dstore usage])
AC_ARG_ENABLE([dstore],
[AC_HELP_STRING([--enable-dstore],
[Using special datastore (default: disabled)])])
if test "$enable_dstore" = "yes" ; then
AC_MSG_RESULT([yes])
WANT_DSTORE=1
else
AC_MSG_RESULT([no])
WANT_DSTORE=0
fi
AC_DEFINE_UNQUOTED([PMIX_ENABLE_DSTORE],
[$WANT_DSTORE],
[if want special dstore feature])
AM_CONDITIONAL([WANT_DSTORE],[test "x$enable_dstore" = "xyes"])
#
# Ident string
#
@ -832,11 +860,22 @@ fi
AC_DEFINE_UNQUOTED([PMIX_ENABLE_TIMING], [$WANT_TIMING],
[Whether we want developer-level timing support or not])
])dnl
#
# Install header files
#
AC_MSG_CHECKING([if want to head developer-level header files])
AC_ARG_WITH(devel-headers,
AC_HELP_STRING([--with-devel-headers],
[also install developer-level header files (only for internal PMIx developers, default: disabled)]))
if test "$with_devel_headers" = "yes"; then
AC_MSG_RESULT([yes])
WANT_INSTALL_HEADERS=1
else
AC_MSG_RESULT([no])
WANT_INSTALL_HEADERS=0
fi
# Specify the symbol prefix
AC_DEFUN([PMIX_SET_SYMBOL_PREFIX],[
pmix_symbol_prefix_value=$1
AM_CONDITIONAL([WANT_INSTALL_HEADERS], [test $WANT_INSTALL_HEADERS -eq 1])
])dnl
# This must be a standalone routine so that it can be called both by

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

@ -0,0 +1,147 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2012-2016 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
dnl Copyright (c) 2015 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([PMIX_CONFIG_SUBDIR],[
PMIX_VAR_SCOPE_PUSH([subdir_parent sub_configure subdir_dir subdir_srcdir subdir_cache_file subdir_args subdir_dots total_dir dir_part temp])
#
# Invoke configure in a specific subdirectory.
#
# $1 is the directory to invoke in
# $2 is the list of arguments to pass
# $3 is actions to execute upon success
# $4 is actions to execute upon failure
#
subdir_dir="$1"
subdir_args="$2"
subdir_success="$3"
subdir_failure="$4"
#
# Sanity checks
#
if test "$subdir_dir" != ":" && test -d $srcdir/$subdir_dir; then
AC_MSG_NOTICE([PMIX configuring in $subdir_dir])
#
# Gotta check where srcdir is for VPATH builds. If srcdir is not
# ., then we need to mkdir the subdir. Otherwise, we can just cd
# into it.
#
case $srcdir in
.)
;;
*)
{ case $subdir_dir in
[[\\/]]* | ?:[[\\/]]* ) total_dir=;;
*) total_dir=.;;
esac
temp=$subdir_dir
for dir_part in `IFS='/\\'; set X $temp; shift; echo "$[@]"`; do
case $dir_part in
# Skip DOS drivespec
?:) total_dir=$dir_part ;;
*) total_dir=$total_dir/$dir_part
test -d "$total_dir" ||
mkdir "$total_dir" ||
AC_MSG_ERROR([cannot create $subdir_dir])
;;
esac
done; }
if test -d ./$subdir_dir; then :;
else
AC_MSG_ERROR([cannot create `pwd`/$subdir_dir])
fi
;;
esac
#
# Move into the target directory
#
subdir_parent=`pwd`
cd $subdir_dir
#
# Make a "../" for each directory in $subdir_dir.
#
subdir_dots=`[echo $subdir_dir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g]'`
#
# Construct the --srcdir argument
#
case $srcdir in
.)
# In place
subdir_srcdir="$srcdir"
;;
[[\\/]* | ?:[\\/]*] )
# Absolute path
subdir_srcdir="$srcdir/$subdir_dir"
;;
*)
# Relative path
subdir_srcdir="$subdir_dots$srcdir/$subdir_dir"
;;
esac
#
# Construct the --cache-file argument
#
# BWB - subdir caching is a pain since we change CFLAGS and all that.
# Just disable it for now
subdir_cache_file="/dev/null"
#
# Invoke the configure script in the subdirectory
#
sub_configure="$SHELL '$subdir_srcdir/configure'"
AC_MSG_NOTICE([running $sub_configure $subdir_args --cache-file=$subdir_cache_file --srcdir=$subdir_srcdir --disable-option-checking])
eval "$sub_configure $subdir_args \
--cache-file=\"\$subdir_cache_file\" --srcdir=\"$subdir_srcdir\" --disable-option-checking"
if test "$?" = "0"; then
eval $subdir_success
AC_MSG_NOTICE([$sub_configure succeeded for $subdir_dir])
else
eval $subdir_failure
AC_MSG_NOTICE([$sub_configure *failed* for $subdir_dir])
fi
#
# Go back to the topdir
#
cd $subdir_parent
fi
#
# Clean up
#
PMIX_VAR_SCOPE_POP])dnl

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

@ -0,0 +1,84 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
dnl Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([PMIX_CONFIG_SUBDIR_ARGS],[
PMIX_VAR_SCOPE_PUSH([subdirs_str subdirs_skip subdirs_args subdirs_arg])
#
# Invoke configure in subdirectories.
#
# $1 is the name of the variable to assign the output to
#
#
# Make a list of command line args --eliminate the --srcdir and
# --cache-file args, because we need to replace them with our own
# values when invoking the sub-configure script. Also eliminate
# the --with-platform as this will confuse any subdir with
# similar options
#
subdirs_args=
subdirs_skip=no
eval "set x $ac_configure_args"
shift
for subdirs_arg
do
if test "$subdirs_skip" = "yes"; then
subdirs_skip=no
else
case $subdirs_arg in
-cache-file | --cache-file | -cache | --cache)
subdirs_skip=yes
;;
--config-cache | -C)
;;
-cache-file=* | --cache-file=*)
;;
-srcdir | --srcdir)
subdirs_skip=yes
;;
-srcdir=* | --srcdir=*)
;;
-with-platform=* | --with-platform=*)
;;
*)
case $subdir_arg in
*\'*) subdir_arg=`echo "$subdir_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
subdirs_args="$subdirs_args '$subdirs_arg'"
;;
esac
fi
done
#
# Assign the output
#
subdirs_str=$1=\"$subdirs_args\"
eval "$subdirs_str"
#
# Clean up
#
PMIX_VAR_SCOPE_POP])dnl

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

@ -12,7 +12,7 @@ dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2013 Intel, Inc. All rights reserved
dnl
dnl $COPYRIGHT$
@ -79,6 +79,15 @@ EOF
PMIX_LOG_MSG([--- ${1}], 1)
}
pmix_show_verbose() {
if test "$V" = "1"; then
cat <<EOF
+++ VERBOSE: ${1}
EOF
PMIX_LOG_MSG([--- ${1}], 1)
fi
}
#
# Save some stats about this build
#
@ -347,6 +356,35 @@ dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
# PMIX_FLAGS_APPEND_UNIQ(variable, new_argument)
# ----------------------------------------------
# Append new_argument to variable if:
#
# - the argument does not begin with -I, -L, or -l, or
# - the argument begins with -I, -L, or -l, and it's not already in variable
#
# This macro assumes a space seperated list.
AC_DEFUN([PMIX_FLAGS_APPEND_UNIQ], [
PMIX_VAR_SCOPE_PUSH([pmix_tmp pmix_append])
for arg in $2; do
pmix_tmp=`echo $arg | cut -c1-2`
pmix_append=1
AS_IF([test "$pmix_tmp" = "-I" || test "$pmix_tmp" = "-L" || test "$pmix_tmp" = "-l"],
[for val in ${$1}; do
AS_IF([test "x$val" = "x$arg"], [pmix_append=0])
done])
AS_IF([test "$pmix_append" = "1"],
[AS_IF([test -z "$$1"], [$1=$arg], [$1="$$1 $arg"])])
done
PMIX_VAR_SCOPE_POP
])
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
# Macro that serves as an alternative to using `which <prog>`. It is
# preferable to simply using `which <prog>` because backticks (`) (aka
# backquotes) invoke a sub-shell which may source a "noisy"

918
opal/mca/pmix/pmix2x/pmix/config/pmix_mca.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,918 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# PMIX_EVAL_ARG(arg)
# ------------------
# evaluates and returns argument
AC_DEFUN([PMIX_EVAL_ARG], [$1])
######################################################################
#
# PMIX_MCA
#
# configure the MCA (modular component architecture). Works hand in hand
# with PMIX's autogen.pl, requiring it's specially formatted lists
# of frameworks, components, etc.
#
# USAGE:
# PMIX_MCA()
#
######################################################################
AC_DEFUN([PMIX_MCA],[
dnl for PMIX_CONFIGURE_USER env variable
AC_REQUIRE([PMIX_CONFIGURE_SETUP])
# Find which components should be built as run-time loadable components
# Acceptable combinations:
#
# [default -- no option given]
# --enable-mca-dso
# --enable-mca-dso=[.+,]*COMPONENT_TYPE[.+,]*
# --enable-mca-dso=[.+,]*COMPONENT_TYPE-COMPONENT_NAME[.+,]*
# --disable-mca-dso
#
AC_ARG_ENABLE([mca-no-build],
[AC_HELP_STRING([--enable-mca-no-build=LIST],
[Comma-separated list of <type>-<component> pairs
that will not be built. Example: "--enable-mca-no-build=maffinity,btl-portals" will disable building all maffinity components and the "portals" btl components.])])
AC_ARG_ENABLE(mca-dso,
AC_HELP_STRING([--enable-mca-dso=LIST],
[Comma-separated list of types and/or
type-component pairs that will be built as
run-time loadable components (as opposed to
statically linked in), if supported on this
platform. The default is to build all components
as DSOs.]))
AC_ARG_ENABLE(mca-static,
AC_HELP_STRING([--enable-mca-static=LIST],
[Comma-separated list of types and/or
type-component pairs that will be built statically
linked into the library. The default (if DSOs are
supported) is to build all components as DSOs.
Enabling a component as static disables it
building as a DSO.]))
AC_ARG_ENABLE(mca-direct,
AC_HELP_STRING([--enable-mca-direct=LIST],
[Comma-separated list of type-component pairs that
will be hard coded as the one component to use for
a given component type, saving the (small)
overhead of the component architecture. LIST must
not be empty and implies given component pairs are
build as static components.]))
AC_MSG_CHECKING([which components should be disabled])
if test "$enable_mca_no_build" = "yes"; then
AC_MSG_RESULT([yes])
AC_MSG_ERROR([*** The enable-mca-no-build flag requires an explicit list
*** of type-component pairs. For example, --enable-mca-direct=pml-ob1])
else
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
msg=
for item in $enable_mca_no_build; do
type="`echo $item | cut -s -f1 -d-`"
comp="`echo $item | cut -s -f2- -d-`"
if test -z $type ; then
type=$item
fi
if test -z $comp ; then
str="`echo DISABLE_${type}=1 | sed s/-/_/g`"
eval $str
msg="$item $msg"
else
str="`echo DISABLE_${type}_${comp}=1 | sed s/-/_/g`"
eval $str
msg="$item $msg"
fi
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
#
# First, add all the mca-direct components / types into the mca-static
# lists and create a list of component types that are direct compile,
# in the form DIRECT_[type]=[component]
#
AC_MSG_CHECKING([which components should be direct-linked into the library])
if test "$enable_mca_direct" = "yes" ; then
AC_MSG_RESULT([yes])
AC_MSG_ERROR([*** The enable-mca-direct flag requires an explicit list of
*** type-component pairs. For example, --enable-mca-direct=pml-ob1,coll-basic])
elif test ! -z "$enable_mca_direct" && test "$enable_mca_direct" != "" ; then
#
# we need to add this into the static list, unless the static list
# is everything
#
if test "$enable_mca_static" = "no" ; then
AC_MSG_WARN([*** Re-enabling static component support for direct call])
enable_mca_static="$enable_mca_direct"
elif test -z "$enable_mca_static" ; then
enable_mca_static="$enable_mca_direct"
elif test "$enable_mca_static" != "yes" ; then
enable_mca_static="$enable_mca_direct,$enable_mca_static"
fi
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
msg=
for item in $enable_mca_direct; do
type="`echo $item | cut -f1 -d-`"
comp="`echo $item | cut -f2- -d-`"
if test -z $type || test -z $comp ; then
AC_MSG_ERROR([*** The enable-mca-direct flag requires a
*** list of type-component pairs. Invalid input detected.])
else
str="`echo DIRECT_$type=$comp | sed s/-/_/g`"
eval $str
msg="$item $msg"
fi
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
#
# Second, set the DSO_all and STATIC_all variables. conflict
# resolution (prefer static) is done in the big loop below
#
AC_MSG_CHECKING([which components should be run-time loadable])
if test "$enable_static" != "no"; then
DSO_all=0
msg=none
elif test -z "$enable_mca_dso" || test "$enable_mca_dso" = "yes"; then
DSO_all=1
msg=all
elif test "$enable_mca_dso" = "no"; then
DSO_all=0
msg=none
else
DSO_all=0
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
msg=
for item in $enable_mca_dso; do
str="`echo DSO_$item=1 | sed s/-/_/g`"
eval $str
msg="$item $msg"
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
if test "$enable_static" != "no"; then
AC_MSG_WARN([*** Shared libraries have been disabled (--disable-shared)])
AC_MSG_WARN([*** Building MCA components as DSOs automatically disabled])
fi
AC_MSG_CHECKING([which components should be static])
if test "$enable_mca_static" = "yes"; then
STATIC_all=1
msg=all
elif test -z "$enable_mca_static" || test "$enable_mca_static" = "no"; then
STATIC_all=0
msg=none
else
STATIC_all=0
ifs_save="$IFS"
IFS="${IFS}$PATH_SEPARATOR,"
msg=
for item in $enable_mca_static; do
str="`echo STATIC_$item=1 | sed s/-/_/g`"
eval $str
msg="$item $msg"
done
IFS="$ifs_save"
fi
AC_MSG_RESULT([$msg])
unset msg
# now configure the PMIx project. Most
# of the hard stuff is in here
MCA_PROJECT_SUBDIRS=
# can't use a variable rename here because these need to be evaled
# at auto* time.
pmix_show_subtitle "Configuring MCA"
AC_MSG_CHECKING([for frameworks])
AC_MSG_RESULT([mca_pmix_framework_list])
# iterate through the list of frameworks. There is something
# funky with m4 foreach if the list is defined, but empty. It
# will call the 3rd argument once with an empty value for the
# first argument. Protect against calling MCA_CONFIGURE_FRAMEWORK
# with an empty second argument. Grrr....
# if there isn't a project list, abort
#
# Also setup two variables for Makefiles:
# MCA_project_FRAMEWORKS - list of frameworks in that project
# MCA_project_FRAMEWORK_LIBS - list of libraries (or variables pointing
# to more libraries) that must be included
# in the project's main library
m4_ifdef([mca_pmix_framework_list], [],
[m4_fatal([Could not find mca_pmix_framework_list - please rerun autogen.pl])])
MCA_pmix_FRAMEWORKS=
MCA_pmix_FRAMEWORKS_SUBDIRS=
MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS=
MCA_pmix_FRAMEWORK_COMPONENT_DSO_SUBDIRS=
MCA_pmix_FRAMEWORK_COMPONENT_STATIC_SUBDIRS=
MCA_pmix_FRAMEWORK_LIBS=
m4_foreach(mca_framework, [mca_pmix_framework_list],
[m4_ifval(mca_framework,
[dnl common has to go up front
m4_if(mca_framework, [common],
[MCA_pmix_FRAMEWORKS="mca_framework $MCA_pmix_FRAMEWORKS"
MCA_pmix_FRAMEWORKS_SUBDIRS="[mca/]mca_framework $MCA_pmix_FRAMEWORKS_SUBDIRS"
MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS="[\$(MCA_pmix_]mca_framework[_ALL_SUBDIRS)] $MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS"
MCA_pmix_FRAMEWORK_COMPONENT_DSO_SUBDIRS="[\$(MCA_pmix_]mca_framework[_DSO_SUBDIRS)] $MCA_pmix_FRAMEWORK_COMPONENT_DSO_SUBDIRS"
MCA_pmix_FRAMEWORK_COMPONENT_STATIC_SUBDIRS="[\$(MCA_pmix_]mca_framework[_STATIC_SUBDIRS)] $MCA_pmix_FRAMEWORK_COMPONENT_STATIC_SUBDIRS"
], [
MCA_pmix_FRAMEWORKS="$MCA_pmix_FRAMEWORKS mca_framework"
MCA_pmix_FRAMEWORKS_SUBDIRS="$MCA_pmix_FRAMEWORKS_SUBDIRS [mca/]mca_framework"
MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS="$MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS [\$(MCA_pmix_]mca_framework[_ALL_SUBDIRS)]"
MCA_pmix_FRAMEWORK_COMPONENT_DSO_SUBDIRS="$MCA_pmix_FRAMEWORK_COMPONENT_DSO_SUBDIRS [\$(MCA_]pmix[_]mca_framework[_DSO_SUBDIRS)]"
MCA_pmix_FRAMEWORK_COMPONENT_STATIC_SUBDIRS="$MCA_pmix_FRAMEWORK_COMPONENT_STATIC_SUBDIRS [\$(MCA_pmix_]mca_framework[_STATIC_SUBDIRS)]"
MCA_pmix_FRAMEWORK_LIBS="$MCA_pmix_FRAMEWORK_LIBS [mca/]mca_framework[/libmca_]mca_framework[.la]"])
MCA_pmix_FRAMEWORK_LIBS="$MCA_pmix_FRAMEWORK_LIBS [\$(MCA_pmix_]mca_framework[_STATIC_LTLIBS)]"
m4_ifdef([MCA_pmix_]mca_framework[_CONFIG],
[MCA_pmix_]mca_framework[_CONFIG](mca_framework),
[MCA_CONFIGURE_FRAMEWORK(mca_framework, 1)])])])
# note that mca_wrapper_extra_* is a running list, and we take checkpoints at the end of our project
pmix_mca_wrapper_extra_cppflags="$mca_wrapper_extra_cppflags"
pmix_mca_wrapper_extra_ldflags="$mca_wrapper_extra_ldflags"
pmix_mca_wrapper_extra_libs="$mca_wrapper_extra_libs"
AC_SUBST(MCA_pmix_FRAMEWORKS)
AC_SUBST(MCA_pmix_FRAMEWORKS_SUBDIRS)
AC_SUBST(MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
AC_SUBST(MCA_pmix_FRAMEWORK_COMPONENT_DSO_SUBDIRS)
AC_SUBST(MCA_pmix_FRAMEWORK_COMPONENT_STATIC_SUBDIRS)
AC_SUBST(MCA_pmix_FRAMEWORK_LIBS)
AC_SUBST(MCA_PROJECT_SUBDIRS)
])
# MCA_ORDER_COMPONENT_LIST(framework_name)
AC_DEFUN([MCA_ORDER_COMPONENT_LIST], [
m4_foreach(mca_component, [mca_pmix_$1_m4_config_component_list],
[m4_ifval(mca_component,
[m4_ifdef([MCA_pmix_]$1[_]mca_component[_PRIORITY], [],
[m4_fatal([MCA_pmix_$1_]mca_component[_PRIORITY not found, but required.])])])])
m4_define([component_list],
[esyscmd([config/pmix_mca_priority_sort.pl] m4_foreach([mca_component], [mca_pmix_$1_m4_config_component_list],
[m4_ifval(mca_component, [mca_component ]PMIX_EVAL_ARG([MCA_pmix_]$1[_]mca_component[_PRIORITY ]))]))])
])
AC_DEFUN([MCA_CHECK_IGNORED_PRIORITY], [
m4_foreach(mca_component, [mca_pmix_$1_m4_config_component_list],
[m4_ifval(mca_component,
[m4_ifdef([MCA_pmix_]$1[_]mca_component[_PRIORITY],
[m4_warn([unsupported], [MCA_pmix_]$1[_]mca_component[_PRIORITY found, but ignored.])])])])
])
######################################################################
#
# MCA_CONFIGURE_FRAMEWORK
#
# Configure the given framework and all components inside the
# framework. Assumes that the framework is located in
# src/mca/[framework], and that all components are
# available under the framework directory. Will configure all
# no-configure and builtin components, then search for components with
# configure scripts. Assumes that no component is marked as builtin
# AND has a configure script.
#
# USAGE:
# MCA_CONFIGURE_FRAMEWORK(framework_name, allow_succeed)
#
######################################################################
AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
pmix_show_subsubtitle "Configuring MCA framework $1"
m4_ifdef([mca_pmix_$1_no_config_component_list], [],
[m4_fatal([Could not find mca_pmix_$1_no_config_component_list - please rerun autogen.pl])])
m4_ifdef([mca_pmix_$1_m4_config_component_list], [],
[m4_fatal([Could not find mca_pmix_$1_m4_config_component_list - please rerun autogen.pl])])
# setup for framework
all_components=
static_components=
dso_components=
static_ltlibs=
# Ensure that the directory where the #include file is to live
# exists. Need to do this for VPATH builds, because the directory
# may not exist yet. For the "common" type, it's not really a
# component, so it doesn't have a base.
m4_if([$1], [common], [outdir=src/mca/common], [outdir=src/mca/$1/base])
AS_MKDIR_P([$outdir])
# emit Makefile rule
AC_CONFIG_FILES([src/mca/$1/Makefile])
# remove any previously generated #include files
outfile_real=$outdir/static-components.h
outfile=$outfile_real.new
rm -f $outfile $outfile.struct $outfile.extern
touch $outfile.struct $outfile.extern
# print some nice messages about what we're about to do...
AC_MSG_CHECKING([for no configure components in framework $1])
AC_MSG_RESULT([mca_pmix_$1_no_config_component_list])
AC_MSG_CHECKING([for m4 configure components in framework $1])
AC_MSG_RESULT([mca_pmix_$1_m4_config_component_list])
# If there are components in the no configure list, but we're
# doing one of the "special" selection logics, abort with a
# reasonable message.
m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST],
[m4_ifval(mca_pmix_$1_no_config_component_list,
[m4_fatal([Framework $1 using STOP_AT_FIRST but at least one component has no configure.m4])])])
m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
[m4_ifval(mca_pmix_$1_no_config_component_list,
[m4_fatal([Framework $1 using STOP_AT_FIRST_PRIORITY but at least one component has no configure.m4])])])
m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [PRIORITY],
[m4_ifval(mca_pmix_$1_no_config_component_list,
[m4_fatal([Framework $1 using PRIORITY but at least one component has no configure.m4])])])
# run the configure logic for the no-config components
m4_foreach(mca_component, [mca_pmix_$1_no_config_component_list],
[m4_ifval(mca_component,
[MCA_CONFIGURE_NO_CONFIG_COMPONENT($1, mca_component,
[all_components],
[static_components],
[dso_components],
[static_ltlibs],
[$2])])])
# configure components that use built-in configuration scripts
m4_ifdef([component_list], [m4_undefine([component_list])])
m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST], [MCA_ORDER_COMPONENT_LIST($1)],
[m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY], [MCA_ORDER_COMPONENT_LIST($1)],
[m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [PRIORITY], [MCA_ORDER_COMPONENT_LIST($1)],
[m4_define([component_list], [mca_pmix_$1_m4_config_component_list])])])])
best_mca_component_priority=0
components_looking_for_succeed=$2
components_last_result=0
m4_foreach(mca_component, [component_list],
[m4_ifval(mca_component,
[m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
[AS_IF([test $best_mca_component_priority -gt MCA_pmix_$1_]mca_component[_PRIORITY], [components_looking_for_succeed=0])])
MCA_CONFIGURE_M4_CONFIG_COMPONENT($1, mca_component,
[all_components],
[static_components],
[dso_components],
[static_ltlibs],
[$components_looking_for_succeed],
[components_last_result=1],
[components_last_result=0])
m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST],
[AS_IF([test $components_last_result -eq 1], [components_looking_for_succeed=0])])
m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY],
[AS_IF([test $components_last_result -eq 1], [best_mca_component_priority=]PMIX_EVAL_ARG([MCA_pmix_$1_]mca_component[_PRIORITY]))])
])])
# configure components that provide their own configure script.
# It would be really hard to run these for "find first that
# works", so we don't :)
m4_if(PMIX_EVAL_ARG([MCA_pmix_]$1[_CONFIGURE_MODE]), [STOP_AT_FIRST], [],
[m4_if(PMIX_EVAL_ARG([MCA_pmix_]$1[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY], [],
[m4_if(PMIX_EVAL_ARG([MCA_pmix_]$1[_CONFIGURE_MODE]), [PRIORITY], [],
[MCA_CHECK_IGNORED_PRIORITY($1)
AS_IF([test "$2" != "0"],
[MCA_CONFIGURE_ALL_CONFIG_COMPONENTS($1, [all_components],
[static_components], [dso_components],
[static_ltlibs])])])])])
MCA_pmix_$1_ALL_COMPONENTS="$all_components"
MCA_pmix_$1_STATIC_COMPONENTS="$static_components"
MCA_pmix_$1_DSO_COMPONENTS="$dso_components"
MCA_pmix_$1_STATIC_LTLIBS="$static_ltlibs"
AC_SUBST(MCA_pmix_$1_ALL_COMPONENTS)
AC_SUBST(MCA_pmix_$1_STATIC_COMPONENTS)
AC_SUBST(MCA_pmix_$1_DSO_COMPONENTS)
AC_SUBST(MCA_pmix_$1_STATIC_LTLIBS)
PMIX_MCA_MAKE_DIR_LIST(MCA_pmix_$1_ALL_SUBDIRS, $1, [$all_components])
PMIX_MCA_MAKE_DIR_LIST(MCA_pmix_$1_STATIC_SUBDIRS, $1, [$static_components])
PMIX_MCA_MAKE_DIR_LIST(MCA_pmix_$1_DSO_SUBDIRS, $1, [$dso_components])
# Create the final .h file that will be included in the type's
# top-level glue. This lists all the static components. We don't
# need to do this for "common".
if test "$2" != "common"; then
cat > $outfile <<EOF
/*
* \$HEADER\$
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
`cat $outfile.extern`
const pmix_mca_base_component_t *mca_$1_base_static_components[[]] = {
`cat $outfile.struct`
NULL
};
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
EOF
# Only replace the header file if a) it doesn't previously
# exist, or b) the contents are different. Do this to not
# trigger recompilation of certain .c files just because the
# timestamp changed on $outfile_real (similar to the way AC
# handles AC_CONFIG_HEADER files).
diff $outfile $outfile_real > /dev/null 2>&1
if test "$?" != "0"; then
mv $outfile $outfile_real
else
rm -f $outfile
fi
fi
rm -f $outfile.struct $outfile.extern
unset all_components static_components dso_components outfile outfile_real
])
######################################################################
#
# MCA_CONFIGURE_NO_CONFIG_COMPONENT
#
# Configure the given framework and all components inside the framework.
# Assumes that the framework is located in [project_name]/mca/[framework],
# and that all components are available under the framework directory.
# Will configure all builtin components, then search for components with
# configure scripts. Assumes that no component is marked as builtin
# AND has a configure script.
#
# USAGE:
# MCA_CONFIGURE_PROJECT(framework_name, component_name
# all_components_variable,
# static_components_variable,
# dso_components_variable,
# static_ltlibs_variable,
# allowed_to_succeed)
#
######################################################################
AC_DEFUN([MCA_CONFIGURE_NO_CONFIG_COMPONENT],[
pmix_show_subsubsubtitle "MCA component $1:$2 (no configuration)"
pmix_show_verbose "PMIX_MCA_NO_CONFIG_COMPONENT: before, should_build=$7"
MCA_COMPONENT_BUILD_CHECK($1, $2,
[should_build=$7], [should_build=0])
MCA_COMPONENT_COMPILE_MODE($1, $2, compile_mode)
pmix_show_verbose "PMIX_MCA_NO_CONFIG_COMPONENT: after, should_build=$should_build"
if test "$should_build" = "1" ; then
MCA_PROCESS_COMPONENT($1, $2, $3, $4, $5, $6, $compile_mode)
else
MCA_PROCESS_DEAD_COMPONENT($1, $2)
# add component to all component list
$3="$$3 $2"
fi
# set the AM_CONDITIONAL on how we should build
if test "$compile_mode" = "dso" ; then
BUILD_pmix_$1_$2_DSO=1
else
BUILD_pmix_$1_$2_DSO=0
fi
AM_CONDITIONAL(MCA_BUILD_pmix_$1_$2_DSO, test "$BUILD_pmix_$1_$2_DSO" = "1")
AC_CONFIG_FILES([src/mca/$1/$2/Makefile])
unset compile_mode
])
######################################################################
#
# MCA_CONFIGURE_M4_CONFIG_COMPONENT
#
#
# USAGE:
# MCA_CONFIGURE_PROJECT(framework_name, component_name
# all_components_variable,
# static_components_variable,
# dso_components_variable,
# static_ltlibs_variable,
# allowed_to_succeed,
# [eval if should build],
# [eval if should not build])
#
######################################################################
AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
m4_ifdef([MCA_pmix_$1_$2_PRIORITY],
[pmix_show_subsubsubtitle "MCA component $1:$2 (m4 configuration macro, priority MCA_pmix_$1_$2_PRIORITY)"],
[pmix_show_subsubsubtitle "MCA component $1:$2 (m4 configuration macro)"])
pmix_show_verbose "PMIX_MCA_M4_CONFIG_COMPONENT: before, should_build=$7"
MCA_COMPONENT_BUILD_CHECK($1, $2, [should_build=$7], [should_build=0])
# Allow the component to override the build mode if it really wants to.
# It is, of course, free to end up calling MCA_COMPONENT_COMPILE_MODE
m4_ifdef([MCA_pmix_$1_$2_COMPILE_MODE],
[MCA_pmix_$1_$2_COMPILE_MODE($1, $2, compile_mode)],
[MCA_COMPONENT_COMPILE_MODE($1, $2, compile_mode)])
# try to configure the component
m4_ifdef([MCA_pmix_$1_$2_CONFIG],
[MCA_pmix_$1_$2_CONFIG([should_build=$should_build],
[should_build=0])],
[m4_fatal([MCA_pmix_$1_$2_CONFIG macro not found])])
pmix_show_verbose "PMIX_MCA_M4_CONFIG_COMPONENT: after, should_build=$should_build"
AS_IF([test "$should_build" = "1"],
[MCA_PROCESS_COMPONENT($1, $2, $3, $4, $5, $6, $compile_mode)],
[MCA_PROCESS_DEAD_COMPONENT($1, $2)
# add component to all component list
$3="$$3 $2"])
m4_ifdef([MCA_pmix_$1_$2_POST_CONFIG],
[ MCA_pmix_$1_$2_POST_CONFIG($should_build)])
# set the AM_CONDITIONAL on how we should build
AS_IF([test "$compile_mode" = "dso"],
[BUILD_pmix_$1_$2_DSO=1],
[BUILD_pmix_$1_$2_DSO=0])
AM_CONDITIONAL(MCA_BUILD_pmix_$1_$2_DSO, test "$BUILD_pmix_$1_$2_DSO" = "1")
AS_IF([test "$should_build" = "1"], [$8], [$9])
unset compile_mode
])
######################################################################
#
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS
#
# configure all components in the given framework that have configure
# scripts and should be configured according to the usual rules...
#
# USAGE:
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS(framework_name,
# all_components_variable,
# static_components_variable,
# dso_components_variable,
# static_ltlibs_variable)
#
######################################################################
AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
for component_path in $srcdir/src/mca/$1/* ; do
component="`basename $component_path`"
if test -d $component_path && test -x $component_path/configure ; then
pmix_show_subsubsubtitle "MCA component $1:$component (need to configure)"
pmix_show_verbose "PMIX_MCA_ALL_CONFIG_COMPONENTS: before, should_build=$7"
MCA_COMPONENT_BUILD_CHECK($1, $component,
[should_build=1], [should_build=0])
MCA_COMPONENT_COMPILE_MODE($1, $component, compile_mode)
pmix_show_verbose "PMIX_MCA_ALL_CONFIG_COMPONENTS: after, should_build=$should_build"
if test "$should_build" = "1" ; then
PMIX_CONFIG_SUBDIR([src/mca/$1/$component],
[$pmix_subdir_args],
[should_build=1], [should_build=0])
pmix_show_verbose "PMIX_MCA_ALL_CONFIG_COMPONENTS: after subdir, should_build=$should_build"
fi
if test "$should_build" = "1" ; then
# do some extra work to pass flags back from the
# top-level configure, the way a configure.m4
# component would.
infile="$srcdir/src/mca/$1/$2/post_configure.sh"
if test -f $infile; then
# First check for the ABORT tag
line="`$GREP ABORT= $infile | cut -d= -f2-`"
if test -n "$line" && test "$line" != "no"; then
AC_MSG_WARN([MCA component configure script told me to abort])
AC_MSG_ERROR([cannot continue])
fi
m4_foreach(flags, [LDFLAGS, LIBS],
[[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
eval "line=$line"
if test -n "$line"; then
$2[_]$3[_WRAPPER_EXTRA_]flags[="$line"]
fi
])dnl
fi
MCA_PROCESS_COMPONENT($1, $component, $2, $3, $4, $5, $compile_mode)
else
MCA_PROCESS_DEAD_COMPONENT($1, $component)
fi
fi
done
])
# MCA_COMPONENT_COMPILE_MODE(framework_name (1),
# component_name (2), compile_mode_variable (3))
# -------------------------------------------------------------------------
# set compile_mode_variable to the compile mode for the given component
#
# NOTE: component_name may not be determined until runtime....
AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
SHARED_FRAMEWORK="$DSO_$1"
AS_LITERAL_IF([$2],
[SHARED_COMPONENT="$DSO_$1_$2"],
[str="SHARED_COMPONENT=\$DSO_$1_$2"
eval $str])
STATIC_FRAMEWORK="$STATIC_$1"
AS_LITERAL_IF([$2],
[STATIC_COMPONENT="$STATIC_$1_$2"],
[str="STATIC_COMPONENT=\$STATIC_$1_$2"
eval $str])
shared_mode_override=static
# Setup for either shared or static
if test "$STATIC_FRAMEWORK" = "1" || \
test "$STATIC_COMPONENT" = "1" || \
test "$STATIC_all" = "1" ; then
$3="static"
elif test "$shared_mode_override" = "dso" || \
test "$SHARED_FRAMEWORK" = "1" || \
test "$SHARED_COMPONENT" = "1" || \
test "$DSO_all" = "1"; then
$3="dso"
else
$3="static"
fi
AC_MSG_CHECKING([for MCA component $1:$2 compile mode])
if test "$DIRECT_$1" = "$2" ; then
AC_MSG_RESULT([$$3 - direct])
else
AC_MSG_RESULT([$$3])
fi
])
# MCA_PROCESS_COMPONENT(framework_name (1), component_name (2),
# all_components_variable (3), static_components_variable (4)
# dso_components_variable (5), static_ltlibs_variable (6),
# compile_mode_variable (7))
#---------------------------------------------------------------------
# Final setup work for a given component. It should be known before
# calling that this component can build properly (and exists)
#
# NOTE: component_name may not be determined until runtime....
AC_DEFUN([MCA_PROCESS_COMPONENT],[
AC_REQUIRE([AC_PROG_GREP])
# See if it dropped an output file for us to pick up some
# shell variables in.
infile="$srcdir/src/mca/$1/$2/post_configure.sh"
# Add this subdir to the mast list of all MCA component subdirs
$3="$$3 $2"
if test "$7" = "dso" ; then
$5="$$5 $2"
else
if test "$1" = "common"; then
# Static libraries in "common" frameworks are installed, and
# therefore must obey the $FRAMEWORK_LIB_PREFIX that was
# set.
$6="mca/$1/$2/lib${m4_translit([pmix], [a-z], [A-Z])_LIB_PREFIX}mca_$1_$2.la $$6"
else
# Other frameworks do not have to obey the
# $FRAMEWORK_LIB_PREFIX prefix.
$6="mca/$1/$2/libmca_$1_$2.la $$6"
fi
echo "extern const pmix_mca_base_component_t mca_$1_$2_component;" >> $outfile.extern
echo " &mca_$1_$2_component, " >> $outfile.struct
$4="$$4 $2"
fi
# Output pretty results
AC_MSG_CHECKING([if MCA component $1:$2 can compile])
AC_MSG_RESULT([yes])
dnl BWB: FIX ME: We still use the post_configure.sh for frameworks that use the direct call infrastructure.
dnl All other uses we can ignore here, because config_components will have read it in and set all the
dnl proper environment variables. At some point, we should handle the direct call stuff the same way we
dnl handle the headers for static components like timers in PMIx, ie, have a framework level configure.m4 that
dnl does the right thing
if test -f $infile; then
# check for direct call header to include. This will be
# AC_SUBSTed later.
if test "$DIRECT_$1" = "$2" ; then
if test "`$GREP DIRECT_CALL_HEADER $infile`" != "" ; then
line="`$GREP DIRECT_CALL_HEADER $infile | cut -d= -f2-`"
str="MCA_pmix_$1_DIRECT_CALL_HEADER=$line"
eval $str
else
AC_MSG_ERROR([*** $1 component $2 was supposed to be direct-called, but
*** does not appear to support direct calling.
*** Aborting])
fi
fi
else
# were we supposed to have found something in the
# post_configure.sh, but the file didn't exist?
if test "$DIRECT_$1" = "$2" ; then
AC_MSG_ERROR([*** $1 component $2 was supposed to be direct-called, but
*** does not appear to support direct calling.
*** Aborting])
fi
fi
# if the component is building, add it's WRAPPER_EXTRA_LDFLAGS and
# WRAPPER_EXTRA_LIBS. If the component doesn't specify it's
# WRAPPER_EXTRA_LIBS and WRAPPER_EXTRA_LDFLAGS, try using LDFLAGS and LIBS if
# component didn't have it's own configure script (in which case,
# we know it didn't set LDFLAGS and LIBS because it can't) Don't
# have to do this if the component is building dynamically,
# because it will link against these (without a dependency from
# libmpi.so to these flags)
if test "$7" = "static"; then
AS_LITERAL_IF([$2],
[m4_foreach(flags, [LDFLAGS, LIBS],
[AS_IF([test "$$1_$2_WRAPPER_EXTRA_]flags[" = ""],
[PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$1_$2_]flags)],
[PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$1_$2_WRAPPER_EXTRA_]flags)])
])],
[m4_foreach(flags, [LDFLAGS, LIBS],
[[str="line=\$$1_$2_WRAPPER_EXTRA_]flags["]
eval "$str"
PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$line])])])
fi
# if needed, copy over WRAPPER_EXTRA_CPPFLAGS. Since a configure script
# component can never be used in a STOP_AT_FIRST framework, we
# don't have to implement the else clause in the literal check...
AS_LITERAL_IF([$2],
[AS_IF([test "$$1_$2_WRAPPER_EXTRA_CPPFLAGS" != ""],
[m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
AS_IF([test "$7" = "static" && test "$stop_at_first" = "1"],
[AS_IF([test "$with_devel_headers" = "yes"],
[PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$1_$2_WRAPPER_EXTRA_CPPFLAGS])])],
[AC_MSG_WARN([ignoring $1_$2_WRAPPER_EXTRA_CPPFLAGS ($$1_$2_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])])
])
# MCA_PROCESS_DEAD_COMPONENT(framework_name (1),
# component_name (2))
# ----------------------------------------------------------------
# Finall setup work for a component that can not be built. Do the
# last minute checks to make sure the user isn't doing something
# stupid.
#
# NOTE: component_name may not be determined until runtime....
AC_DEFUN([MCA_PROCESS_DEAD_COMPONENT],[
AC_MSG_CHECKING([if MCA component $1:$2 can compile])
AC_MSG_RESULT([no])
# If this component was requested as the default for this
# type, then abort.
if test "$with_$1" = "$2" ; then
AC_MSG_WARN([MCA component "$2" failed to configure properly])
AC_MSG_WARN([This component was selected as the default])
AC_MSG_ERROR([Cannot continue])
fi
if test ! -z "$DIRECT_$1" ; then
if test "$DIRECT_$1" = "$2" ; then
AC_MSG_WARN([MCA component "$2" failed to configure properly])
AC_MSG_WARN([This component was selected as the default (direct call)])
AC_MSG_ERROR([Cannot continue])
fi
fi
])
# MCA_COMPONENT_BUILD_CHECK(framework_name(1),
# component_name (2), action-if-build (3)
# action-if-not-build (4)
# -----------------------------------------------------------------
# checks the standard rules of component building to see if the
# given component should be built.
#
# Note: component_name may not be determined until runtime....
AC_DEFUN([MCA_COMPONENT_BUILD_CHECK],[
AC_REQUIRE([AC_PROG_GREP])
component_path="$srcdir/src/mca/$1/$2"
want_component=0
# build if:
# - the component type is direct and we are that component
# - there is no pmix_ignore file
# - there is an pmix_ignore, but there is an empty pmix_unignore
# - there is an pmix_ignore, but username is in pmix_unignore
if test -d $component_path ; then
# decide if we want the component to be built or not. This
# is spread out because some of the logic is a little complex
# and test's syntax isn't exactly the greatest. We want to
# build the component by default.
want_component=1
if test -f $component_path/.pmix_ignore ; then
# If there is an pmix_ignore file, don't build
# the component. Note that this decision can be
# overridden by the unignore logic below.
want_component=0
fi
if test -f $component_path/.pmix_unignore ; then
# if there is an empty pmix_unignore, that is
# equivalent to having your userid in the unignore file.
# If userid is in the file, unignore the ignore file.
if test ! -s $component_path/.pmix_unignore ; then
want_component=1
elif test ! -z "`$GREP $PMIX_CONFIGURE_USER $component_path/.pmix_unignore`" ; then
want_component=1
fi
fi
# if this component type is direct and we are not it, we don't want
# to be built. Otherwise, we do want to be built.
if test ! -z "$DIRECT_$1" ; then
if test "$DIRECT_$1" = "$2" ; then
want_component=1
else
want_component=0
fi
fi
fi
# if we were explicitly disabled, don't build :)
AS_IF([test "$DISABLE_$1" = "1"], [want_component=0])
AS_LITERAL_IF([$2],
[AS_IF([test "$DISABLE_$1_$2" = "1"], [want_component=0])],
[str="DISABLED_COMPONENT_CHECK=\$DISABLE_$1_$2"
eval $str
if test "$DISABLED_COMPONENT_CHECK" = "1" ; then
want_component=0
fi])
AS_IF([test "$want_component" = "1"], [$3], [$4])
])
# MCA_SETUP_DIRECT_CALL(framework_name (1))
# -------------------------------------------------------------
AC_DEFUN([MCA_SETUP_DIRECT_CALL],[
if test ! -z "$DIRECT_$1" ; then
MCA_pmix_$1_DIRECT_CALL_COMPONENT=$DIRECT_$1
MCA_pmix_$1_DIRECT_CALL=1
else
MCA_pmix_$1_DIRECT_CALL_COMPONENT=
MCA_pmix_$1_DIRECT_CALL=0
fi
AC_SUBST(MCA_pmix_$1_DIRECT_CALL_HEADER)
AC_DEFINE_UNQUOTED([MCA_pmix_$2_DIRECT_CALL], [$MCA_pmix_$1_DIRECT_CALL],
[Defined to 1 if PMIx:$1 should use direct calls instead of components])
AC_DEFINE_UNQUOTED([MCA_pmix_$1_DIRECT_CALL_COMPONENT], [$MCA_pmix_$1_DIRECT_CALL_COMPONENT],
[name of component to use for direct calls, if MCA_pmix_$1_DIRECT_CALL is 1])
AC_DEFINE_UNQUOTED([MCA_pmix_$1_DIRECT_CALL_HEADER],
["[$MCA_pmix_]$1[_DIRECT_CALL_HEADER]"],
[Header PMIx:$1 includes to be direct called])
])
# PMIX_MCA_MAKE_DIR_LIST(subst'ed variable, framework, shell list)
# -------------------------------------------------------------------------
AC_DEFUN([PMIX_MCA_MAKE_DIR_LIST],[
$1=
for item in $3 ; do
$1="$$1 mca/$2/$item"
done
AC_SUBST($1)
])

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

@ -0,0 +1,31 @@
#!/usr/bin/env perl
#
# Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
my $components;
my @result;
while (@ARGV) {
my $component;
$component->{"name"} = shift(@ARGV);
$component->{"value"} = shift(@ARGV);
push(@{$components}, $component);
}
foreach my $component (sort { $b->{value} <=> $a->{value} } @{$components}) {
push(@result, $component->{name});
}
sub commify_series {
(@_ == 0) ? '' :
(@_ == 1) ? $_[0] :
join(", ", @_[0 .. ($#_-1)], "$_[-1]");
}
print commify_series(@result);

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

@ -10,7 +10,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2006-2011 Los Alamos National Security, LLC. All rights
# reserved.
@ -33,14 +33,21 @@
# Initialization, version number, and other random setup/init stuff
############################################################################
# Load in everything found by autogen.pl
m4_include([config/autogen_found_items.m4])
# We don't have the version number to put in here yet, and we can't
# call PMIX_GET_VERSION (etc.) before AC_INIT. So use the shell
# version.
AC_INIT([pmix],
[m4_normalize(esyscmd([config/pmix_get_version.sh VERSION --tarball]))],
[http://www.open-mpi.org/projects/pmix/], [pmix])
[http://pmix.github.io/master], [pmix])
AC_PREREQ(2.69)
AC_CONFIG_AUX_DIR(./config)
# Note that this directory must *exactly* match what was specified via
# -I in ACLOCAL_AMFLAGS in the top-level Makefile.am.
AC_CONFIG_MACRO_DIR(./config)
AC_CONFIG_MACRO_DIRS(./config)
# Get our platform support file. This has to be done very, very early
# because it twiddles random bits of autoconf
@ -103,11 +110,11 @@ AH_TOP([/* -*- c -*-
#ifndef PMIX_CONFIG_H
#define PMIX_CONFIG_H
#include <pmix/autogen/pmix_config_top.h>
#include <src/include/pmix_config_top.h>
])
AH_BOTTOM([
#include <pmix/autogen/pmix_config_bottom.h>
#include <src/include/pmix_config_bottom.h>
#endif /* PMIX_CONFIG_H */
])
@ -137,6 +144,7 @@ AM_DISABLE_STATIC
# This did not exist pre AM 1.11.x (where x is somewhere >0 and <3),
# but it is necessary in AM 1.12.x.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_PROG_LEX
LT_INIT()
LT_LANG([C])
@ -160,7 +168,7 @@ AS_IF([test "$pmix_debug" = "1"],
############################################################################
# Setup the pmix core
PMIX_SETUP_CORE([])
PMIX_SETUP_CORE()
# Run the AM_CONDITIONALs
PMIX_DO_AM_CONDITIONALS
@ -209,6 +217,7 @@ AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
AC_SUBST([libpmix_so_version])
AC_CONFIG_FILES(pmix_config_prefix[examples/Makefile]
pmix_config_prefix[man/Makefile]
pmix_config_prefix[test/Makefile]
pmix_config_prefix[test/simple/Makefile])

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

@ -1,3 +0,0 @@
enable_mem_debug=no
enable_mem_profile=no
enable_debug=no

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

@ -25,27 +25,27 @@ noinst_PROGRAMS = client dmodex dynamic fault pub tool
client_SOURCES = client.c
client_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
client_LDADD = $(top_builddir)/libpmix.la
client_LDADD = $(top_builddir)/src/libpmix.la
dmodex_SOURCES = dmodex.c
dmodex_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
dmodex_LDADD = $(top_builddir)/libpmix.la
dmodex_LDADD = $(top_builddir)/src/libpmix.la
dynamic_SOURCES = dynamic.c
dynamic_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
dynamic_LDADD = $(top_builddir)/libpmix.la
dynamic_LDADD = $(top_builddir)/src/libpmix.la
fault_SOURCES = fault.c
fault_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
fault_LDADD = $(top_builddir)/libpmix.la
fault_LDADD = $(top_builddir)/src/libpmix.la
pub_SOURCES = pub.c
pub_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
pub_LDADD = $(top_builddir)/libpmix.la
pub_LDADD = $(top_builddir)/src/libpmix.la
tool_SOURCES = tool.c
tool_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
tool_LDADD = $(top_builddir)/libpmix.la
tool_LDADD = $(top_builddir)/src/libpmix.la
distclean-local:
rm -f *.o client dmodex dynamic fault pub server

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

@ -30,6 +30,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <sys/param.h>
#include <pmix.h>
@ -45,7 +46,7 @@ int main(int argc, char **argv)
uint32_t nprocs;
char nsp2[PMIX_MAX_NSLEN+1];
pmix_app_t *app;
char hostname[PMIX_MAXHOSTNAMELEN], dir[1024];
char hostname[MAXHOSTNAMELEN], dir[1024];
pmix_proc_t *peers;
size_t npeers, ntmp=0;
char *nodelist;

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

@ -1,6 +1,5 @@
#
# Copyright 2015-2016 Intel, Inc. All rights reserved
# Copyright (c) 2016 IBM Corporation. All rights reserved.
#
# $COPYRIGHT$
#
@ -11,26 +10,13 @@
# Only install the headers if we're in standalone mode
if ! PMIX_EMBEDDED_MODE
include_HEADERS = \
include/pmix.h \
include/pmix_server.h \
include/pmi.h \
include/pmi2.h \
include/pmix_tool.h
include_pmixdir = $(includedir)/pmix
include_pmix_HEADERS = \
include/pmix/rename.h \
include/pmix/pmix_common.h
include_pmix_autogendir = $(includedir)/pmix/autogen
include_pmix_autogen_HEADERS = \
include/pmix/autogen/pmix_config_top.h \
include/pmix/autogen/pmix_config_bottom.h \
include/pmix/autogen/pmix_stdint.h
nodist_include_pmix_autogen_HEADERS = \
include/pmix/autogen/config.h
pmix.h \
pmix_common.h \
pmix_server.h \
pmi.h \
pmi2.h \
pmix_tool.h
endif ! PMIX_EMBEDDED_MODE

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

@ -46,16 +46,13 @@
#ifndef PMIx_H
#define PMIx_H
#include <pmix/autogen/config.h>
/* Symbol transforms */
#include <pmix/rename.h>
/* Structure and constant definitions */
#include <pmix/pmix_common.h>
#include <pmix_common.h>
BEGIN_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**** PMIX API ****/
@ -438,5 +435,10 @@ pmix_status_t PMIx_Query_info_nb(pmix_query_t queries[], size_t nqueries,
pmix_status_t PMIx_Log_nb(const pmix_info_t data[], size_t ndata,
const pmix_info_t directives[], size_t ndirs,
pmix_op_cbfunc_t cbfunc, void *cbdata);
END_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

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

@ -1,424 +0,0 @@
/*
* Copyright 2015 Intel, Inc. All rights reserved
*/
#ifndef PMIX_RENAME_H
#define PMIX_RENAME_H
#include <pmix/autogen/config.h>
BEGIN_C_DECLS
/* Only enact these defines if we're actually renaming the symbols
(i.e., avoid trying to have no-op defines if we're *not*
renaming).
Note that we don't symbol shift if we aren't in embedded mode
as that wouldn't make any sense. If we are in embedded mode,
then we aren't building the PMI-1/2 APIs as that also doesn't
make any sense
*/
#if PMIX_SYM_TRANSFORM
/* Use a preprocessor two-step in order to get the prefixing right.
Make 2 macros: PMIX_NAME and PMIX_NAME_CAPS for renaming
things. */
#define PMIX_MUNGE_NAME(a, b) PMIX_MUNGE_NAME2(a, b)
#define PMIX_MUNGE_NAME2(a, b) a ## b
#define PMIX_NAME(name) PMIX_MUNGE_NAME(PMIX_SYM_PREFIX, pmix_ ## name)
#define PMIX_NAME_CAPS(name) PMIX_MUNGE_NAME(PMIX_SYM_PREFIX_CAPS, PMIx_ ## name)
/* Now define all the "real" names to be the prefixed names. This
allows us to use the real names throughout the code base (i.e.,
"pmix_<foo>"); the preprocessor will adjust to have the prefixed
name under the covers. */
/* PMIx APIs */
#define PMI2_Abort PMIX_NAME_CAPS(PMI2_Abort)
#define PMI2_Finalize PMIX_NAME_CAPS(PMI2_Finalize)
#define PMI2_Info_GetJobAttr PMIX_NAME_CAPS(PMI2_Info_GetJobAttr)
#define PMI2_Info_GetJobAttrIntArray PMIX_NAME_CAPS(PMI2_Info_GetJobAttrIntArray)
#define PMI2_Info_GetNodeAttr PMIX_NAME_CAPS(PMI2_Info_GetNodeAttr)
#define PMI2_Info_GetSize PMIX_NAME_CAPS(PMI2_Info_GetSize)
#define PMI2_Info_PutNodeAttr PMIX_NAME_CAPS(PMI2_Info_PutNodeAttr)
#define PMI2_Init PMIX_NAME_CAPS(PMI2_Init)
#define PMI2_Initialized PMIX_NAME_CAPS(PMI2_Initialized)
#define PMI2_Job_Connect PMIX_NAME_CAPS(PMI2_Job_Connect)
#define PMI2_Job_Disconnect PMIX_NAME_CAPS(PMI2_Job_Disconnect)
#define PMI2_Job_GetId PMIX_NAME_CAPS(PMI2_Job_GetId)
#define PMI2_Job_GetRank PMIX_NAME_CAPS(PMI2_Job_GetRank)
#define PMI2_Job_Spawn PMIX_NAME_CAPS(PMI2_Job_Spawn)
#define PMI2_KVS_Fence PMIX_NAME_CAPS(PMI2_KVS_Fence)
#define PMI2_KVS_Get PMIX_NAME_CAPS(PMI2_KVS_Get)
#define PMI2_KVS_Put PMIX_NAME_CAPS(PMI2_KVS_Put)
#define PMI2_Nameserv_lookup PMIX_NAME_CAPS(PMI2_Nameserv_lookup)
#define PMI2_Nameserv_publish PMIX_NAME_CAPS(PMI2_Nameserv_publish)
#define PMI2_Nameserv_unpublish PMIX_NAME_CAPS(PMI2_Nameserv_unpublish)
#define PMI_Abort PMIX_NAME_CAPS(PMI_Abort)
#define PMI_Args_to_keyval PMIX_NAME_CAPS(PMI_Args_to_keyval)
#define PMI_Barrier PMIX_NAME_CAPS(PMI_Barrier)
#define PMI_Finalize PMIX_NAME_CAPS(PMI_Finalize)
#define PMI_Free_keyvals PMIX_NAME_CAPS(PMI_Free_keyvals)
#define PMI_Get_appnum PMIX_NAME_CAPS(PMI_Get_appnum)
#define PMI_Get_clique_ranks PMIX_NAME_CAPS(PMI_Get_clique_ranks)
#define PMI_Get_clique_size PMIX_NAME_CAPS(PMI_Get_clique_size)
#define PMI_Get_id PMIX_NAME_CAPS(PMI_Get_id)
#define PMI_Get_id_length_max PMIX_NAME_CAPS(PMI_Get_id_length_max)
#define PMI_Get_kvs_domain_id PMIX_NAME_CAPS(PMI_Get_kvs_domain_id)
#define PMI_Get_options PMIX_NAME_CAPS(PMI_Get_options)
#define PMI_Get_rank PMIX_NAME_CAPS(PMI_Get_rank)
#define PMI_Get_size PMIX_NAME_CAPS(PMI_Get_size)
#define PMI_Get_universe_size PMIX_NAME_CAPS(PMI_Get_universe_size)
#define PMI_Init PMIX_NAME_CAPS(PMI_Init)
#define PMI_Initialized PMIX_NAME_CAPS(PMI_Initialized)
#define PMI_KVS_Commit PMIX_NAME_CAPS(PMI_KVS_Commit)
#define PMI_KVS_Create PMIX_NAME_CAPS(PMI_KVS_Create)
#define PMI_KVS_Destroy PMIX_NAME_CAPS(PMI_KVS_Destroy)
#define PMI_KVS_Get PMIX_NAME_CAPS(PMI_KVS_Get)
#define PMI_KVS_Get_key_length_max PMIX_NAME_CAPS(PMI_KVS_Get_key_length_max)
#define PMI_KVS_Get_my_name PMIX_NAME_CAPS(PMI_KVS_Get_my_name)
#define PMI_KVS_Get_name_length_max PMIX_NAME_CAPS(PMI_KVS_Get_name_length_max)
#define PMI_KVS_Get_value_length_max PMIX_NAME_CAPS(PMI_KVS_Get_value_length_max)
#define PMI_KVS_Iter_first PMIX_NAME_CAPS(PMI_KVS_Iter_first)
#define PMI_KVS_Iter_next PMIX_NAME_CAPS(PMI_KVS_Iter_next)
#define PMI_KVS_Put PMIX_NAME_CAPS(PMI_KVS_Put)
#define PMI_Lookup_name PMIX_NAME_CAPS(PMI_Lookup_name)
#define PMI_Parse_option PMIX_NAME_CAPS(PMI_Parse_option)
#define PMI_Publish_name PMIX_NAME_CAPS(PMI_Publish_name)
#define PMI_Spawn_multiple PMIX_NAME_CAPS(PMI_Spawn_multiple)
#define PMI_Unpublish_name PMIX_NAME_CAPS(PMI_Unpublish_name)
#define PMIx_Abort PMIX_NAME_CAPS(Abort)
#define PMIx_Commit PMIX_NAME_CAPS(Commit)
#define PMIx_Connect PMIX_NAME_CAPS(Connect)
#define PMIx_Connect_nb PMIX_NAME_CAPS(Connect_nb)
#define PMIx_Deregister_errhandler PMIX_NAME_CAPS(Deregister_errhandler)
#define PMIx_Disconnect PMIX_NAME_CAPS(Disconnect)
#define PMIx_Disconnect_nb PMIX_NAME_CAPS(Disconnect_nb)
#define PMIx_Error_string PMIX_NAME_CAPS(Error_string)
#define PMIx_Fence PMIX_NAME_CAPS(Fence)
#define PMIx_Fence_nb PMIX_NAME_CAPS(Fence_nb)
#define PMIx_Finalize PMIX_NAME_CAPS(Finalize)
#define PMIx_Get PMIX_NAME_CAPS(Get)
#define PMIx_Get_nb PMIX_NAME_CAPS(Get_nb)
#define PMIx_Get_version PMIX_NAME_CAPS(Get_version)
#define PMIx_Init PMIX_NAME_CAPS(Init)
#define PMIx_Initialized PMIX_NAME_CAPS(Initialized)
#define PMIx_Lookup PMIX_NAME_CAPS(Lookup)
#define PMIx_Lookup_nb PMIX_NAME_CAPS(Lookup_nb)
#define PMIx_Notify_error PMIX_NAME_CAPS(Notify_error)
#define PMIx_Publish PMIX_NAME_CAPS(Publish)
#define PMIx_Publish_nb PMIX_NAME_CAPS(Publish_nb)
#define PMIx_Put PMIX_NAME_CAPS(Put)
#define PMIx_Register_errhandler PMIX_NAME_CAPS(Register_errhandler)
#define PMIx_Resolve_nodes PMIX_NAME_CAPS(Resolve_nodes)
#define PMIx_Resolve_peers PMIX_NAME_CAPS(Resolve_peers)
#define PMIx_Spawn PMIX_NAME_CAPS(Spawn)
#define PMIx_Spawn_nb PMIX_NAME_CAPS(Spawn_nb)
#define PMIx_Store_internal PMIX_NAME_CAPS(Store_internal)
#define PMIx_Unpublish PMIX_NAME_CAPS(Unpublish)
#define PMIx_Unpublish_nb PMIX_NAME_CAPS(Unpublish_nb)
#define PMIx_generate_ppn PMIX_NAME_CAPS(generate_ppn)
#define PMIx_generate_regex PMIX_NAME_CAPS(generate_regex)
#define PMIx_server_deregister_client PMIX_NAME_CAPS(server_deregister_client)
#define PMIx_server_deregister_nspace PMIX_NAME_CAPS(server_deregister_nspace)
#define PMIx_server_dmodex_request PMIX_NAME_CAPS(server_dmodex_request)
#define PMIx_server_finalize PMIX_NAME_CAPS(server_finalize)
#define PMIx_server_init PMIX_NAME_CAPS(server_init)
#define PMIx_server_register_client PMIX_NAME_CAPS(server_register_client)
#define PMIx_server_register_nspace PMIX_NAME_CAPS(server_register_nspace)
#define PMIx_server_setup_fork PMIX_NAME_CAPS(server_setup_fork)
/* internal functions */
#define pmix_argv_append PMIX_NAME(argv_append)
#define pmix_argv_append_nosize PMIX_NAME(argv_append_nosize)
#define pmix_argv_append_unique_nosize PMIX_NAME(argv_append_unique_nosize)
#define pmix_argv_copy PMIX_NAME(argv_copy)
#define pmix_argv_count PMIX_NAME(argv_count)
#define pmix_argv_delete PMIX_NAME(argv_delete)
#define pmix_argv_free PMIX_NAME(argv_free)
#define pmix_argv_insert PMIX_NAME(argv_insert)
#define pmix_argv_insert_element PMIX_NAME(argv_insert_element)
#define pmix_argv_join PMIX_NAME(argv_join)
#define pmix_argv_join_range PMIX_NAME(argv_join_range)
#define pmix_argv_len PMIX_NAME(argv_len)
#define pmix_argv_prepend_nosize PMIX_NAME(argv_prepend_nosize)
#define pmix_argv_split PMIX_NAME(argv_split)
#define pmix_argv_split_with_empty PMIX_NAME(argv_split_with_empty)
#define pmix_asprintf PMIX_NAME(asprintf)
#define pmix_basename PMIX_NAME(basename)
#define pmix_bcopy_csum_partial PMIX_NAME(bcopy_csum_partial)
#define pmix_bcopy_uicrc_partial PMIX_NAME(bcopy_uicrc_partial)
#define pmix_bcopy_uicsum_partial PMIX_NAME(bcopy_uicsum_partial)
#define pmix_bfrop PMIX_NAME(bfrop)
#define pmix_bfrop_buffer_extend PMIX_NAME(bfrop_buffer_extend)
#define pmix_bfrop_close PMIX_NAME(bfrop_close)
#define pmix_bfrop_copy PMIX_NAME(bfrop_copy)
#define pmix_bfrop_copy_app PMIX_NAME(bfrop_copy_app)
#define pmix_bfrop_copy_array PMIX_NAME(bfrop_copy_array)
#define pmix_bfrop_copy_bo PMIX_NAME(bfrop_copy_bo)
#define pmix_bfrop_copy_buf PMIX_NAME(bfrop_copy_buf)
#define pmix_bfrop_copy_info PMIX_NAME(bfrop_copy_info)
#define pmix_bfrop_copy_kval PMIX_NAME(bfrop_copy_kval)
#define pmix_bfrop_copy_modex PMIX_NAME(bfrop_copy_modex)
#define pmix_bfrop_copy_payload PMIX_NAME(bfrop_copy_payload)
#define pmix_bfrop_copy_pdata PMIX_NAME(bfrop_copy_pdata)
#define pmix_bfrop_copy_persist PMIX_NAME(bfrop_copy_persist)
#define pmix_bfrop_copy_proc PMIX_NAME(bfrop_copy_proc)
#define pmix_bfrop_copy_string PMIX_NAME(bfrop_copy_string)
#define pmix_bfrop_copy_topo PMIX_NAME(bfrop_copy_topo)
#define pmix_bfrop_copy_value PMIX_NAME(bfrop_copy_value)
#define pmix_bfrop_get_data_type PMIX_NAME(bfrop_get_data_type)
#define pmix_bfrop_initial_size PMIX_NAME(pmix_bfrop_initial_size)
#define pmix_bfrop_initialized PMIX_NAME(bfrop_initialized)
#define pmix_bfrop_num_reg_types PMIX_NAME(pmix_bfrop_num_reg_types)
#define pmix_bfrop_open PMIX_NAME(bfrop_open)
#define pmix_bfrop_pack PMIX_NAME(bfrop_pack)
#define pmix_bfrop_pack_app PMIX_NAME(bfrop_pack_app)
#define pmix_bfrop_pack_array PMIX_NAME(bfrop_pack_array)
#define pmix_bfrop_pack_bo PMIX_NAME(bfrop_pack_bo)
#define pmix_bfrop_pack_bool PMIX_NAME(bfrop_pack_bool)
#define pmix_bfrop_pack_buf PMIX_NAME(bfrop_pack_buf)
#define pmix_bfrop_pack_buffer PMIX_NAME(bfrop_pack_buffer)
#define pmix_bfrop_pack_byte PMIX_NAME(bfrop_pack_byte)
#define pmix_bfrop_pack_datatype PMIX_NAME(bfrop_pack_datatype)
#define pmix_bfrop_pack_double PMIX_NAME(bfrop_pack_double)
#define pmix_bfrop_pack_float PMIX_NAME(bfrop_pack_float)
#define pmix_bfrop_pack_info PMIX_NAME(bfrop_pack_info)
#define pmix_bfrop_pack_int PMIX_NAME(bfrop_pack_int)
#define pmix_bfrop_pack_int16 PMIX_NAME(bfrop_pack_int16)
#define pmix_bfrop_pack_int32 PMIX_NAME(bfrop_pack_int32)
#define pmix_bfrop_pack_int64 PMIX_NAME(bfrop_pack_int64)
#define pmix_bfrop_pack_kval PMIX_NAME(bfrop_pack_kval)
#define pmix_bfrop_pack_modex PMIX_NAME(bfrop_pack_modex)
#define pmix_bfrop_pack_pdata PMIX_NAME(bfrop_pack_pdata)
#define pmix_bfrop_pack_persist PMIX_NAME(bfrop_pack_persist)
#define pmix_bfrop_pack_pid PMIX_NAME(bfrop_pack_pid)
#define pmix_bfrop_pack_proc PMIX_NAME(bfrop_pack_proc)
#define pmix_bfrop_pack_sizet PMIX_NAME(bfrop_pack_sizet)
#define pmix_bfrop_pack_string PMIX_NAME(bfrop_pack_string)
#define pmix_bfrop_pack_time PMIX_NAME(bfrop_pack_time)
#define pmix_bfrop_pack_timeval PMIX_NAME(bfrop_pack_timeval)
#define pmix_bfrop_pack_topo PMIX_NAME(bfrop_pack_topo)
#define pmix_bfrop_pack_value PMIX_NAME(bfrop_pack_value)
#define pmix_bfrop_print PMIX_NAME(bfrop_print)
#define pmix_bfrop_print_app PMIX_NAME(bfrop_print_app)
#define pmix_bfrop_print_array PMIX_NAME(bfrop_print_array)
#define pmix_bfrop_print_bo PMIX_NAME(bfrop_print_bo)
#define pmix_bfrop_print_bool PMIX_NAME(bfrop_print_bool)
#define pmix_bfrop_print_buf PMIX_NAME(bfrop_print_buf)
#define pmix_bfrop_print_byte PMIX_NAME(bfrop_print_byte)
#define pmix_bfrop_print_double PMIX_NAME(bfrop_print_double)
#define pmix_bfrop_print_float PMIX_NAME(bfrop_print_float)
#define pmix_bfrop_print_info PMIX_NAME(bfrop_print_info)
#define pmix_bfrop_print_int PMIX_NAME(bfrop_print_int)
#define pmix_bfrop_print_int16 PMIX_NAME(bfrop_print_int16)
#define pmix_bfrop_print_int32 PMIX_NAME(bfrop_print_int32)
#define pmix_bfrop_print_int64 PMIX_NAME(bfrop_print_int64)
#define pmix_bfrop_print_int8 PMIX_NAME(bfrop_print_int8)
#define pmix_bfrop_print_kval PMIX_NAME(bfrop_print_kval)
#define pmix_bfrop_print_modex PMIX_NAME(bfrop_print_modex)
#define pmix_bfrop_print_pdata PMIX_NAME(bfrop_print_pdata)
#define pmix_bfrop_print_persist PMIX_NAME(bfrop_print_persist)
#define pmix_bfrop_print_pid PMIX_NAME(bfrop_print_pid)
#define pmix_bfrop_print_proc PMIX_NAME(bfrop_print_proc)
#define pmix_bfrop_print_size PMIX_NAME(bfrop_print_size)
#define pmix_bfrop_print_string PMIX_NAME(bfrop_print_string)
#define pmix_bfrop_print_time PMIX_NAME(bfrop_print_time)
#define pmix_bfrop_print_timeval PMIX_NAME(bfrop_print_timeval)
#define pmix_bfrop_print_topo PMIX_NAME(bfrop_print_topo)
#define pmix_bfrop_print_uint PMIX_NAME(bfrop_print_uint)
#define pmix_bfrop_print_uint16 PMIX_NAME(bfrop_print_uint16)
#define pmix_bfrop_print_uint32 PMIX_NAME(bfrop_print_uint32)
#define pmix_bfrop_print_uint64 PMIX_NAME(bfrop_print_uint64)
#define pmix_bfrop_print_uint8 PMIX_NAME(bfrop_print_uint8)
#define pmix_bfrop_print_value PMIX_NAME(bfrop_print_value)
#define pmix_bfrop_std_copy PMIX_NAME(bfrop_std_copy)
#define pmix_bfrop_store_data_type PMIX_NAME(bfrop_store_data_type)
#define pmix_bfrop_threshold_size PMIX_NAME(pmix_bfrop_threshold_size)
#define pmix_bfrop_too_small PMIX_NAME(bfrop_too_small)
#define pmix_bfrop_types PMIX_NAME(bfrop_types)
#define pmix_bfrop_type_info_t_class PMIX_NAME(bfrop_type_info_t_class)
#define pmix_bfrop_unpack PMIX_NAME(bfrop_unpack)
#define pmix_bfrop_unpack_app PMIX_NAME(bfrop_unpack_app)
#define pmix_bfrop_unpack_array PMIX_NAME(bfrop_unpack_array)
#define pmix_bfrop_unpack_bo PMIX_NAME(bfrop_unpack_bo)
#define pmix_bfrop_unpack_bool PMIX_NAME(bfrop_unpack_bool)
#define pmix_bfrop_unpack_buf PMIX_NAME(bfrop_unpack_buf)
#define pmix_bfrop_unpack_buffer PMIX_NAME(bfrop_unpack_buffer)
#define pmix_bfrop_unpack_byte PMIX_NAME(bfrop_unpack_byte)
#define pmix_bfrop_unpack_datatype PMIX_NAME(bfrop_unpack_datatype)
#define pmix_bfrop_unpack_double PMIX_NAME(bfrop_unpack_double)
#define pmix_bfrop_unpack_float PMIX_NAME(bfrop_unpack_float)
#define pmix_bfrop_unpack_info PMIX_NAME(bfrop_unpack_info)
#define pmix_bfrop_unpack_int PMIX_NAME(bfrop_unpack_int)
#define pmix_bfrop_unpack_int16 PMIX_NAME(bfrop_unpack_int16)
#define pmix_bfrop_unpack_int32 PMIX_NAME(bfrop_unpack_int32)
#define pmix_bfrop_unpack_int64 PMIX_NAME(bfrop_unpack_int64)
#define pmix_bfrop_unpack_kval PMIX_NAME(bfrop_unpack_kval)
#define pmix_bfrop_unpack_modex PMIX_NAME(bfrop_unpack_modex)
#define pmix_bfrop_unpack_pdata PMIX_NAME(bfrop_unpack_pdata)
#define pmix_bfrop_unpack_persist PMIX_NAME(bfrop_unpack_persist)
#define pmix_bfrop_unpack_pid PMIX_NAME(bfrop_unpack_pid)
#define pmix_bfrop_unpack_proc PMIX_NAME(bfrop_unpack_proc)
#define pmix_bfrop_unpack_sizet PMIX_NAME(bfrop_unpack_sizet)
#define pmix_bfrop_unpack_string PMIX_NAME(bfrop_unpack_string)
#define pmix_bfrop_unpack_time PMIX_NAME(bfrop_unpack_time)
#define pmix_bfrop_unpack_timeval PMIX_NAME(bfrop_unpack_timeval)
#define pmix_bfrop_unpack_topo PMIX_NAME(bfrop_unpack_topo)
#define pmix_bfrop_unpack_value PMIX_NAME(bfrop_unpack_value)
#define pmix_buffer_t_class PMIX_NAME(buffer_t_class)
#define pmix_cb_t_class PMIX_NAME(cb_t_class)
#define pmix_class_finalize PMIX_NAME(class_finalize)
#define pmix_class_initialize PMIX_NAME(class_initialize)
#define pmix_client_globals PMIX_NAME(pmix_client_globals)
#define pmix_client_process_nspace_blob PMIX_NAME(client_process_nspace_blob)
#define pmix_csum_partial PMIX_NAME(csum_partial)
#define pmix_dirname PMIX_NAME(dirname)
#define pmix_dmdx_local_t_class PMIX_NAME(dmdx_local_t_class)
#define pmix_dmdx_remote_t_class PMIX_NAME(dmdx_remote_t_class)
#define pmix_dmdx_reply_caddy_t_class PMIX_NAME(dmdx_reply_caddy_t_class)
#define pmix_dmdx_request_t_class PMIX_NAME(dmdx_request_t_class)
#define pmix_environ_merge PMIX_NAME(environ_merge)
#define pmix_errhandler_invoke PMIX_NAME(errhandler_invoke)
#define pmix_fd_read PMIX_NAME(fd_read)
#define pmix_fd_set_cloexec PMIX_NAME(fd_set_cloexec)
#define pmix_fd_write PMIX_NAME(fd_write)
#define pmix_globals PMIX_NAME(globals)
#define pmix_globals_finalize PMIX_NAME(globals_finalize)
#define pmix_globals_init PMIX_NAME(globals_init)
#define pmix_hash_fetch PMIX_NAME(hash_fetch)
#define pmix_hash_remove_data PMIX_NAME(hash_remove_data)
#define pmix_hash_store PMIX_NAME(hash_store)
#define pmix_hash_table_get_first_key_uint32 PMIX_NAME(hash_table_get_first_key_uint32)
#define pmix_hash_table_get_first_key_uint64 PMIX_NAME(hash_table_get_first_key_uint64)
#define pmix_hash_table_get_next_key_uint32 PMIX_NAME(hash_table_get_next_key_uint32)
#define pmix_hash_table_get_next_key_uint64 PMIX_NAME(hash_table_get_next_key_uint64)
#define pmix_hash_table_get_value_ptr PMIX_NAME(hash_table_get_value_ptr)
#define pmix_hash_table_get_value_uint32 PMIX_NAME(hash_table_get_value_uint32)
#define pmix_hash_table_get_value_uint64 PMIX_NAME(hash_table_get_value_uint64)
#define pmix_hash_table_init PMIX_NAME(hash_table_init)
#define pmix_hash_table_remove_all PMIX_NAME(hash_table_remove_all)
#define pmix_hash_table_remove_value_ptr PMIX_NAME(hash_table_remove_value_ptr)
#define pmix_hash_table_remove_value_uint32 PMIX_NAME(hash_table_remove_value_uint32)
#define pmix_hash_table_remove_value_uint64 PMIX_NAME(hash_table_remove_value_uint64)
#define pmix_hash_table_set_value_ptr PMIX_NAME(hash_table_set_value_ptr)
#define pmix_hash_table_set_value_uint32 PMIX_NAME(hash_table_set_value_uint32)
#define pmix_hash_table_set_value_uint64 PMIX_NAME(hash_table_set_value_uint64)
#define pmix_hash_table_t_class PMIX_NAME(hash_table_t_class)
#define pmix_home_directory PMIX_NAME(home_directory)
#define pmix_host_server PMIX_NAME(pmix_host_server)
#define pmix_initialize_crc_table PMIX_NAME(initialize_crc_table)
#define pmix_kval_t_class PMIX_NAME(kval_t_class)
#define pmix_list_insert PMIX_NAME(list_insert)
#define pmix_list_item_t_class PMIX_NAME(list_item_t_class)
#define pmix_list_join PMIX_NAME(list_join)
#define pmix_list_sort PMIX_NAME(list_sort)
#define pmix_list_splice PMIX_NAME(list_splice)
#define pmix_list_t_class PMIX_NAME(list_t_class)
#define pmix_munge_module PMIX_NAME(munge_module)
#define pmix_native_module PMIX_NAME(native_module)
#define pmix_notify_caddy_t_class PMIX_NAME(notify_caddy_t_class)
#define pmix_nrec_t_class PMIX_NAME(nrec_t_class)
#define pmix_nspace_t_class PMIX_NAME(nspace_t_class)
#define pmix_object_t_class PMIX_NAME(object_t_class)
#define pmix_os_path PMIX_NAME(os_path)
#define pmix_output PMIX_NAME(output)
#define pmix_output_close PMIX_NAME(output_close)
#define pmix_output_finalize PMIX_NAME(output_finalize)
#define pmix_output_get_verbosity PMIX_NAME(output_get_verbosity)
#define pmix_output_init PMIX_NAME(output_init)
#define pmix_output_open PMIX_NAME(output_open)
#define pmix_output_redirected_syslog_pri PMIX_NAME(pmix_output_redirected_syslog_pri)
#define pmix_output_redirected_to_syslog PMIX_NAME(output_redirected_to_syslog)
#define pmix_output_reopen PMIX_NAME(output_reopen)
#define pmix_output_reopen_all PMIX_NAME(output_reopen_all)
#define pmix_output_set_output_file_info PMIX_NAME(output_set_output_file_info)
#define pmix_output_set_verbosity PMIX_NAME(output_set_verbosity)
#define pmix_output_stream_t_class PMIX_NAME(output_stream_t_class)
#define pmix_output_string PMIX_NAME(output_string)
#define pmix_output_switch PMIX_NAME(output_switch)
#define pmix_output_verbose PMIX_NAME(output_verbose)
#define pmix_output_vstring PMIX_NAME(output_vstring)
#define pmix_output_vverbose PMIX_NAME(output_vverbose)
#define pmix_pack_proc_map PMIX_NAME(pack_proc_map)
#define pmix_peer_t_class PMIX_NAME(peer_t_class)
#define pmix_pending_connection_t_class PMIX_NAME(pending_connection_t_class)
#define pmix_pending_nspace_requests PMIX_NAME(pending_nspace_requests)
#define pmix_pending_resolve PMIX_NAME(pending_resolve)
#define pmix_pointer_array_add PMIX_NAME(pointer_array_add)
#define pmix_pointer_array_init PMIX_NAME(pointer_array_init)
#define pmix_pointer_array_set_item PMIX_NAME(pointer_array_set_item)
#define pmix_pointer_array_set_size PMIX_NAME(pointer_array_set_size)
#define pmix_pointer_array_t_class PMIX_NAME(pointer_array_t_class)
#define pmix_pointer_array_test_and_set_item PMIX_NAME(pointer_array_test_and_set_item)
#define pmix_rank_info_t_class PMIX_NAME(rank_info_t_class)
#define pmix_regex_parse_nodes PMIX_NAME(regex_parse_nodes)
#define pmix_regex_parse_procs PMIX_NAME(regex_parse_procs)
#define pmix_regex_range_t_class PMIX_NAME(regex_range_t_class)
#define pmix_regex_value_t_class PMIX_NAME(regex_value_t_class)
#define pmix_sec PMIX_NAME(pmix_sec)
#define pmix_sec_finalize PMIX_NAME(sec_finalize)
#define pmix_sec_init PMIX_NAME(sec_init)
#define pmix_server_abort PMIX_NAME(server_abort)
#define pmix_server_caddy_t_class PMIX_NAME(server_caddy_t_class)
#define pmix_server_commit PMIX_NAME(server_commit)
#define pmix_server_connect PMIX_NAME(server_connect)
#define pmix_server_deregister_errhandler PMIX_NAME(server_deregister_errhandler)
#define pmix_server_fence PMIX_NAME(server_fence)
#define pmix_server_get PMIX_NAME(server_get)
#define pmix_server_globals PMIX_NAME(pmix_server_globals)
#define pmix_server_lookup PMIX_NAME(server_lookup)
#define pmix_server_notify_error PMIX_NAME(server_notify_error)
#define pmix_server_nspace_t_class PMIX_NAME(server_nspace_t_class)
#define pmix_server_publish PMIX_NAME(server_publish)
#define pmix_server_register_errhandler PMIX_NAME(server_register_errhandler)
#define pmix_server_spawn PMIX_NAME(server_spawn)
#define pmix_server_trkr_t_class PMIX_NAME(server_trkr_t_class)
#define pmix_server_unpublish PMIX_NAME(server_unpublish)
#define pmix_setenv PMIX_NAME(setenv)
#define pmix_setup_caddy_t_class PMIX_NAME(setup_caddy_t_class)
#define pmix_shift_caddy_t_class PMIX_NAME(shift_caddy_t_class)
#define pmix_snd_caddy_t_class PMIX_NAME(snd_caddy_t_class)
#define pmix_snprintf PMIX_NAME(snprintf)
#define pmix_start_listening PMIX_NAME(start_listening)
#define pmix_start_progress_thread PMIX_NAME(start_progress_thread)
#define pmix_stop_listening PMIX_NAME(stop_listening)
#define pmix_stop_progress_thread PMIX_NAME(stop_progress_thread)
#define pmix_timer_t_class PMIX_NAME(timer_t_class)
#define pmix_tmp_directory PMIX_NAME(tmp_directory)
#define pmix_trkr_caddy_t_class PMIX_NAME(trkr_caddy_t_class)
#define pmix_uicrc_partial PMIX_NAME(uicrc_partial)
#define pmix_uicsum_partial PMIX_NAME(uicsum_partial)
#define pmix_unsetenv PMIX_NAME(unsetenv)
#define pmix_usock_finalize PMIX_NAME(usock_finalize)
#define pmix_usock_globals PMIX_NAME(pmix_usock_globals)
#define pmix_usock_init PMIX_NAME(usock_init)
#define pmix_usock_posted_recv_t_class PMIX_NAME(usock_posted_recv_t_class)
#define pmix_usock_process_msg PMIX_NAME(usock_process_msg)
#define pmix_usock_queue_t_class PMIX_NAME(usock_queue_t_class)
#define pmix_usock_recv_blocking PMIX_NAME(usock_recv_blocking)
#define pmix_usock_recv_handler PMIX_NAME(usock_recv_handler)
#define pmix_usock_recv_t_class PMIX_NAME(usock_recv_t_class)
#define pmix_usock_send_blocking PMIX_NAME(usock_send_blocking)
#define pmix_usock_send_handler PMIX_NAME(usock_send_handler)
#define pmix_usock_send_recv PMIX_NAME(usock_send_recv)
#define pmix_usock_send_t_class PMIX_NAME(usock_send_t_class)
#define pmix_usock_set_blocking PMIX_NAME(usock_set_blocking)
#define pmix_usock_set_nonblocking PMIX_NAME(usock_set_nonblocking)
#define pmix_usock_sr_t_class PMIX_NAME(usock_sr_t_class)
#define pmix_value_load PMIX_NAME(value_load)
#define pmix_value_unload PMIX_NAME(value_unload)
#define pmix_value_xfer PMIX_NAME(value_xfer)
#define pmix_vasprintf PMIX_NAME(vasprintf)
#define pmix_vsnprintf PMIX_NAME(vsnprintf)
#endif /* PMIX_SYM_TRANSFORM */
END_C_DECLS
#endif /* PMIX_RENAME_H */

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

@ -51,9 +51,6 @@
#ifndef PMIx_COMMON_H
#define PMIx_COMMON_H
#include <pmix/autogen/config.h>
#include <pmix/rename.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
@ -68,7 +65,9 @@
#include <sys/types.h> /* for uid_t and gid_t */
#endif
BEGIN_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**** PMIX CONSTANTS ****/
@ -127,6 +126,7 @@ typedef uint32_t pmix_rank_t;
/* identification attributes */
#define PMIX_USERID "pmix.euid" // (uint32_t) effective user id
#define PMIX_GRPID "pmix.egid" // (uint32_t) effective group id
#define PMIX_DSTPATH "pmix.dstpath" // (char*) path to dstore files
/* attributes for the rendezvous socket */
#define PMIX_SOCKET_MODE "pmix.sockmode" // (uint32_t) POSIX mode_t (9 bits valid)
@ -1336,5 +1336,8 @@ pmix_status_t PMIx_Store_internal(const pmix_proc_t *proc,
#define PMIX_VAL_FREE(_v) \
PMIx_free_value_data(_v)
END_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

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

@ -59,15 +59,12 @@
#ifndef PMIx_SERVER_API_H
#define PMIx_SERVER_API_H
#include <pmix/autogen/config.h>
/* Symbol transforms */
#include <pmix/rename.h>
/* Structure and constant definitions */
#include <pmix/pmix_common.h>
#include <pmix_common.h>
BEGIN_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**** SERVER FUNCTION-SHIPPED APIs ****/
/* NOTE: for performance purposes, the host server is required to
@ -81,7 +78,6 @@ BEGIN_C_DECLS
* by the host server via callback function is owned by the host
* server, which is free to release it upon return from the callback */
/* Notify the host server that a client connected to us - note
* that the client will be in a blocked state until the host server
* executes the callback function, thus allowing the PMIx server support
@ -487,6 +483,8 @@ pmix_status_t PMIx_server_dmodex_request(const pmix_proc_t *proc,
pmix_dmodex_response_fn_t cbfunc,
void *cbdata);
END_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

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

@ -59,18 +59,12 @@
#ifndef PMIx_TOOL_API_H
#define PMIx_TOOL_API_H
#include <pmix/autogen/config.h>
/* Symbol transforms */
#include <pmix/rename.h>
/* Structure and constant definitions */
#include <pmix/pmix_common.h>
/* provide access to the rest of the client functions */
#include <pmix.h>
BEGIN_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**** TOOL INIT/FINALIZE FUNCTIONS ****/
@ -104,6 +98,8 @@ pmix_status_t PMIx_tool_init(pmix_proc_t *proc,
* operation. */
pmix_status_t PMIx_tool_finalize(void);
END_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

60
opal/mca/pmix/pmix2x/pmix/man/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,60 @@
#
# 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-2009 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) 2006-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
if !PMIX_EMBEDDED_MODE
man_MANS = \
man3/pmix_init.3 \
man3/pmix_finalize.3 \
man3/pmix_initialized.3 \
man3/pmix_abort.3 \
man3/pmix_put.3 \
man3/pmix_commit.3 \
man7/pmix.7 \
man7/pmix_constants.7
EXTRA_DIST = $(man_MANS)
man3/pmix_init.3:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix_init.3.md;
man3/pmix_finalize.3:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix_finalize.3.md;
man3/pmix_initialized.3:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix_initialized.3.md;
man3/pmix_abort.3:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix_abort.3.md;
man3/pmix_put.3:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix_put.3.md;
man3/pmix_commit.3:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix_commit.3.md;
man7/pmix.7:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix.7.md;
man7/pmix_constants.7:
$(top_srcdir)/contrib/md2nroff.pl --source=pmix_constants.7.md;
endif # !PMIX_EMBEDDED_MODE

186
opal/mca/pmix/pmix2x/pmix/man/README Обычный файл
Просмотреть файл

@ -0,0 +1,186 @@
This file describes how the developer side of man pages work in PMIx.
The Definitive Source Of Truth man pages are the Markdown man pages in
this directory (i.e., the files ending in .<digit>.md. If you want to
edit man pages, you need to edit the .<digit>.md pages. Do NOT edit
the .<digit> nroff man pages directly; these files are automatically
generated -- you will lose any manual edits the next time those files
are generated.
The Markdown web pages are rendered in two different ways:
1. Nroff man pages. These man pages are put into the `master` branch
and later included in PMIx distribution tarballs.
2. HTML. The http://open-mpi.github.io/pmix/ web site (which is
served by the Github web servers) automatically renders the content
of the `gh-pages` branch of the PMIx repo.
Markdown syntax
===============
The definitive man pages are the Markdown man pages. To edit them,
you need to understand the syntax used in these files.
The canonical reference for Markdown is here:
http://daringfireball.net/projects/markdown/syntax
Note, however, that the PMIx Markdown man pages are served via
the Github Pages web servers, which use a system called Jekyll to
render the Markdown into HTML (https://github.com/jekyll/jekyll).
As such, there are a few Jekyll annotations in the PMIx Markdown
pages (so that they can be served up properly from Github's web
servers).
If you're familiar with Markdown, you should be ok. But there are a
small number differences and quirks with which you should be familiar:
1. The first few lines of each file are a YAML header and include
directive for Jekyll. DO NOT REMOVE THIS HEADER (or the file will
not render to HTML properly when served up from Github's web
servers). Here's a sample YAML header from pmix.7.md:
---
layout: page
title: PMIx(7)
tagline: PMIx Programmer's Manual
---
{% include JB/setup %}
The whole block is needed, and it must be the first input in the
file.
2. In Github-flavored Markdown, you may be used to using "fenced
blocks" for multi-line code blocks, like this:
```c
void my_c_code(void) {
int i;
/* Hello, world */
}
```
Such fenced blocks will not work in Jekyll. Instead, you must
delineate your code blocks with Jekyll delimiters:
{% highlight c %}
void my_c_code(void) {
int i;
/* Hello, world */
}
{% endhighlight %}
This will result in a pretty code box in the rendered HTML output,
and it will be syntax highlighted for the C language. Leave the
"c" out of the first directive if your multi-line block is not C
code, and then it won't do C syntax highlighting.
3. The PMIx man pages are full of 2-level lists of things. E.g.,
lists of functions, and then in some of the functions, there is a
sub-list of flags that can be used with that function.
The convention used in the PMIx man pages is to highlight a
word/phrase representing each list item. Then use a ":" to start
the next line that describes that item. For example:
*PMIX_FLOAT*
: A single-precision floating point value (IEEE 754).
This will make the token "PMIX_FLOAT" be highlighted in both
HTML and nroff output, and then the paragraph that comes after it
will be properly delimited and indented.
To make a sub-list inside an item, use the same format, but prefix
the sub-list items with "-", like this:
*scope*
: Flag that controls the visible scope of the data.
- *PMIX_GLOBAL*
: Indicates that the data is to be visible to all applications executed
by this user.
4. There may be a small number of places in the PMIx man pages where
there are unnumbered lists with deliberate line breaks. For
example:
foo / bar
baz / goo
: Something really intelligent
Note the first line is "foo / bar", and then there is
a deliberate line break, and then the second line is "baz / goo".
To effect the deliberate line break, you have to put two blank
spaces after "bar". To show that graphically (showing "_"
for " "):
foo / bar__
baz / goo
: Something really intelligent
5. The "SEE ALSO" items at the end of each man page are linked to
their corresponding man pages. Note that the links are made to
".html" files -- *not* ".md" files. If you care, the reason is
because the Github web servers statically generate .html files from
the .md files when you git push to the gh-pages branch. Hence, the
man pages are actually served from static .html files on the Github
web servers.
Also, since links are meaningless in nroff, they are effectively
ignored in the resulting nroff output.
Workflow
========
The workflow is like this:
1. Developer edits .<digit>.md files for new changes.
2. In a perfect world, the developer makes perfect edits and pushes
the changes up to `master`. An automated cron job will eventually
notice the new pages, and do two things:
2a. Copy the modified Markdown pages to the `gh-master` branch (so
that they go live on the web site).
2b. Re-generate any relevant nroff man pages in `master`.
The automated cron job actually does exist and does these things,
but it should only be relied upon once a developer is sure that
their changes to the Markdown man pages are correct.
3. To check that the changes will render properly, developers should
do two things:
3a. Run "make nroff". This will convert all the Markdown man pages
into nroff man pages (in the man/ directory). Check to ensure
that your changes look appropriate in the rendered nroff
output.
*CAUTION* The "pandoc" utility is used to generate the nroff
files from the Markdown source. Different versions of pandoc
will generate slightly different nroff output. Meaning: when
you run "make nroff", you might end up changing every nroff man
page, simply because your version of pandoc is different than
the last person who ran it. Please only check in your changes,
if possible.
3b. Check out the `gh-pages` branch from PMIx and copy any
modified Markdown pages into the "master/man" directory (i.e.,
the directory for man pages from the master development
branch).
Then run the "jekyll serve" command from the top-level
directory in `gh-pages`. This runs a local web server on your
computer and renders the Markdown files into HTML such that you
can point a browser to http://127.0.0.1:4000 and see the web
site.
If you make any changes to files in the tree where "jekyll" is
running, Jekyll will notice the changes and automatically
re-generate the relevant HTML. Meaning: you can just refresh
the page from http://127.0.0.1:4000 in your browser and you'll
see your changes -- there's no need to restart Jekyll to force
it to notice new changes.

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

@ -1,95 +0,0 @@
.TH "pmix_fence" "3" "2016\-03\-01" "PMIx Programmer\[aq]s Manual" "\@VERSION\@"
.SH NAME
.PP
PMIx_Fence[_nb] \- Execute a blocking[non\-blocking] barrier across the
processes identified in the specified array.
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <pmix.h>
pmix\\_status\\_t\ PMIx\\_Fence(const\ pmix\\_proc\\_t\ procs[],\ size_t\ nprocs,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const\ pmix\\_info\\_t\ info[],\ size_t\ ninfo);
pmix\\_status\\_t\ PMIx\\_Fence\\_nb(const\ pmix\\_proc\\_t\ procs[],\ size_t\ nprocs,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const\ pmix\\_info\\_t\ info[],\ size_t\ ninfo,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pmix_op_cbfunc_t\ cbfunc,\ void\ *cbdata);
\f[]
.fi
.SH ARGUMENTS
.PP
\f[I]procs\f[] : An array of pmix_proc_t structures defining the
processes that will be participating in the fence collective operation.
.PP
\f[I]nprocs\f[] : Number of pmix_proc_t structures in the \f[I]procs\f[]
array
.PP
\f[I]info\f[] : An optional array of pmix_info_t structures
.PP
\f[I]ninfo\f[] : Number of pmix_info_t structures in the pmix_info_t
array
.SH DESCRIPTION
.PP
Execute a blocking[non\-blocking] barrier across the processes
identified in the specified array.
Passing a \f[I]NULL\f[] pointer as the \f[I]procs\f[] parameter
indicates that the barrier is to span all processes in the client\[aq]s
namespace.
Each provided pmix_proc_t struct can pass PMIX_RANK_WILDCARD to indicate
that all processes in the given namespace are participating.
.PP
The info array is used to pass user requests regarding the fence
operation.
This can include:
.IP "(a)" 4
PMIX_COLLECT_DATA \- a boolean indicating whether or not the barrier
operation is to return the \f[I]put\f[] data from all participating
processes.
A value of \f[I]false\f[] indicates that the callback is just used as a
release and no data is to be returned at that time.
A value of \f[I]true\f[] indicates that all \f[I]put\f[] data is to be
collected by the barrier.
Returned data is cached at the server to reduce memory footprint, and
can be retrieved as needed by calls to PMIx_Get(nb).
.RS 4
.PP
Note that for scalability reasons, the default behavior for PMIx_Fence
is to \f[I]not\f[] collect the data.
.RE
.IP "(b)" 4
PMIX_COLLECTIVE_ALGO \- a comma\-delimited string indicating the algos
to be used for executing the barrier, in priority order.
Note that PMIx itself does not contain any internode communication
support.
Thus, execution of the \f[I]fence\f[] collective is deferred to the host
resource manager, which are free to implement whatever algorithms they
choose.
Thus, different resource managers may or may not be able to comply with
a request for a specific algorithm, or set of algorithms.
Marking this info key as \f[I]required\f[] instructs the host RM that it
should return an error if none of the specified algos are available.
Otherwise, the RM is to use one of the specified algos if possible, but
is free to use any of its available methods to execute the operation if
none of the specified algos are available.
.IP "(c)" 4
PMIX_TIMEOUT \- maximum time for the fence to execute before declaring
an error.
By default, the RM shall terminate the operation and notify participants
if one or more of the indicated procs fails during the fence.
However, the timeout parameter can help avoid "hangs" due to programming
errors that prevent one or more procs from reaching the "fence".
.SH RETURN VALUE
.PP
Returns PMIX_SUCCESS on success.
On error, a negative value corresponding to a PMIx errno is returned.
.SH ERRORS
.PP
PMIx errno values are defined in \f[C]pmix_common.h\f[].
.SH NOTES
.SH SEE ALSO
.PP
\f[C]PMIx_Put\f[](3), \f[C]PMIx_Commit\f[](3),
\f[C]PMIx_Constants\f[](7)
.SH AUTHORS
PMIx.

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

@ -1,87 +0,0 @@
.TH "pmix_get" "3" "2016\-03\-01" "PMIx Programmer\[aq]s Manual" "\@VERSION\@"
.SH NAME
.PP
PMIx_Get[_nb] \- Retrieve data that was pushed into the PMIx key\-value
store via calls to \f[I]PMIx_Put\f[] and \f[I]PMIx_Commit\f[].
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <pmix.h>
pmix\\_status\\_t\ PMIx\\_Get(const\ pmix\\_proc\\_t\ *proc,\ const\ char\ key[],
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const\ pmix\\_info\\_t\ info[],\ size_t\ ninfo,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pmix\\_value\\_t\ **val);
pmix\\_status\\_t\ PMIx_Get_nb(const\ pmix\\_proc\\_t\ *proc,\ const\ char\ key[],
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const\ pmix\\_info\\_t\ info[],\ size_t\ ninfo,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pmix\\_value\\_cbfunc_t\ cbfunc,\ void\ *cbdata);
\f[]
.fi
.SH ARGUMENTS
.PP
\f[I]proc\f[] : A pointer to a pmix_proc_t structure identifying the
namespace and rank of the proc whose data is being requested.
Note that a \f[I]NULL\f[] value is permitted if the specified
\f[I]key\f[] is unique within the PMIx key\-value store.
This is provided for use by the backward compatibility APIs and is
\f[I]not\f[] recommended for use by native PMIx applications.
.PP
\f[I]key\f[] : String key identifying the information.
This can be either one of the PMIx defined attributes, or a
user\-defined value
.PP
\f[I]info\f[] : An optional array of pmix_info_t structures
.PP
\f[I]ninfo\f[] : The number of pmix_info_t structures in the specified
\f[I]info\f[] array.
.PP
\f[I]val\f[] : Address where the pointer to a pmix_value_t structure
containing the data to be returned can be placed.
Note that the caller is responsible for releasing the malloc\[aq]d
storage.
The \f[I]PMIX_VALUE_FREE\f[] macro is provided for this purpose.
.SH DESCRIPTION
.PP
Retrieve information for the specified \f[I]key\f[] as published by the
process identified in the given pmix_proc_t, returning a pointer to the
value in the given address.
.PP
The blocking form of this function will block until the specified data
has been pushed into the PMIx key\-value store via a call to
\f[I]PMIx_Commit\f[] by the specified process.
The caller is responsible for freeing all memory associated with the
returned value when no longer required.
.PP
The non\-blocking form will execute the callback function once the
specified data becomes available and has been retrieved by the local
server.
Note that failure of the specified process to \f[I]put\f[] and
\f[I]commit\f[] the requested data can result in the callback function
never being executed.
.PP
The info array is used to pass user requests regarding the get
operation.
This can include:
.IP "(a)" 4
PMIX_TIMEOUT \- maximum time for the get to execute before declaring an
error.
The timeout parameter can help avoid "hangs" due to programming errors
that prevent the target proc from ever exposing its data.
.SH RETURN VALUE
.PP
Returns PMIX_SUCCESS on success.
On error, a negative value corresponding to a PMIx errno is returned.
.SH ERRORS
.PP
PMIx errno values are defined in \f[C]pmix_common.h\f[].
.SH NOTES
.PP
See \[aq]_pmix_common.h\[aq] for definition of the pmix_value_t
structure.
.SH SEE ALSO
.PP
\f[C]PMIx_Put\f[](3), \f[C]PMIx_Commit\f[](3),
\f[C]PMIx_Constants\f[](7), \f[C]PMIx_Structures\f[](7)
.SH AUTHORS
PMIx.

81
opal/mca/pmix/pmix2x/pmix/src/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,81 @@
#
# 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-2009 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) 2006-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Note that the -I directory must *exactly* match what was specified
# via AC_CONFIG_MACRO_DIR in configure.ac.
ACLOCAL_AMFLAGS = -I ./config
SUBDIRS = \
util/keyval \
mca/base \
$(MCA_pmix_FRAMEWORKS_SUBDIRS) \
$(MCA_pmix_FRAMEWORK_COMPONENT_STATIC_SUBDIRS) \
. \
$(MCA_pmix_FRAMEWORK_COMPONENT_DSO_SUBDIRS)
DIST_SUBDIRS = \
util/keyval \
mca/base \
$(MCA_pmix_FRAMEWORKS_SUBDIRS) \
$(MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
headers =
sources =
nodist_headers =
EXTRA_DIST =
dist_pmixdata_DATA =
libpmix_la_LIBADD = \
mca/base/libpmix_mca_base.la \
$(MCA_pmix_FRAMEWORK_LIBS)
libpmix_la_DEPENDENCIES = $(libpmix_la_LIBADD)
if PMIX_EMBEDDED_MODE
noinst_LTLIBRARIES = libpmix.la
libpmix_la_SOURCES = $(headers) $(sources)
libpmix_la_LDFLAGS =
else
lib_LTLIBRARIES = libpmix.la
libpmix_la_SOURCES = $(headers) $(sources)
libpmix_la_LDFLAGS = -version-info $(libpmix_so_version)
endif !PMIX_EMBEDDED_MODE
include class/Makefile.include
include event/Makefile.include
include include/Makefile.include
include mca/Makefile.include
include util/Makefile.include
include client/Makefile.include
include server/Makefile.include
include runtime/Makefile.include
include tool/Makefile.include
include common/Makefile.include
include buffer_ops/Makefile.am
include usock/Makefile.am
include sec/Makefile.am
MAINTAINERCLEANFILES = Makefile.in config.h config.h.in
DISTCLEANFILES = Makefile
CLEANFILES = core.* *~
AM_CFLAGS = -Wall

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

@ -11,7 +11,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -23,14 +23,14 @@
# src/Makefile.am
headers += \
src/buffer_ops/buffer_ops.h \
src/buffer_ops/types.h \
src/buffer_ops/internal.h
buffer_ops/buffer_ops.h \
buffer_ops/types.h \
buffer_ops/internal.h
sources += \
src/buffer_ops/copy.c \
src/buffer_ops/internal_functions.c \
src/buffer_ops/open_close.c \
src/buffer_ops/pack.c \
src/buffer_ops/print.c \
src/buffer_ops/unpack.c
buffer_ops/copy.c \
buffer_ops/internal_functions.c \
buffer_ops/open_close.c \
buffer_ops/pack.c \
buffer_ops/print.c \
buffer_ops/unpack.c

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

@ -533,6 +533,7 @@ pmix_status_t pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
sv = (pmix_value_t*)src->data.darray.array;
for (n=0; n < src->data.darray.size; n++) {
if (PMIX_SUCCESS != (rc = pmix_value_xfer(&pv[n], &sv[n]))) {
PMIX_VALUE_FREE(pv, src->data.darray.size);
return rc;
}
}
@ -566,6 +567,7 @@ pmix_status_t pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
if (0 < sa[n].ninfo && NULL != sa[n].info) {
PMIX_INFO_CREATE(pa[n].info, sa[n].ninfo);
if (NULL == pa[n].info) {
PMIX_APP_FREE(pa, src->data.darray.size);
return PMIX_ERR_NOMEM;
}
pa[n].ninfo = sa[n].ninfo;
@ -638,6 +640,7 @@ pmix_status_t pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
if (NULL != sk[n].value) {
PMIX_VALUE_CREATE(pk[n].value, 1);
if (NULL == pk[n].value) {
free(p->data.darray.array);
return PMIX_ERR_NOMEM;
}
if (PMIX_SUCCESS != (rc = pmix_value_xfer(pk[n].value, sk[n].value))) {
@ -676,7 +679,7 @@ pmix_status_t pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
memcpy(p->data.darray.array, src->data.darray.array, src->data.darray.size * sizeof(pmix_persistence_t));
break;
case PMIX_POINTER:
p->data.darray.array = (void*)malloc(src->data.darray.size * sizeof(void*));
p->data.darray.array = (void**)malloc(src->data.darray.size * sizeof(void*));
if (NULL == p->data.darray.array) {
return PMIX_ERR_NOMEM;
}
@ -750,6 +753,7 @@ pmix_status_t pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
if (NULL != sq[n].qualifiers && 0 < sq[n].nqual) {
PMIX_INFO_CREATE(pq[n].qualifiers, sq[n].nqual);
if (NULL == pq[n].qualifiers) {
PMIX_QUERY_FREE(pq, src->data.darray.size);
return PMIX_ERR_NOMEM;
}
for (m=0; m < sq[n].nqual; m++) {
@ -1002,6 +1006,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_BYTE:
p->array = (char*)malloc(src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size);
@ -1010,6 +1015,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_INT16:
p->array = (char*)malloc(src->size * sizeof(uint16_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(uint16_t));
@ -1018,6 +1024,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_INT32:
p->array = (char*)malloc(src->size * sizeof(uint32_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(uint32_t));
@ -1026,6 +1033,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_INT64:
p->array = (char*)malloc(src->size * sizeof(uint64_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(uint64_t));
@ -1033,6 +1041,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_BOOL:
p->array = (char*)malloc(src->size * sizeof(bool));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(bool));
@ -1040,6 +1049,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_SIZE:
p->array = (char*)malloc(src->size * sizeof(size_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(size_t));
@ -1047,6 +1057,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_PID:
p->array = (char*)malloc(src->size * sizeof(pid_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pid_t));
@ -1054,6 +1065,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_STRING:
p->array = (char**)malloc(src->size * sizeof(char*));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
prarray = (char**)p->array;
@ -1068,6 +1080,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_UINT:
p->array = (char*)malloc(src->size * sizeof(int));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(int));
@ -1075,6 +1088,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_FLOAT:
p->array = (char*)malloc(src->size * sizeof(float));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(float));
@ -1082,6 +1096,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_DOUBLE:
p->array = (char*)malloc(src->size * sizeof(double));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(double));
@ -1089,6 +1104,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_TIMEVAL:
p->array = (struct timeval*)malloc(src->size * sizeof(struct timeval));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(struct timeval));
@ -1096,6 +1112,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_TIME:
p->array = (time_t*)malloc(src->size * sizeof(time_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(time_t));
@ -1103,6 +1120,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_STATUS:
p->array = (pmix_status_t*)malloc(src->size * sizeof(pmix_status_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_status_t));
@ -1110,6 +1128,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_VALUE:
PMIX_VALUE_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pv = (pmix_value_t*)p->array;
@ -1123,6 +1142,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_PROC:
PMIX_PROC_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_proc_t));
@ -1130,6 +1150,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_PROC_RANK:
p->array = (char*)malloc(src->size * sizeof(pmix_rank_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_proc_t));
@ -1137,6 +1158,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_APP:
PMIX_APP_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pa = (pmix_app_t*)p->array;
@ -1156,6 +1178,8 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
if (0 < sa[n].ninfo && NULL != sa[n].info) {
PMIX_INFO_CREATE(pa[n].info, sa[n].ninfo);
if (NULL == pa[n].info) {
PMIX_APP_FREE(pa, p->size);
free(p);
return PMIX_ERR_NOMEM;
}
pa[n].ninfo = sa[n].ninfo;
@ -1167,6 +1191,10 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
break;
case PMIX_INFO:
PMIX_INFO_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
p1 = (pmix_info_t*)p->array;
s1 = (pmix_info_t*)src->array;
for (n=0; n < src->size; n++) {
@ -1176,6 +1204,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_PDATA:
PMIX_PDATA_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pd = (pmix_pdata_t*)p->array;
@ -1187,6 +1216,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_BUFFER:
p->array = (pmix_buffer_t*)malloc(src->size * sizeof(pmix_buffer_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pb = (pmix_buffer_t*)p->array;
@ -1199,6 +1229,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_BYTE_OBJECT:
p->array = (pmix_byte_object_t*)malloc(src->size * sizeof(pmix_byte_object_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pbo = (pmix_byte_object_t*)p->array;
@ -1217,6 +1248,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_KVAL:
p->array = (pmix_kval_t*)calloc(src->size , sizeof(pmix_kval_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pk = (pmix_kval_t*)p->array;
@ -1228,6 +1260,8 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
if (NULL != sk[n].value) {
PMIX_VALUE_CREATE(pk[n].value, 1);
if (NULL == pk[n].value) {
PMIX_VALUE_FREE(pk[n].value, 1);
free(p);
return PMIX_ERR_NOMEM;
}
if (PMIX_SUCCESS != (rc = pmix_value_xfer(pk[n].value, sk[n].value))) {
@ -1239,6 +1273,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_MODEX:
PMIX_MODEX_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pm = (pmix_modex_data_t*)p->array;
@ -1248,6 +1283,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
if (NULL != sm[n].blob && 0 < sm[n].size) {
pm[n].blob = (uint8_t*)malloc(sm[n].size);
if (NULL == pm[n].blob) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(pm[n].blob, sm[n].blob, sm[n].size);
@ -1261,13 +1297,15 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_PERSIST:
p->array = (pmix_persistence_t*)malloc(src->size * sizeof(pmix_persistence_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_persistence_t));
break;
case PMIX_POINTER:
p->array = (void*)malloc(src->size * sizeof(void*));
p->array = (void**)malloc(src->size * sizeof(void*));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(void*));
@ -1275,6 +1313,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_SCOPE:
p->array = (pmix_scope_t*)malloc(src->size * sizeof(pmix_scope_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_scope_t));
@ -1282,6 +1321,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_DATA_RANGE:
p->array = (pmix_data_range_t*)malloc(src->size * sizeof(pmix_data_range_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_data_range_t));
@ -1289,6 +1329,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_COMMAND:
p->array = (pmix_cmd_t*)malloc(src->size * sizeof(pmix_cmd_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_cmd_t));
@ -1296,6 +1337,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_INFO_DIRECTIVES:
p->array = (pmix_info_directives_t*)malloc(src->size * sizeof(pmix_info_directives_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_info_directives_t));
@ -1303,6 +1345,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
case PMIX_PROC_INFO:
PMIX_PROC_INFO_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pi = (pmix_proc_info_t*)p->array;
@ -1325,10 +1368,12 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
}
break;
case PMIX_DATA_ARRAY:
free(p);
return PMIX_ERR_NOT_SUPPORTED; // don't support iterative arrays
case PMIX_QUERY:
PMIX_QUERY_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pq = (pmix_query_t*)p->array;
@ -1340,6 +1385,8 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
if (NULL != sq[n].qualifiers && 0 < sq[n].nqual) {
PMIX_INFO_CREATE(pq[n].qualifiers, sq[n].nqual);
if (NULL == pq[n].qualifiers) {
PMIX_INFO_FREE(pq[n].qualifiers, sq[n].nqual);
free(p);
return PMIX_ERR_NOMEM;
}
for (m=0; m < sq[n].nqual; m++) {
@ -1353,6 +1400,7 @@ pmix_status_t pmix_bfrop_copy_darray(pmix_data_array_t **dest,
}
break;
default:
free(p);
return PMIX_ERR_UNKNOWN_DATA_TYPE;
}
@ -1373,6 +1421,7 @@ pmix_status_t pmix_bfrop_copy_query(pmix_query_t **dest,
(*dest)->nqual = src->nqual;
if (NULL != src->qualifiers) {
if (PMIX_SUCCESS != (rc = pmix_bfrop_copy_info(&((*dest)->qualifiers), src->qualifiers, PMIX_INFO))) {
free(*dest);
return rc;
}
}

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

@ -26,7 +26,7 @@
*/
#include <src/include/pmix_config.h>
#include <pmix/pmix_common.h>
#include <pmix_common.h>
#ifdef HAVE_STRING_H
#include <string.h>

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

@ -23,7 +23,7 @@
#include <src/include/pmix_config.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <stdio.h>
#ifdef HAVE_TIME_H

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

@ -34,7 +34,7 @@
#include "src/class/pmix_object.h"
#include "src/class/pmix_pointer_array.h"
#include "src/class/pmix_list.h"
#include <pmix/pmix_common.h>
#include <pmix_common.h>
BEGIN_C_DECLS

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

@ -11,6 +11,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -19,21 +20,23 @@
#
# This makefile.am does not stand on its own - it is included from
# src/Makefile.am
# Makefile.am
# Source code files
headers += \
src/class/pmix_object.h \
src/class/pmix_list.h \
src/class/pmix_pointer_array.h \
src/class/pmix_hash_table.h \
src/class/pmix_hotel.h \
src/class/pmix_ring_buffer.h
class/pmix_object.h \
class/pmix_list.h \
class/pmix_pointer_array.h \
class/pmix_hash_table.h \
class/pmix_hotel.h \
class/pmix_ring_buffer.h \
class/pmix_value_array.h
sources += \
src/class/pmix_object.c \
src/class/pmix_list.c \
src/class/pmix_pointer_array.c \
src/class/pmix_hash_table.c \
src/class/pmix_hotel.c \
src/class/pmix_ring_buffer.c
class/pmix_object.c \
class/pmix_list.c \
class/pmix_pointer_array.c \
class/pmix_hash_table.c \
class/pmix_hotel.c \
class/pmix_ring_buffer.c \
class/pmix_value_array.c

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

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

@ -9,12 +9,12 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -43,20 +43,22 @@
#include "src/class/pmix_list.h"
#include <pmix/pmix_common.h>
#include <pmix_common.h>
BEGIN_C_DECLS
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_hash_table_t);
PMIX_CLASS_DECLARATION(pmix_hash_table_t);
struct pmix_hash_table_t
{
pmix_object_t super; /**< subclass of pmix_object_t */
pmix_list_t ht_nodes; /**< free list of hash nodes */
pmix_list_t *ht_table; /**< each item is an array of pmix_fhnode_t nodes */
size_t ht_table_size; /**< size of table */
size_t ht_size; /**< number of values on table */
size_t ht_mask;
struct pmix_hash_element_t * ht_table; /**< table of elements (opaque to users) */
size_t ht_capacity; /**< allocated size (capacity) of table */
size_t ht_size; /**< number of extant entries */
size_t ht_growth_trigger; /**< size hits this and table is grown */
int ht_density_numer, ht_density_denom; /**< max allowed density of table */
int ht_growth_numer, ht_growth_denom; /**< growth factor when grown */
const struct pmix_hash_type_methods_t * ht_type_methods;
};
typedef struct pmix_hash_table_t pmix_hash_table_t;
@ -73,12 +75,10 @@ typedef struct pmix_hash_table_t pmix_hash_table_t;
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_init(pmix_hash_table_t* ht, size_t table_size);
int pmix_hash_table_init(pmix_hash_table_t* ht, size_t table_size);
/**
* Alternative form
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_init2(pmix_hash_table_t* ht, size_t estimated_max_size,
/* this could be the new init if people wanted a more general API */
int pmix_hash_table_init2(pmix_hash_table_t* ht, size_t estimated_max_size,
int density_numer, int density_denom,
int growth_numer, int growth_denom);
@ -103,7 +103,7 @@ static inline size_t pmix_hash_table_get_size(pmix_hash_table_t *ht)
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_all(pmix_hash_table_t *ht);
int pmix_hash_table_remove_all(pmix_hash_table_t *ht);
/**
* Retrieve value via uint32_t key.
@ -118,8 +118,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_all(pmix_hash_table_t *ht);
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint32(pmix_hash_table_t* table, uint32_t key,
void** ptr);
int pmix_hash_table_get_value_uint32(pmix_hash_table_t* table, uint32_t key,
void** ptr);
/**
* Set value based on uint32_t key.
@ -131,7 +131,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint32(pmix_hash_table_t*
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint32(pmix_hash_table_t* table, uint32_t key, void* value);
int pmix_hash_table_set_value_uint32(pmix_hash_table_t* table, uint32_t key, void* value);
/**
* Remove value based on uint32_t key.
@ -142,7 +142,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint32(pmix_hash_table_t*
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint32(pmix_hash_table_t* table, uint32_t key);
int pmix_hash_table_remove_value_uint32(pmix_hash_table_t* table, uint32_t key);
/**
* Retrieve value via uint64_t key.
@ -157,8 +157,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint32(pmix_hash_table_
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint64(pmix_hash_table_t *table, uint64_t key,
void **ptr);
int pmix_hash_table_get_value_uint64(pmix_hash_table_t *table, uint64_t key,
void **ptr);
/**
* Set value based on uint64_t key.
@ -170,7 +170,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint64(pmix_hash_table_t *
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint64(pmix_hash_table_t *table, uint64_t key, void* value);
int pmix_hash_table_set_value_uint64(pmix_hash_table_t *table, uint64_t key, void* value);
/**
* Remove value based on uint64_t key.
@ -181,7 +181,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint64(pmix_hash_table_t *
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint64(pmix_hash_table_t *table, uint64_t key);
int pmix_hash_table_remove_value_uint64(pmix_hash_table_t *table, uint64_t key);
/**
* Retrieve value via arbitrary length binary key.
@ -196,8 +196,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint64(pmix_hash_table_
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_ptr(pmix_hash_table_t *table, const void* key,
size_t keylen, void **ptr);
int pmix_hash_table_get_value_ptr(pmix_hash_table_t *table, const void* key,
size_t keylen, void **ptr);
/**
* Set value based on arbitrary length binary key.
@ -209,7 +209,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_ptr(pmix_hash_table_t *tab
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen, void* value);
int pmix_hash_table_set_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen, void* value);
/**
* Remove value based on arbitrary length binary key.
@ -220,7 +220,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_ptr(pmix_hash_table_t *tab
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen);
int pmix_hash_table_remove_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen);
/** The following functions are only for allowing iterating through
@ -245,8 +245,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_ptr(pmix_hash_table_t *
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void **node);
int pmix_hash_table_get_first_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void **node);
/**
@ -263,9 +263,9 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint32(pmix_hash_table
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_next_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void *in_node,
void **out_node);
int pmix_hash_table_get_next_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void *in_node,
void **out_node);
/**
@ -281,8 +281,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_next_key_uint32(pmix_hash_table_
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void **node);
int pmix_hash_table_get_first_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void **node);
/**
@ -299,9 +299,48 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint64(pmix_hash_table
*
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_next_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void *in_node,
void **out_node);
int pmix_hash_table_get_next_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void *in_node,
void **out_node);
/**
* Get the first ptr bit key from the hash table, which can be used later to
* get the next key
* @param table The hash table pointer (IN)
* @param key The first key (OUT)
* @param key_size The first key size (OUT)
* @param value The value corresponding to this key (OUT)
* @param node The pointer to the hash table internal node which stores
* the key-value pair (this is required for subsequent calls
* to get_next_key) (OUT)
* @return PMIX error code
*
*/
int pmix_hash_table_get_first_key_ptr(pmix_hash_table_t *table, void* *key,
size_t *key_size, void **value, void **node);
/**
* Get the next ptr bit key from the hash table, knowing the current key
* @param table The hash table pointer (IN)
* @param key The key (OUT)
* @param key_size The key size (OUT)
* @param value The value corresponding to this key (OUT)
* @param in_node The node pointer from previous call to either get_first
or get_next (IN)
* @param out_node The pointer to the hash table internal node which stores
* the key-value pair (this is required for subsequent calls
* to get_next_key) (OUT)
* @return PMIX error code
*
*/
int pmix_hash_table_get_next_key_ptr(pmix_hash_table_t *table, void* *key,
size_t *key_size, void **value,
void *in_node, void **out_node);
/**
* @brief Returns next power-of-two of the given value.

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

@ -54,7 +54,7 @@
#include <src/include/pmix_config.h>
#include "src/include/types.h"
#include "src/include/prefetch.h"
#include "pmix/pmix_common.h"
#include "pmix_common.h"
#include "src/class/pmix_object.h"
#include PMIX_EVENT_HEADER
@ -157,7 +157,7 @@ PMIX_CLASS_DECLARATION(pmix_hotel_t);
* @return PMIX_SUCCESS if all initializations were succesful. Otherwise,
* the error indicate what went wrong in the function.
*/
PMIX_DECLSPEC int pmix_hotel_init(pmix_hotel_t *hotel, int num_rooms,
int pmix_hotel_init(pmix_hotel_t *hotel, int num_rooms,
pmix_event_base_t *evbase,
uint32_t eviction_timeout,
int eviction_event_priority,

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

@ -20,9 +20,8 @@
*/
#include <src/include/pmix_config.h>
#include "include/pmix_common.h"
#include "src/class/pmix_list.h"
#include <pmix.h>
/*
* List classes

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

@ -83,13 +83,13 @@ BEGIN_C_DECLS
*
* The class for the list container.
*/
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_list_t);
PMIX_CLASS_DECLARATION(pmix_list_t);
/**
* \internal
*
* Base class for items that are put in list (pmix_list_t) containers.
*/
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_list_item_t);
PMIX_CLASS_DECLARATION(pmix_list_item_t);
/**
@ -807,7 +807,7 @@ static inline void pmix_list_insert_pos(pmix_list_t *list, pmix_list_item_t *pos
* If index is greater than the length of the list, no action is
* performed and false is returned.
*/
PMIX_DECLSPEC bool pmix_list_insert(pmix_list_t *list, pmix_list_item_t *item,
bool pmix_list_insert(pmix_list_t *list, pmix_list_item_t *item,
long long idx);
@ -828,7 +828,7 @@ static inline void pmix_list_insert_pos(pmix_list_t *list, pmix_list_item_t *pos
* containers remain valid, including those that point to elements
* in \c xlist.
*/
PMIX_DECLSPEC void pmix_list_join(pmix_list_t *thislist, pmix_list_item_t *pos,
void pmix_list_join(pmix_list_t *thislist, pmix_list_item_t *pos,
pmix_list_t *xlist);
@ -855,7 +855,7 @@ static inline void pmix_list_insert_pos(pmix_list_t *list, pmix_list_item_t *pos
* This is an O(N) operation because the length of both lists must
* be recomputed.
*/
PMIX_DECLSPEC void pmix_list_splice(pmix_list_t *thislist, pmix_list_item_t *pos,
void pmix_list_splice(pmix_list_t *thislist, pmix_list_item_t *pos,
pmix_list_t *xlist, pmix_list_item_t *first,
pmix_list_item_t *last);
@ -902,7 +902,7 @@ static inline void pmix_list_insert_pos(pmix_list_t *list, pmix_list_item_t *pos
* whatever the underlying type is). See the documentation of
* pmix_list_item_compare_fn_t for an example).
*/
PMIX_DECLSPEC int pmix_list_sort(pmix_list_t* list, pmix_list_item_compare_fn_t compare);
int pmix_list_sort(pmix_list_t* list, pmix_list_item_compare_fn_t compare);
END_C_DECLS

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

@ -130,7 +130,7 @@ BEGIN_C_DECLS
#if PMIX_ENABLE_DEBUG
/* Any kind of unique ID should do the job */
#define PMIX_PMIX_MAGIC_ID ((0xdeafbeedULL << 32) + 0xdeafbeedULL)
#define PMIX_OBJ_MAGIC_ID ((0xdeafbeedULL << 32) + 0xdeafbeedULL)
#endif
/* typedefs ***********************************************************/
@ -169,9 +169,9 @@ struct pmix_class_t {
* @param NAME Name of the class to initialize
*/
#if PMIX_ENABLE_DEBUG
#define PMIX_PMIX_STATIC_INIT(BASE_CLASS) { PMIX_PMIX_MAGIC_ID, PMIX_CLASS(BASE_CLASS), 1, __FILE__, __LINE__ }
#define PMIX_OBJ_STATIC_INIT(BASE_CLASS) { PMIX_OBJ_MAGIC_ID, PMIX_CLASS(BASE_CLASS), 1, __FILE__, __LINE__ }
#else
#define PMIX_PMIX_STATIC_INIT(BASE_CLASS) { PMIX_CLASS(BASE_CLASS), 1 }
#define PMIX_OBJ_STATIC_INIT(BASE_CLASS) { PMIX_CLASS(BASE_CLASS), 1 }
#endif
/**
@ -249,7 +249,7 @@ static inline pmix_object_t *pmix_obj_new(pmix_class_t * cls);
static inline pmix_object_t *pmix_obj_new_debug(pmix_class_t* type, const char* file, int line)
{
pmix_object_t* object = pmix_obj_new(type);
object->obj_magic_id = PMIX_PMIX_MAGIC_ID;
object->obj_magic_id = PMIX_OBJ_MAGIC_ID;
object->cls_init_file_name = file;
object->cls_init_lineno = line;
return object;
@ -270,7 +270,7 @@ static inline pmix_object_t *pmix_obj_new_debug(pmix_class_t* type, const char*
#define PMIX_RETAIN(object) \
do { \
assert(NULL != ((pmix_object_t *) (object))->obj_class); \
assert(PMIX_PMIX_MAGIC_ID == ((pmix_object_t *) (object))->obj_magic_id); \
assert(PMIX_OBJ_MAGIC_ID == ((pmix_object_t *) (object))->obj_magic_id); \
pmix_obj_update((pmix_object_t *) (object), 1); \
assert(((pmix_object_t *) (object))->obj_reference_count >= 0); \
} while (0)
@ -311,7 +311,7 @@ static inline pmix_object_t *pmix_obj_new_debug(pmix_class_t* type, const char*
#define PMIX_RELEASE(object) \
do { \
assert(NULL != ((pmix_object_t *) (object))->obj_class); \
assert(PMIX_PMIX_MAGIC_ID == ((pmix_object_t *) (object))->obj_magic_id); \
assert(PMIX_OBJ_MAGIC_ID == ((pmix_object_t *) (object))->obj_magic_id); \
if (0 == pmix_obj_update((pmix_object_t *) (object), -1)) { \
PMIX_SET_MAGIC_ID((object), 0); \
pmix_obj_run_destructors((pmix_object_t *) (object)); \
@ -346,7 +346,7 @@ do { \
#define PMIX_CONSTRUCT_INTERNAL(object, type) \
do { \
PMIX_SET_MAGIC_ID((object), PMIX_PMIX_MAGIC_ID); \
PMIX_SET_MAGIC_ID((object), PMIX_OBJ_MAGIC_ID); \
if (0 == (type)->cls_initialized) { \
pmix_class_initialize((type)); \
} \
@ -365,7 +365,7 @@ do { \
#if PMIX_ENABLE_DEBUG
#define PMIX_DESTRUCT(object) \
do { \
assert(PMIX_PMIX_MAGIC_ID == ((pmix_object_t *) (object))->obj_magic_id); \
assert(PMIX_OBJ_MAGIC_ID == ((pmix_object_t *) (object))->obj_magic_id); \
PMIX_SET_MAGIC_ID((object), 0); \
pmix_obj_run_destructors((pmix_object_t *) (object)); \
PMIX_REMEMBER_FILE_AND_LINENO( object, __FILE__, __LINE__ ); \
@ -378,7 +378,7 @@ do { \
} while (0)
#endif
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_object_t);
PMIX_CLASS_DECLARATION(pmix_object_t);
/* declarations *******************************************************/
@ -390,7 +390,7 @@ PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_object_t);
*
* @param class Pointer to class descriptor
*/
PMIX_DECLSPEC void pmix_class_initialize(pmix_class_t *);
void pmix_class_initialize(pmix_class_t *);
/**
* Shut down the class system and release all memory
@ -401,7 +401,7 @@ PMIX_DECLSPEC void pmix_class_initialize(pmix_class_t *);
* tools like valgrind and purify don't report still-reachable memory
* upon process termination.
*/
PMIX_DECLSPEC int pmix_class_finalize(void);
int pmix_class_finalize(void);
/**
* Run the hierarchy of class constructors for this object, in a

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

@ -32,7 +32,7 @@
#include "src/class/pmix_pointer_array.h"
#include "src/util/output.h"
#include <pmix.h>
#include "include/pmix_common.h"
enum { TABLE_INIT = 1, TABLE_GROW = 2 };

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

@ -30,7 +30,7 @@
#endif
#include "src/class/pmix_object.h"
#include <pmix/pmix_common.h>
#include <pmix_common.h>
BEGIN_C_DECLS
@ -63,7 +63,7 @@ typedef struct pmix_pointer_array_t pmix_pointer_array_t;
/**
* Class declaration
*/
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_pointer_array_t);
PMIX_CLASS_DECLARATION(pmix_pointer_array_t);
/**
* Initialize the pointer array with an initial size of initial_allocation.
@ -79,7 +79,7 @@ PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_pointer_array_t);
* @return PMIX_SUCCESS if all initializations were succesfull. Otherwise,
* the error indicate what went wrong in the function.
*/
PMIX_DECLSPEC pmix_status_t pmix_pointer_array_init(pmix_pointer_array_t* array,
pmix_status_t pmix_pointer_array_init(pmix_pointer_array_t* array,
int initial_allocation,
int max_size, int block_size );
@ -92,7 +92,7 @@ PMIX_DECLSPEC pmix_status_t pmix_pointer_array_init(pmix_pointer_array_t* array,
* @return Index of inserted array element. Return value of
* (-1) indicates an error.
*/
PMIX_DECLSPEC int pmix_pointer_array_add(pmix_pointer_array_t *array, void *ptr);
int pmix_pointer_array_add(pmix_pointer_array_t *array, void *ptr);
/**
* Set the value of an element in array
@ -104,7 +104,7 @@ PMIX_DECLSPEC int pmix_pointer_array_add(pmix_pointer_array_t *array, void *ptr)
* @return PMIX_SUCCESS if item was inserted. Otherwise,
* the error indicate what went wrong in the function.
*/
PMIX_DECLSPEC pmix_status_t pmix_pointer_array_set_item(pmix_pointer_array_t *array,
pmix_status_t pmix_pointer_array_set_item(pmix_pointer_array_t *array,
int index, void *value);
/**
@ -157,7 +157,7 @@ static inline int pmix_pointer_array_get_size(pmix_pointer_array_t *array)
* Simple function to set the size of the array in order to
* hide the member field from external users.
*/
PMIX_DECLSPEC pmix_status_t pmix_pointer_array_set_size(pmix_pointer_array_t *array, int size);
pmix_status_t pmix_pointer_array_set_size(pmix_pointer_array_t *array, int size);
/**
* Test whether a certain element is already in use. If not yet
@ -173,7 +173,7 @@ PMIX_DECLSPEC pmix_status_t pmix_pointer_array_set_size(pmix_pointer_array_t *ar
* In contrary to array_set, this function does not allow to overwrite
* a value, unless the previous value is NULL ( equiv. to free ).
*/
PMIX_DECLSPEC bool pmix_pointer_array_test_and_set_item (pmix_pointer_array_t *table,
bool pmix_pointer_array_test_and_set_item (pmix_pointer_array_t *table,
int index,
void *value);

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

@ -25,7 +25,7 @@
#include <stdio.h>
#include <assert.h>
#include "pmix/pmix_common.h"
#include "pmix_common.h"
#include "src/class/pmix_ring_buffer.h"
#include "src/util/output.h"

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

@ -53,7 +53,7 @@ typedef struct pmix_ring_buffer_t pmix_ring_buffer_t;
/**
* Class declaration
*/
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_ring_buffer_t);
PMIX_CLASS_DECLARATION(pmix_ring_buffer_t);
/**
* Initialize the ring buffer, defining its size.
@ -64,7 +64,7 @@ PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_ring_buffer_t);
* @return PMIX_SUCCESS if all initializations were succesful. Otherwise,
* the error indicate what went wrong in the function.
*/
PMIX_DECLSPEC int pmix_ring_buffer_init(pmix_ring_buffer_t* ring, int size);
int pmix_ring_buffer_init(pmix_ring_buffer_t* ring, int size);
/**
* Push an item onto the ring buffer, displacing the oldest
@ -76,7 +76,7 @@ PMIX_DECLSPEC int pmix_ring_buffer_init(pmix_ring_buffer_t* ring, int size);
* @return Pointer to displaced item, NULL if ring
* is not yet full
*/
PMIX_DECLSPEC void* pmix_ring_buffer_push(pmix_ring_buffer_t *ring, void *ptr);
void* pmix_ring_buffer_push(pmix_ring_buffer_t *ring, void *ptr);
/**
@ -88,14 +88,14 @@ PMIX_DECLSPEC void* pmix_ring_buffer_push(pmix_ring_buffer_t *ring, void *ptr);
* @return Error code. NULL indicates an error.
*/
PMIX_DECLSPEC void* pmix_ring_buffer_pop(pmix_ring_buffer_t *ring);
void* pmix_ring_buffer_pop(pmix_ring_buffer_t *ring);
/*
* Access an element of the ring, without removing it, indexed
* starting at the tail - a value of -1 will return the element
* at the head of the ring
*/
PMIX_DECLSPEC void* pmix_ring_buffer_poke(pmix_ring_buffer_t *ring, int i);
void* pmix_ring_buffer_poke(pmix_ring_buffer_t *ring, int i);
END_C_DECLS

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

@ -0,0 +1,67 @@
/*
* 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-2007 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) 2016 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include "src/class/pmix_value_array.h"
static void pmix_value_array_construct(pmix_value_array_t* array)
{
array->array_items = NULL;
array->array_size = 0;
array->array_item_sizeof = 0;
array->array_alloc_size = 0;
}
static void pmix_value_array_destruct(pmix_value_array_t* array)
{
if (NULL != array->array_items)
free(array->array_items);
}
PMIX_CLASS_INSTANCE(
pmix_value_array_t,
pmix_object_t,
pmix_value_array_construct,
pmix_value_array_destruct
);
int pmix_value_array_set_size(pmix_value_array_t* array, size_t size)
{
#if PMIX_ENABLE_DEBUG
if(array->array_item_sizeof == 0) {
pmix_output(0, "pmix_value_array_set_size: item size must be initialized");
return PMIX_ERR_BAD_PARAM;
}
#endif
if(size > array->array_alloc_size) {
while(array->array_alloc_size < size)
array->array_alloc_size <<= 1;
array->array_items = (unsigned char *)realloc(array->array_items,
array->array_alloc_size * array->array_item_sizeof);
if (NULL == array->array_items)
return PMIX_ERR_OUT_OF_RESOURCE;
}
array->array_size = size;
return PMIX_SUCCESS;
}

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

@ -0,0 +1,281 @@
/*
* Copyright (c) 2004-2007 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) 2016 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef PMIX_VALUE_ARRAY_H
#define PMIX_VALUE_ARRAY_H
#include <src/include/pmix_config.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif /* HAVE_STRINGS_H */
#include "src/class/pmix_object.h"
#if PMIX_ENABLE_DEBUG
#include "src/util/output.h"
#endif
#include "pmix_common.h"
BEGIN_C_DECLS
/*
* @file Array of elements maintained by value.
*/
struct pmix_value_array_t
{
pmix_object_t super;
unsigned char* array_items;
size_t array_item_sizeof;
size_t array_size;
size_t array_alloc_size;
};
typedef struct pmix_value_array_t pmix_value_array_t;
PMIX_CLASS_DECLARATION(pmix_value_array_t);
/**
* Initialize the array to hold items by value. This routine must
* be called prior to using the array.
*
* @param array The array to initialize (IN).
* @param item_size The sizeof each array element (IN).
* @return PMIX error code
*
* Note that there is no corresponding "finalize" function -- use
* OBJ_DESTRUCT (for stack arrays) or OBJ_RELEASE (for heap arrays) to
* delete it.
*/
static inline int pmix_value_array_init(pmix_value_array_t *array, size_t item_sizeof)
{
array->array_item_sizeof = item_sizeof;
array->array_alloc_size = 1;
array->array_size = 0;
array->array_items = (unsigned char*)realloc(array->array_items, item_sizeof * array->array_alloc_size);
return (NULL != array->array_items) ? PMIX_SUCCESS : PMIX_ERR_OUT_OF_RESOURCE;
}
/**
* Reserve space in the array for new elements, but do not change the size.
*
* @param array The input array (IN).
* @param size The anticipated size of the array (IN).
* @return PMIX error code.
*/
static inline int pmix_value_array_reserve(pmix_value_array_t* array, size_t size)
{
if(size > array->array_alloc_size) {
array->array_items = (unsigned char*)realloc(array->array_items, array->array_item_sizeof * size);
if(NULL == array->array_items) {
array->array_size = 0;
array->array_alloc_size = 0;
return PMIX_ERR_OUT_OF_RESOURCE;
}
array->array_alloc_size = size;
}
return PMIX_SUCCESS;
}
/**
* Retreives the number of elements in the array.
*
* @param array The input array (IN).
* @return The number of elements currently in use.
*/
static inline size_t pmix_value_array_get_size(pmix_value_array_t* array)
{
return array->array_size;
}
/**
* Set the number of elements in the array.
*
* @param array The input array (IN).
* @param size The new array size.
*
* @return PMIX error code.
*
* Note that resizing the array to a smaller size may not change
* the underlying memory allocated by the array. However, setting
* the size larger than the current allocation will grow it. In either
* case, if the routine is successful, pmix_value_array_get_size() will
* return the new size.
*/
int pmix_value_array_set_size(pmix_value_array_t* array, size_t size);
/**
* Macro to retrieve an item from the array by value.
*
* @param array The input array (IN).
* @param item_type The C datatype of the array item (IN).
* @param item_index The array index (IN).
*
* @returns item The requested item.
*
* Note that this does not change the size of the array - this macro is
* strictly for performance - the user assumes the responsibility of
* ensuring the array index is valid (0 <= item index < array size).
*/
#define PMIX_VALUE_ARRAY_GET_ITEM(array, item_type, item_index) \
((item_type*)((array)->array_items))[item_index]
/**
* Retrieve an item from the array by reference.
*
* @param array The input array (IN).
* @param item_index The array index (IN).
*
* @return ptr Pointer to the requested item.
*
* Note that if the specified item_index is larger than the current
* array size, the array is grown to satisfy the request.
*/
static inline void* pmix_value_array_get_item(pmix_value_array_t *array, size_t item_index)
{
if(item_index >= array->array_size && pmix_value_array_set_size(array, item_index+1) != PMIX_SUCCESS)
return NULL;
return array->array_items + (item_index * array->array_item_sizeof);
}
/**
* Macro to set an array element by value.
*
* @param array The input array (IN).
* @param item_type The C datatype of the array item (IN).
* @param item_index The array index (IN).
* @param item_value The new value for the specified index (IN).
*
* Note that this does not change the size of the array - this macro is
* strictly for performance - the user assumes the responsibility of
* ensuring the array index is valid (0 <= item index < array size).
*
* It is safe to free the item after returning from this call; it is
* copied into the array by value.
*/
#define PMIX_VALUE_ARRAY_SET_ITEM(array, item_type, item_index, item_value) \
(((item_type*)((array)->array_items))[item_index] = item_value)
/**
* Set an array element by value.
*
* @param array The input array (IN).
* @param item_index The array index (IN).
* @param item_value A pointer to the item, which is copied into
* the array.
*
* @return PMIX error code.
*
* It is safe to free the item after returning from this call; it is
* copied into the array by value.
*/
static inline int pmix_value_array_set_item(pmix_value_array_t *array, size_t item_index, const void* item)
{
int rc;
if(item_index >= array->array_size &&
(rc = pmix_value_array_set_size(array, item_index+1)) != PMIX_SUCCESS)
return rc;
memcpy(array->array_items + (item_index * array->array_item_sizeof), item, array->array_item_sizeof);
return PMIX_SUCCESS;
}
/**
* Appends an item to the end of the array.
*
* @param array The input array (IN).
* @param item A pointer to the item to append, which is copied
* into the array.
*
* @return PMIX error code
*
* This will grow the array if it is not large enough to contain the
* item. It is safe to free the item after returning from this call;
* it is copied by value into the array.
*/
static inline int pmix_value_array_append_item(pmix_value_array_t *array, const void *item)
{
return pmix_value_array_set_item(array, array->array_size, item);
}
/**
* Remove a specific item from the array.
*
* @param array The input array (IN).
* @param item_index The index to remove, which must be less than
* the current array size (IN).
*
* @return PMIX error code.
*
* All elements following this index are shifted down.
*/
static inline int pmix_value_array_remove_item(pmix_value_array_t *array, size_t item_index)
{
#if PMIX_ENABLE_DEBUG
if (item_index >= array->array_size) {
pmix_output(0, "pmix_value_array_remove_item: invalid index %lu\n", (unsigned long)item_index);
return PMIX_ERR_BAD_PARAM;
}
#endif
memmove(array->array_items+(array->array_item_sizeof * item_index),
array->array_items+(array->array_item_sizeof * (item_index+1)),
array->array_item_sizeof * (array->array_size - item_index - 1));
array->array_size--;
return PMIX_SUCCESS;
}
/**
* Get the base pointer of the underlying array.
*
* @param array The input array (IN).
* @param array_type The C datatype of the array (IN).
*
* @returns ptr Pointer to the actual array.
*
* This function is helpful when you need to iterate through an
* entire array; simply get the base value of the array and use native
* C to iterate through it manually. This can have better performance
* than looping over PMIX_VALUE_ARRAY_GET_ITEM() and
* PMIX_VALUE_ARRAY_SET_ITEM() because it will [potentially] reduce the
* number of pointer dereferences.
*/
#define PMIX_VALUE_ARRAY_GET_BASE(array, item_type) \
((item_type*) ((array)->array_items))
END_C_DECLS
#endif

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

@ -1,27 +0,0 @@
#
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
headers += \
src/client/pmix_client_ops.h
sources += \
src/client/pmix_client.c \
src/client/pmix_client_fence.c \
src/client/pmix_client_get.c \
src/client/pmix_client_pub.c \
src/client/pmix_client_spawn.c \
src/client/pmix_client_connect.c
if !PMIX_EMBEDDED_MODE
sources += \
src/client/pmi1.c \
src/client/pmi2.c
endif

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

@ -0,0 +1,29 @@
# -*- makefile -*-
#
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
# All rights reserved.
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
headers += \
client/pmix_client_ops.h
sources += \
client/pmix_client.c \
client/pmix_client_fence.c \
client/pmix_client_get.c \
client/pmix_client_pub.c \
client/pmix_client_spawn.c \
client/pmix_client_connect.c
if !PMIX_EMBEDDED_MODE
sources += \
client/pmi1.c \
client/pmi2.c
endif

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

@ -18,7 +18,7 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h>
#include <pmix.h>
@ -61,7 +61,7 @@
#include "src/util/error.h"
#include "src/util/hash.h"
#include "src/util/output.h"
#include "src/util/progress_threads.h"
#include "src/runtime/pmix_progress_threads.h"
#include "src/usock/usock.h"
#include "src/sec/pmix_sec.h"
#include "src/include/pmix_globals.h"
@ -183,6 +183,8 @@ static void job_data(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
* unpack it to maintain sequence */
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(buf, &nspace, &cnt, PMIX_STRING))) {
PMIX_ERROR_LOG(rc);
cb->status = PMIX_ERROR;
cb->active = false;
return;
}
/* decode it */
@ -374,8 +376,11 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
/* setup the support */
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
if (PMIX_SUCCESS != (rc = pmix_dstore_init())) {
return rc;
if (PMIX_SUCCESS != (rc = pmix_dstore_init(NULL, 0))) {
pmix_output_close(pmix_globals.debug_output);
pmix_output_finalize();
pmix_class_finalize();
return PMIX_ERR_DATA_VALUE_NOT_FOUND;
}
#endif /* PMIX_ENABLE_DSTORE */
pmix_bfrop_open();
@ -384,7 +389,7 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
if (!pmix_globals.external_evbase) {
/* create an event base and progress thread for us */
if (NULL == (pmix_globals.evbase = pmix_start_progress_thread())) {
if (NULL == (pmix_globals.evbase = pmix_progress_thread_init(NULL))) {
pmix_sec_finalize();
pmix_usock_finalize();
pmix_bfrop_close();
@ -402,7 +407,7 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
/* connect to the server - returns job info if successful */
if (PMIX_SUCCESS != (rc = connect_to_server(&address, &cb))){
PMIX_DESTRUCT(&cb);
pmix_stop_progress_thread(pmix_globals.evbase);
pmix_progress_thread_finalize(NULL);
pmix_sec_finalize();
pmix_usock_finalize();
pmix_bfrop_close();
@ -498,7 +503,10 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
}
if (!pmix_globals.external_evbase) {
pmix_stop_progress_thread(pmix_globals.evbase);
#ifdef HAVE_LIBEVENT_GLOBAL_SHUTDOWN
libevent_global_shutdown();
#endif
pmix_progress_thread_finalize(NULL);
}
pmix_usock_finalize();
@ -508,10 +516,7 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
if (0 <= pmix_client_globals.myserver.sd) {
CLOSE_THE_SOCKET(pmix_client_globals.myserver.sd);
}
event_base_free(pmix_globals.evbase);
#ifdef HAVE_LIBEVENT_GLOBAL_SHUTDOWN
libevent_global_shutdown();
#endif
pmix_bfrop_close();
pmix_sec_finalize();
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)

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

@ -18,7 +18,7 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <pmix.h>
@ -50,7 +50,6 @@
#include "src/util/argv.h"
#include "src/util/error.h"
#include "src/util/output.h"
#include "src/util/progress_threads.h"
#include "src/usock/usock.h"
#include "src/sec/pmix_sec.h"

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

@ -18,7 +18,7 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <pmix.h>
@ -51,7 +51,6 @@
#include "src/util/error.h"
#include "src/util/hash.h"
#include "src/util/output.h"
#include "src/util/progress_threads.h"
#include "src/usock/usock.h"
#include "src/sec/pmix_sec.h"

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

@ -18,7 +18,7 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <pmix.h>
@ -51,7 +51,6 @@
#include "src/util/error.h"
#include "src/util/hash.h"
#include "src/util/output.h"
#include "src/util/progress_threads.h"
#include "src/usock/usock.h"
#include "src/sec/pmix_sec.h"
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)

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

@ -18,7 +18,7 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <pmix.h>
@ -50,7 +50,6 @@
#include "src/util/argv.h"
#include "src/util/error.h"
#include "src/util/output.h"
#include "src/util/progress_threads.h"
#include "src/usock/usock.h"
#include "src/sec/pmix_sec.h"

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

@ -18,7 +18,7 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <pmix.h>
@ -50,7 +50,6 @@
#include "src/util/argv.h"
#include "src/util/error.h"
#include "src/util/output.h"
#include "src/util/progress_threads.h"
#include "src/usock/usock.h"
#include "src/sec/pmix_sec.h"

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

@ -1,13 +0,0 @@
#
# Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources += \
src/common/pmix_query.c \
src/common/pmix_strings.c \
src/common/pmix_log.c

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

@ -0,0 +1,15 @@
# -*- makefile -*-
#
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
sources += \
common/pmix_query.c \
common/pmix_strings.c \
common/pmix_log.c

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

@ -13,11 +13,11 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h>
#include <pmix.h>
#include <pmix/pmix_common.h>
#include <pmix_common.h>
#include <pmix_server.h>
#include "src/util/argv.h"

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

@ -13,11 +13,11 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h>
#include <pmix.h>
#include <pmix/pmix_common.h>
#include <pmix_common.h>
#include <pmix_server.h>
#include "src/util/argv.h"

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

@ -31,7 +31,7 @@
#include <stdlib.h>
#endif
#include <pmix/pmix_common.h>
#include <pmix_common.h>
#include "src/buffer_ops/internal.h"
#include "src/include/pmix_globals.h"

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

@ -1,16 +0,0 @@
# Copyright (c) 2015-2016 Mellanox Technologies, Inc.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
headers += \
src/dstore/pmix_dstore.h \
src/dstore/pmix_esh.h
sources += \
src/dstore/pmix_dstore.c \
src/dstore/pmix_esh.c

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

@ -1,73 +0,0 @@
/*
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <pmix/pmix_common.h>
#include "src/include/pmix_globals.h"
#include "pmix_dstore.h"
#include "pmix_esh.h"
/*
* Array of all possible DSTOREs
*/
/**** ENSURE THE FOLLOWING VALUE IS AT LEAST AS
**** LARGE AS THE TOTAL NUMBER OF SUPPORTED SPCs
**** IN THE ARRAY BELOW
*/
static pmix_dstore_base_module_t *all[] = {
&pmix_dstore_esh_module,
/* Always end the array with a NULL */
NULL
};
pmix_dstore_base_module_t pmix_dstore = {0};
int pmix_dstore_init(void)
{
pmix_dstore = *all[0];
if (!pmix_dstore.init) {
return PMIX_ERR_NOT_SUPPORTED;
}
return pmix_dstore.init();
}
void pmix_dstore_finalize(void)
{
if (!pmix_dstore.finalize) {
pmix_dstore.finalize();
}
return ;
}
int pmix_dstore_store(const char *nspace, int rank, pmix_kval_t *kv)
{
if (!pmix_dstore.store) {
return PMIX_ERR_NOT_SUPPORTED;
}
return pmix_dstore.store(nspace, rank, kv);
}
int pmix_dstore_fetch(const char *nspace, int rank, const char *key, pmix_value_t **kvs)
{
if (!pmix_dstore.fetch) {
return PMIX_ERR_NOT_SUPPORTED;
}
return pmix_dstore.fetch(nspace, rank, key, kvs);
}

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

@ -1,89 +0,0 @@
/*
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef PMIX_DSTORE_H
#define PMIX_DSTORE_H
#include <src/include/pmix_config.h>
#include <pmix/pmix_common.h>
#include "src/buffer_ops/buffer_ops.h"
BEGIN_C_DECLS
int pmix_dstore_init(void);
void pmix_dstore_finalize(void);
int pmix_dstore_store(const char *nspace,
int rank, pmix_kval_t *kv);
int pmix_dstore_fetch(const char *nspace, int rank,
const char *key, pmix_value_t **kvs);
/**
* Initialize the module. Returns an error if the module cannot
* run, success if it can and wants to be used.
*/
typedef int (*pmix_dstore_base_module_init_fn_t)(void);
/**
* Finalize the module. Tear down any allocated storage, disconnect
* from any system support.
*/
typedef int (*pmix_dstore_base_module_fini_fn_t)(void);
/**
* store key/value pair in datastore.
*
* @param nspace namespace string
*
* @param rank rank.
*
* @param kv key/value pair.
*
* @return PMIX_SUCCESS on success.
*/
typedef int (*pmix_dstore_base_module_store_fn_t)(const char *nspace,
pmix_rank_t rank,
pmix_kval_t *kv);
/**
* fetch value in datastore.
*
* @param nspace namespace string
*
* @param rank rank.
*
* @param key key.
*
* @return kvs(key/value pair) and PMIX_SUCCESS on success.
*/
typedef int (*pmix_dstrore_base_module_fetch_fn_t)(const char *nspace,
pmix_rank_t rank,
const char *key,
pmix_value_t **kvs);
/**
* structure for dstore modules
*/
typedef struct {
const char *name;
pmix_dstore_base_module_init_fn_t init;
pmix_dstore_base_module_fini_fn_t finalize;
pmix_dstore_base_module_store_fn_t store;
pmix_dstrore_base_module_fetch_fn_t fetch;
} pmix_dstore_base_module_t;
END_C_DECLS
#endif /* PMIX_DSTORE_H */

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

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

@ -1,83 +0,0 @@
/*
* Copyright (c) 2015-2016 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef PMIX_DSTORE_ESH_H
#define PMIX_DSTORE_ESH_H
#include <src/include/pmix_config.h>
#include "pmix_dstore.h"
#include "src/sm/pmix_sm.h"
BEGIN_C_DECLS
#define INITIAL_SEG_SIZE 4096
#define NS_META_SEG_SIZE (1<<22)
#define NS_DATA_SEG_SIZE (1<<22)
typedef enum {
INITIAL_SEGMENT,
NS_META_SEGMENT,
NS_DATA_SEGMENT
} segment_type;
/* initial segment format:
* size_t num_elems;
* int full; //indicate to client that it needs to attach to the next segment
* ns_seg_info_t ns_seg_info[max_ns_num];
*/
typedef struct {
char ns_name[PMIX_MAX_NSLEN+1];
size_t num_meta_seg;/* read by clients to attach to this number of segments. */
size_t num_data_seg;
} ns_seg_info_t;
/* meta segment format:
* size_t num_elems;
* rank_meta_info meta_info[max_meta_elems];
*/
typedef struct {
size_t rank;
size_t offset;
size_t count;
} rank_meta_info;
/* this structs are used to store information about
* shared segments addresses locally at each process,
* so they are common for different types of segments
* and don't have a specific content (namespace's info,
* rank's meta info, ranks's data). */
typedef struct seg_desc_t seg_desc_t;
struct seg_desc_t {
segment_type type;
pmix_sm_seg_t seg_info;
uint32_t id;
seg_desc_t *next;
};
typedef struct {
pmix_list_item_t super;
char ns_name[PMIX_MAX_NSLEN+1];
size_t num_meta_seg;
size_t num_data_seg;
seg_desc_t *meta_seg;
seg_desc_t *data_seg;
} ns_track_elem_t;
PMIX_CLASS_DECLARATION(ns_track_elem_t);
extern pmix_dstore_base_module_t pmix_dstore_esh_module;
END_C_DECLS
#endif /* PMIX_DSTORE_ESH_H */

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

@ -1,15 +0,0 @@
#
# Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
headers += \
src/event/pmix_event.h
sources += \
src/event/pmix_event_registration.c \
src/event/pmix_event_notification.c

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

@ -0,0 +1,16 @@
# -*- makefile -*-
#
# Copyright (c) 2016 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
headers += \
event/pmix_event.h
sources += \
event/pmix_event_notification.c \
event/pmix_event_registration.c

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

@ -22,9 +22,9 @@
#define PMIX_EVENT_H
#include <src/include/pmix_config.h>
#include <pmix/rename.h>
#include <src/include/rename.h>
#include <pmix/pmix_common.h>
#include <pmix_common.h>
#include "src/class/pmix_list.h"
#include "src/util/output.h"

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

@ -8,11 +8,11 @@
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <pmix/rename.h>
#include <src/include/rename.h>
#include <pmix.h>
#include <pmix/pmix_common.h>
#include <pmix_server.h>
#include "include/pmix.h"
#include "include/pmix_common.h"
#include "include/pmix_server.h"
#include "src/util/error.h"
#include "src/util/output.h"
@ -321,13 +321,20 @@ void pmix_invoke_local_event_hdlr(pmix_event_chain_t *chain)
pmix_single_event_t *sing;
pmix_multi_event_t *multi;
pmix_default_event_t *def;
pmix_status_t rc = PMIX_SUCCESS;
/* sanity check */
if (NULL == chain->info) {
/* should never happen as the return object must
* at least be there, even if it is NULL */
rc = PMIX_ERR_BAD_PARAM;
goto complete;
}
/* check for directives */
if (NULL != chain->info) {
for (i=0; i < chain->ninfo; i++) {
if (0 == strncmp(chain->info[i].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) {
chain->nondefault = true;
}
for (i=0; i < chain->ninfo; i++) {
if (0 == strncmp(chain->info[i].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) {
chain->nondefault = true;
}
}
@ -401,7 +408,7 @@ void pmix_invoke_local_event_hdlr(pmix_event_chain_t *chain)
complete:
/* we still have to call their final callback */
if (NULL != chain->final_cbfunc) {
chain->final_cbfunc(PMIX_SUCCESS, chain->final_cbdata);
chain->final_cbfunc(rc, chain->final_cbdata);
}
return;
}

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

@ -8,10 +8,10 @@
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <pmix/rename.h>
#include <src/include/rename.h>
#include <pmix.h>
#include <pmix/pmix_common.h>
#include <pmix_common.h>
#include <pmix_server.h>
#include "src/util/error.h"

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

@ -1,3 +1,4 @@
# -*- makefile -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
@ -9,9 +10,8 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# Copyright (c) 2007-2016 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -20,22 +20,29 @@
#
# This makefile.am does not stand on its own - it is included from
# src/Makefile.am
# Makefile.am
headers += \
src/include/pmix_globals.h
include/pmix_globals.h
sources += \
src/include/pmix_globals.c
include/pmix_globals.c
if ! PMIX_EMBEDDED_MODE
headers += \
src/include/pmix_config.h \
src/include/align.h \
src/include/hash_string.h \
src/include/pmix_socket_errno.h \
src/include/prefetch.h \
src/include/types.h
include/align.h \
include/hash_string.h \
include/pmix_socket_errno.h \
include/pmix_stdint.h \
include/prefetch.h \
include/types.h \
include/pmix_config_top.h \
include/pmix_config_bottom.h \
include/rename.h
#noinst_include_private_autogen_HEADERS =
endif ! PMIX_EMBEDDED_MODE
if WANT_INSTALL_HEADERS
headers += \
include/pmix_config.h
endif

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

@ -1,18 +0,0 @@
/*
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef PMIX_INCLUDE_CONFIG_H
#define PMIX_INCLUDE_CONFIG_H
#include <pmix/autogen/config.h>
#include <pmix/rename.h>
#endif /* PMIX_INCLUDE_CONFIG_H */

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

@ -0,0 +1,683 @@
/* src/include/pmix_config.h.in. Generated from configure.ac by autoheader. */
/* -*- c -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* This file is automatically generated by configure. Edits will be lost
* the next time you run configure!
*/
#ifndef PMIX_CONFIG_H
#define PMIX_CONFIG_H
#include <src/include/pmix_config_top.h>
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* Define to 1 if you have the <crt_externs.h> header file. */
#undef HAVE_CRT_EXTERNS_H
/* Define to 1 if you have the declaration of `AF_INET6', and to 0 if you
don't. */
#undef HAVE_DECL_AF_INET6
/* Define to 1 if you have the declaration of `AF_UNSPEC', and to 0 if you
don't. */
#undef HAVE_DECL_AF_UNSPEC
/* Define to 1 if you have the declaration of `PF_INET6', and to 0 if you
don't. */
#undef HAVE_DECL_PF_INET6
/* Define to 1 if you have the declaration of `PF_UNSPEC', and to 0 if you
don't. */
#undef HAVE_DECL_PF_UNSPEC
/* Define to 1 if you have the declaration of `__func__', and to 0 if you
don't. */
#undef HAVE_DECL___FUNC__
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <event.h> header file. */
#undef HAVE_EVENT_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `getpeereid' function. */
#undef HAVE_GETPEEREID
/* Define to 1 if you have the <hostLib.h> header file. */
#undef HAVE_HOSTLIB_H
/* Define to 1 if you have the <hwloc.h> header file. */
#undef HAVE_HWLOC_H
/* Define to 1 if the system has the type `int16_t'. */
#undef HAVE_INT16_T
/* Define to 1 if the system has the type `int32_t'. */
#undef HAVE_INT32_T
/* Define to 1 if the system has the type `int64_t'. */
#undef HAVE_INT64_T
/* Define to 1 if the system has the type `int8_t'. */
#undef HAVE_INT8_T
/* Define to 1 if the system has the type `intptr_t'. */
#undef HAVE_INTPTR_T
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <ioLib.h> header file. */
#undef HAVE_IOLIB_H
/* Define to 1 if you have the `event' library (-levent). */
#undef HAVE_LIBEVENT
/* Define to 1 if you have the `libevent_global_shutdown' function. */
#undef HAVE_LIBEVENT_GLOBAL_SHUTDOWN
/* Define to 1 if you have the `event_pthreads' library (-levent_pthreads). */
#undef HAVE_LIBEVENT_PTHREADS
/* Define to 1 if you have the <libgen.h> header file. */
#undef HAVE_LIBGEN_H
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if the system has the type `long long'. */
#undef HAVE_LONG_LONG
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <munge.h> header file. */
#undef HAVE_MUNGE_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the <net/uio.h> header file. */
#undef HAVE_NET_UIO_H
/* Define to 1 if the system has the type `ptrdiff_t'. */
#undef HAVE_PTRDIFF_T
/* Define to 1 if you have the <sasl/sasl.h> header file. */
#undef HAVE_SASL_SASL_H
/* Define to 1 if `si_band' is a member of `siginfo_t'. */
#undef HAVE_SIGINFO_T_SI_BAND
/* Define to 1 if `si_fd' is a member of `siginfo_t'. */
#undef HAVE_SIGINFO_T_SI_FD
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `socketpair' function. */
#undef HAVE_SOCKETPAIR
/* Define to 1 if the system has the type `socklen_t'. */
#undef HAVE_SOCKLEN_T
/* Define to 1 if you have the <sockLib.h> header file. */
#undef HAVE_SOCKLIB_H
/* Define to 1 if you have the `statfs' function. */
#undef HAVE_STATFS
/* Define to 1 if you have the `statvfs' function. */
#undef HAVE_STATVFS
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stdbool.h> header file. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strncpy_s' function. */
#undef HAVE_STRNCPY_S
/* Define to 1 if you have the `strnlen' function. */
#undef HAVE_STRNLEN
/* Define to 1 if you have the `strsignal' function. */
#undef HAVE_STRSIGNAL
/* Define to 1 if `d_type' is a member of `struct dirent'. */
#undef HAVE_STRUCT_DIRENT_D_TYPE
/* Define to 1 if the system has the type `struct sockaddr_in'. */
#undef HAVE_STRUCT_SOCKADDR_IN
/* Define to 1 if the system has the type `struct sockaddr_in6'. */
#undef HAVE_STRUCT_SOCKADDR_IN6
/* Define to 1 if `sa_len' is a member of `struct sockaddr'. */
#undef HAVE_STRUCT_SOCKADDR_SA_LEN
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#undef HAVE_STRUCT_SOCKADDR_STORAGE
/* Define to 1 if the system has the type `struct sockaddr_un'. */
#undef HAVE_STRUCT_SOCKADDR_UN
/* Define to 1 if `uid' is a member of `struct sockpeercred'. */
#undef HAVE_STRUCT_SOCKPEERCRED_UID
/* Define to 1 if `f_fstypename' is a member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_FSTYPENAME
/* Define to 1 if `f_type' is a member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_TYPE
/* Define to 1 if `f_basetype' is a member of `struct statvfs'. */
#undef HAVE_STRUCT_STATVFS_F_BASETYPE
/* Define to 1 if `f_fstypename' is a member of `struct statvfs'. */
#undef HAVE_STRUCT_STATVFS_F_FSTYPENAME
/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
#undef HAVE_STRUCT_UCRED_CR_UID
/* Define to 1 if `uid' is a member of `struct ucred'. */
#undef HAVE_STRUCT_UCRED_UID
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/statfs.h> header file. */
#undef HAVE_SYS_STATFS_H
/* Define to 1 if you have the <sys/statvfs.h> header file. */
#undef HAVE_SYS_STATVFS_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
/* Define to 1 if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H
/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define to 1 if the system has the type `uint16_t'. */
#undef HAVE_UINT16_T
/* Define to 1 if the system has the type `uint32_t'. */
#undef HAVE_UINT32_T
/* Define to 1 if the system has the type `uint64_t'. */
#undef HAVE_UINT64_T
/* Define to 1 if the system has the type `uint8_t'. */
#undef HAVE_UINT8_T
/* Define to 1 if the system has the type `uintptr_t'. */
#undef HAVE_UINTPTR_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* whether unix byteswap routines -- htonl, htons, nothl, ntohs -- are
available */
#undef HAVE_UNIX_BYTESWAP
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Alignment of type bool */
#undef PMIX_ALIGNMENT_BOOL
/* Alignment of type char */
#undef PMIX_ALIGNMENT_CHAR
/* Alignment of type double */
#undef PMIX_ALIGNMENT_DOUBLE
/* Alignment of type float */
#undef PMIX_ALIGNMENT_FLOAT
/* Alignment of type int */
#undef PMIX_ALIGNMENT_INT
/* Alignment of type int16_t */
#undef PMIX_ALIGNMENT_INT16
/* Alignment of type int32_t */
#undef PMIX_ALIGNMENT_INT32
/* Alignment of type int64_t */
#undef PMIX_ALIGNMENT_INT64
/* Alignment of type int8_t */
#undef PMIX_ALIGNMENT_INT8
/* Alignment of type long */
#undef PMIX_ALIGNMENT_LONG
/* Alignment of type long double */
#undef PMIX_ALIGNMENT_LONG_DOUBLE
/* Alignment of type long long */
#undef PMIX_ALIGNMENT_LONG_LONG
/* Alignment of type short */
#undef PMIX_ALIGNMENT_SHORT
/* Alignment of type size_t */
#undef PMIX_ALIGNMENT_SIZE_T
/* Alignment of type void * */
#undef PMIX_ALIGNMENT_VOID_P
/* Alignment of type wchar_t */
#undef PMIX_ALIGNMENT_WCHAR
/* The compiler $lower which PMIx was built with */
#undef PMIX_BUILD_PLATFORM_COMPILER_FAMILYID
/* The compiler $lower which PMIX was built with */
#undef PMIX_BUILD_PLATFORM_COMPILER_FAMILYNAME
/* The compiler $lower which PMIx was built with */
#undef PMIX_BUILD_PLATFORM_COMPILER_VERSION
/* The compiler $lower which PMIX was built with */
#undef PMIX_BUILD_PLATFORM_COMPILER_VERSION_STR
/* PMIx underlying C compiler */
#undef PMIX_CC
/* Use static const char[] strings for C files */
#undef PMIX_CC_USE_CONST_CHAR_IDENT
/* Use #ident strings for C files */
#undef PMIX_CC_USE_IDENT
/* Use #pragma comment for C files */
#undef PMIX_CC_USE_PRAGMA_COMMENT
/* Use #pragma ident strings for C files */
#undef PMIX_CC_USE_PRAGMA_IDENT
/* Whether C compiler supports __builtin_clz */
#undef PMIX_C_HAVE_BUILTIN_CLZ
/* Whether C compiler supports __builtin_expect */
#undef PMIX_C_HAVE_BUILTIN_EXPECT
/* Whether C compiler supports __builtin_prefetch */
#undef PMIX_C_HAVE_BUILTIN_PREFETCH
/* Whether C compiler supports symbol visibility or not */
#undef PMIX_C_HAVE_VISIBILITY
/* Whether we are in debugging mode or not */
#undef PMIX_ENABLE_DEBUG
/* Whether we want developer-level timing support or not */
#undef PMIX_ENABLE_TIMING
/* Location of event2/thread.h */
#undef PMIX_EVENT2_THREAD_HEADER
/* Location of event.h */
#undef PMIX_EVENT_HEADER
/* Whether your compiler has __attribute__ or not */
#undef PMIX_HAVE_ATTRIBUTE
/* Whether your compiler has __attribute__ aligned or not */
#undef PMIX_HAVE_ATTRIBUTE_ALIGNED
/* Whether your compiler has __attribute__ always_inline or not */
#undef PMIX_HAVE_ATTRIBUTE_ALWAYS_INLINE
/* Whether your compiler has __attribute__ cold or not */
#undef PMIX_HAVE_ATTRIBUTE_COLD
/* Whether your compiler has __attribute__ const or not */
#undef PMIX_HAVE_ATTRIBUTE_CONST
/* Whether your compiler has __attribute__ deprecated or not */
#undef PMIX_HAVE_ATTRIBUTE_DEPRECATED
/* Whether your compiler has __attribute__ deprecated with optional argument
*/
#undef PMIX_HAVE_ATTRIBUTE_DEPRECATED_ARGUMENT
/* Whether your compiler has __attribute__ destructor or not */
#undef PMIX_HAVE_ATTRIBUTE_DESTRUCTOR
/* Whether your compiler has __attribute__ format or not */
#undef PMIX_HAVE_ATTRIBUTE_FORMAT
/* Whether your compiler has __attribute__ format and it works on function
pointers */
#undef PMIX_HAVE_ATTRIBUTE_FORMAT_FUNCPTR
/* Whether your compiler has __attribute__ hot or not */
#undef PMIX_HAVE_ATTRIBUTE_HOT
/* Whether your compiler has __attribute__ malloc or not */
#undef PMIX_HAVE_ATTRIBUTE_MALLOC
/* Whether your compiler has __attribute__ may_alias or not */
#undef PMIX_HAVE_ATTRIBUTE_MAY_ALIAS
/* Whether your compiler has __attribute__ nonnull or not */
#undef PMIX_HAVE_ATTRIBUTE_NONNULL
/* Whether your compiler has __attribute__ noreturn or not */
#undef PMIX_HAVE_ATTRIBUTE_NORETURN
/* Whether your compiler has __attribute__ noreturn and it works on function
pointers */
#undef PMIX_HAVE_ATTRIBUTE_NORETURN_FUNCPTR
/* Whether your compiler has __attribute__ no_instrument_function or not */
#undef PMIX_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION
/* Whether your compiler has __attribute__ packed or not */
#undef PMIX_HAVE_ATTRIBUTE_PACKED
/* Whether your compiler has __attribute__ pure or not */
#undef PMIX_HAVE_ATTRIBUTE_PURE
/* Whether your compiler has __attribute__ sentinel or not */
#undef PMIX_HAVE_ATTRIBUTE_SENTINEL
/* Whether your compiler has __attribute__ unused or not */
#undef PMIX_HAVE_ATTRIBUTE_UNUSED
/* Whether your compiler has __attribute__ visibility or not */
#undef PMIX_HAVE_ATTRIBUTE_VISIBILITY
/* Whether your compiler has __attribute__ warn unused result or not */
#undef PMIX_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT
/* Whether your compiler has __attribute__ weak alias or not */
#undef PMIX_HAVE_ATTRIBUTE_WEAK_ALIAS
/* whether qsort is broken or not */
#undef PMIX_HAVE_BROKEN_QSORT
/* whether ceil is found and available */
#undef PMIX_HAVE_CEIL
/* whether dirname is found and available */
#undef PMIX_HAVE_DIRNAME
/* Whether we have hwloc support or not */
#undef PMIX_HAVE_HWLOC
/* Whether the PMIX PDL framework is functional or not */
#undef PMIX_HAVE_PDL_SUPPORT
/* Whether we have sasl support or not */
#undef PMIX_HAVE_SASL
/* Whether we have SA_RESTART in <signal.h> or not */
#undef PMIX_HAVE_SA_RESTART
/* whether socket is found and available */
#undef PMIX_HAVE_SOCKET
/* Whether we have __va_copy or not */
#undef PMIX_HAVE_UNDERSCORE_VA_COPY
/* Whether we have va_copy or not */
#undef PMIX_HAVE_VA_COPY
/* Location of hwloc.h */
#undef PMIX_HWLOC_HEADER
/* ident string for PMIX */
#undef PMIX_IDENT_STRING
/* The library major version is always available, contrary to VERSION */
#undef PMIX_MAJOR_VERSION
/* The library minor version is always available, contrary to VERSION */
#undef PMIX_MINOR_VERSION
/* Whether the C compiler supports "bool" without any other help (such as
<stdbool.h>) */
#undef PMIX_NEED_C_BOOL
/* Whether libraries can be configured with destructor functions */
#undef PMIX_NO_LIB_DESTRUCTOR
/* type to use for ptrdiff_t */
#undef PMIX_PTRDIFF_TYPE
/* The library release version is always available, contrary to VERSION */
#undef PMIX_RELEASE_VERSION
/* The pmix symbol rename include directive */
#undef PMIX_SYMBOL_RENAME
/* Whether to use <stdbool.h> or not */
#undef PMIX_USE_STDBOOL_H
/* The library version is always available, contrary to VERSION */
#undef PMIX_VERSION
/* Enable per-user config files */
#undef PMIX_WANT_HOME_CONFIG_FILES
/* Whether we want munge support or not */
#undef PMIX_WANT_MUNGE
/* if want pretty-print stack trace feature */
#undef PMIX_WANT_PRETTY_PRINT_STACKTRACE
/* The size of `char', as computed by sizeof. */
#undef SIZEOF_CHAR
/* The size of `double', as computed by sizeof. */
#undef SIZEOF_DOUBLE
/* The size of `float', as computed by sizeof. */
#undef SIZEOF_FLOAT
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* The size of `pid_t', as computed by sizeof. */
#undef SIZEOF_PID_T
/* The size of `ptrdiff_t', as computed by sizeof. */
#undef SIZEOF_PTRDIFF_T
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
/* The size of `ssize_t', as computed by sizeof. */
#undef SIZEOF_SSIZE_T
/* The size of `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
/* The size of `wchar_t', as computed by sizeof. */
#undef SIZEOF_WCHAR_T
/* The size of `_Bool', as computed by sizeof. */
#undef SIZEOF__BOOL
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
#include <src/include/pmix_config_bottom.h>
#endif /* PMIX_CONFIG_H */

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

@ -343,27 +343,15 @@
# define __pmix_attribute_destructor__
#endif
#ifndef PMIX_DECLSPEC
# define PMIX_DECLSPEC
#ifdef PMIX_C_HAVE_VISIBILITY
# if PMIX_C_HAVE_VISIBILITY
# define PMIX_EXPORT __attribute__((__visibility__("default")))
# define PMIX_EXPORT __pmix_attribute_visibility__("default")
# else
# define PMIX_EXPORT
# endif
#else
# define PMIX_EXPORT
#endif
#endif
#ifndef PMIX_DECLSPEC
#define PMIX_DECLSPEC
# if PMIX_C_HAVE_VISIBILITY
# define PMIX_EXPORT __pmix_attribute_visibility__("default")
# else
# define PMIX_EXPORT
# endif
#endif
/*
* Do we have <stdint.h>?
@ -375,10 +363,10 @@
including stdint.h */
#define __STDC_LIMIT_MACROS
#endif
#include <pmix/autogen/config.h>
#include <src/include/pmix_config.h>
#include <stdint.h>
#else
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#endif
/***********************************************************************

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

@ -18,7 +18,7 @@
#include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix/autogen/pmix_stdint.h>
#include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h>
#include "src/include/pmix_globals.h"

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

@ -30,7 +30,7 @@
#endif
#include PMIX_EVENT_HEADER
#include <pmix/pmix_common.h>
#include <pmix_common.h>
#include "src/buffer_ops/types.h"
#include "src/class/pmix_hash_table.h"
@ -82,6 +82,14 @@ typedef enum {
PMIX_COLLECT_MAX
} pmix_collect_t;
/* define a process type */
typedef enum {
PMIX_PROC_UNDEF,
PMIX_PROC_CLIENT,
PMIX_PROC_SERVER,
PMIX_PROC_TOOL
} pmix_proc_type_t;
/**** MESSAGING STRUCTURES ****/
/* header for messages */

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

@ -0,0 +1,14 @@
/*
* Copyright (c) 2016 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef PMIX_RENAME_H
#define PMIX_RENAME_H
#endif

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

@ -215,7 +215,47 @@ static inline uint64_t pmix_swap_bytes8(uint64_t val)
#define pmix_swap_bytes8 hton64
#endif /* WORDS_BIGENDIAN || !HAVE_UNIX_BYTESWAP */
#define PMIX_EV_TIMEOUT EV_TIMEOUT
#define PMIX_EV_READ EV_READ
#define PMIX_EV_WRITE EV_WRITE
#define PMIX_EV_SIGNAL EV_SIGNAL
/* Persistent event: won't get removed automatically when activated. */
#define PMIX_EV_PERSIST EV_PERSIST
#define PMIX_EVLOOP_ONCE EVLOOP_ONCE /**< Block at most once. */
#define PMIX_EVLOOP_NONBLOCK EVLOOP_NONBLOCK /**< Do not block. */
typedef struct event_base pmix_event_base_t;
typedef struct event pmix_event_t;
#define pmix_event_base_create() event_base_new()
#define pmix_event_base_free(b) event_base_free(b)
#define pmix_event_base_loopbreak(b) event_base_loopbreak(b)
#define pmix_event_base_loopexit(b) event_base_loopexit(b, NULL)
/* thread support APIs */
#define pmix_event_use_threads() evthread_use_pthreads()
/* Basic event APIs */
#define pmix_event_enable_debug_mode() event_enable_debug_mode()
#define pmix_event_set(b, x, fd, fg, cb, arg) event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg))
#define pmix_event_add(ev, tv) event_add((ev), (tv))
#define pmix_event_del(ev) event_del((ev))
#define pmix_event_active(x, y, z) event_active((x), (y), (z))
#define pmix_event_new(b, fd, fg, cb, arg) event_new((b), (fd), (fg), (event_callback_fn) (cb), (arg))
#define pmix_event_loop(b, fg) event_base_loop((b), (fg))
#ifdef HAVE_LIBEVENT_GLOBAL_SHUTDOWN
#define pmix_libevent_global_shutdown() libevent_global_shutdown()
#endif
#endif /* PMIX_TYPES_H */

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

@ -0,0 +1,26 @@
# -*- makefile -*-
#
# 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) 2016 Intel, Inc. All rights reserved.
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This makefile.am does not stand on its own - it is included from src/Makefile.am
# Source code files
headers += \
mca/mca.h

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

@ -0,0 +1,66 @@
#
# 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) 2010-2016 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Need this so that the base knows where to load dynamic components from
# (by default)
AM_CPPFLAGS = \
$(LTDLINCL)
noinst_LTLIBRARIES = libpmix_mca_base.la
dist_pmixdata_DATA = help-mca-base.txt help-mca-var.txt
# Source code files
headers = \
base.h \
pmix_mca_base_component_repository.h \
pmix_mca_base_var.h \
pmix_mca_base_var_enum.h \
pmix_mca_base_var_group.h \
pmix_mca_base_vari.h \
pmix_mca_base_framework.h
# Library
libpmix_mca_base_la_SOURCES = \
$(headers) \
pmix_mca_base_close.c \
pmix_mca_base_component_compare.c \
pmix_mca_base_component_find.c \
pmix_mca_base_component_repository.c \
pmix_mca_base_components_open.c \
pmix_mca_base_components_close.c \
pmix_mca_base_components_select.c \
pmix_mca_base_list.c \
pmix_mca_base_open.c \
pmix_mca_base_var.c \
pmix_mca_base_var_enum.c \
pmix_mca_base_var_group.c \
pmix_mca_base_parse_paramfile.c \
pmix_mca_base_components_register.c \
pmix_mca_base_framework.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
pmixdir = $(pmixincludedir)/$(subdir)
pmix_HEADERS = $(headers)
endif

246
opal/mca/pmix/pmix2x/pmix/src/mca/base/base.h Обычный файл
Просмотреть файл

@ -0,0 +1,246 @@
/* -*- 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-2007 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) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef MCA_BASE_H
#define MCA_BASE_H
#include <src/include/pmix_config.h>
#include "src/class/pmix_object.h"
#include "src/class/pmix_list.h"
/*
* These units are large enough to warrant their own .h files
*/
#include "src/mca/mca.h"
#include "src/mca/base/pmix_mca_base_var.h"
#include "src/mca/base/pmix_mca_base_framework.h"
#include "src/util/output.h"
BEGIN_C_DECLS
/*
* Structure for making plain lists of components
*/
struct pmix_mca_base_component_list_item_t {
pmix_list_item_t super;
const pmix_mca_base_component_t *cli_component;
};
typedef struct pmix_mca_base_component_list_item_t pmix_mca_base_component_list_item_t;
PMIX_CLASS_DECLARATION(pmix_mca_base_component_list_item_t);
/*
* Structure for making priority lists of components
*/
struct pmix_mca_base_component_priority_list_item_t {
pmix_mca_base_component_list_item_t super;
int cpli_priority;
};
typedef struct pmix_mca_base_component_priority_list_item_t
pmix_mca_base_component_priority_list_item_t;
PMIX_CLASS_DECLARATION(pmix_mca_base_component_priority_list_item_t);
/*
* Public variables
*/
extern char *pmix_mca_base_component_path;
extern bool pmix_mca_base_component_show_load_errors;
extern bool pmix_mca_base_component_disable_dlopen;
extern char *pmix_mca_base_system_default_path;
extern char *pmix_mca_base_user_default_path;
/*
* Standard verbosity levels
*/
enum {
/** total silence */
PMIX_MCA_BASE_VERBOSE_NONE = -1,
/** only errors are printed */
PMIX_MCA_BASE_VERBOSE_ERROR = 0,
/** emit messages about component selection, open, and unloading */
PMIX_MCA_BASE_VERBOSE_COMPONENT = 10,
/** also emit warnings */
PMIX_MCA_BASE_VERBOSE_WARN = 20,
/** also emit general, user-relevant information, such as rationale as to why certain choices
* or code paths were taken, information gleaned from probing the local system, etc. */
PMIX_MCA_BASE_VERBOSE_INFO = 40,
/** also emit relevant tracing information (e.g., which functions were invoked /
* call stack entry/exit info) */
PMIX_MCA_BASE_VERBOSE_TRACE = 60,
/** also emit PMIX-developer-level (i.e,. highly detailed) information */
PMIX_MCA_BASE_VERBOSE_DEBUG = 80,
/** also output anything else that might be useful */
PMIX_MCA_BASE_VERBOSE_MAX = 100,
};
/*
* Public functions
*/
/**
* First function called in the MCA.
*
* @return PMIX_SUCCESS Upon success
* @return PMIX_ERROR Upon failure
*
* This function starts up the entire MCA. It initializes a bunch
* of built-in MCA parameters, and initialized the MCA component
* repository.
*
* It must be the first MCA function invoked. It is normally
* invoked during the initialization stage and specifically
* invoked in the special case of the *_info command.
*/
int pmix_mca_base_open(void);
/**
* Last function called in the MCA
*
* @return PMIX_SUCCESS Upon success
* @return PMIX_ERROR Upon failure
*
* This function closes down the entire MCA. It clears all MCA
* parameters and closes down the MCA component respository.
*
* It must be the last MCA function invoked. It is normally invoked
* during the finalize stage.
*/
int pmix_mca_base_close(void);
/**
* A generic select function
*
*/
int pmix_mca_base_select(const char *type_name, int output_id,
pmix_list_t *components_available,
pmix_mca_base_module_t **best_module,
pmix_mca_base_component_t **best_component,
int *priority_out);
/**
* A function for component query functions to discover if they have
* been explicitly required to or requested to be selected.
*
* exclusive: If the specified component is the only component that is
* available for selection.
*
*/
int pmix_mca_base_is_component_required(pmix_list_t *components_available,
pmix_mca_base_component_t *component,
bool exclusive,
bool *is_required);
/* pmix_mca_base_component_compare.c */
int pmix_mca_base_component_compare_priority(pmix_mca_base_component_priority_list_item_t *a,
pmix_mca_base_component_priority_list_item_t *b);
int pmix_mca_base_component_compare(const pmix_mca_base_component_t *a,
const pmix_mca_base_component_t *b);
int pmix_mca_base_component_compatible(const pmix_mca_base_component_t *a,
const pmix_mca_base_component_t *b);
char * pmix_mca_base_component_to_string(const pmix_mca_base_component_t *a);
/* pmix_mca_base_component_find.c */
int pmix_mca_base_component_find (const char *directory, pmix_mca_base_framework_t *framework,
bool ignore_requested, bool open_dso_components);
/**
* Parse the requested component string and return an pmix_argv of the requested
* (or not requested) components.
*/
int pmix_mca_base_component_parse_requested (const char *requested, bool *include_mode,
char ***requested_component_names);
/**
* Filter a list of components based on a comma-delimted list of names and/or
* a set of meta-data flags.
*
* @param[in,out] components List of components to filter
* @param[in] output_id Output id to write to for error/warning/debug messages
* @param[in] filter_names Comma delimited list of components to use. Negate with ^.
* May be NULL.
* @param[in] filter_flags Metadata flags components are required to have set (CR ready)
*
* @returns PMIX_SUCCESS On success
* @returns PMIX_ERR_NOT_FOUND If some component in {filter_names} is not found in
* {components}. Does not apply to negated filters.
* @returns pmix error code On other error.
*
* This function closes and releases any components that do not match the filter_name and
* filter flags.
*/
int pmix_mca_base_components_filter (pmix_mca_base_framework_t *framework, uint32_t filter_flags);
/* Safely release some memory allocated by pmix_mca_base_component_find()
(i.e., is safe to call even if you never called
pmix_mca_base_component_find()). */
int pmix_mca_base_component_find_finalize(void);
/* pmix_mca_base_components_register.c */
int pmix_mca_base_framework_components_register (struct pmix_mca_base_framework_t *framework,
pmix_mca_base_register_flag_t flags);
/* pmix_mca_base_components_open.c */
int pmix_mca_base_framework_components_open (struct pmix_mca_base_framework_t *framework,
pmix_mca_base_open_flag_t flags);
int pmix_mca_base_components_open(const char *type_name, int output_id,
const pmix_mca_base_component_t **static_components,
pmix_list_t *components_available,
bool open_dso_components);
/* pmix_mca_base_components_close.c */
/**
* Close and release a component.
*
* @param[in] component Component to close
* @param[in] output_id Output id for debugging output
*
* After calling this function the component may no longer be used.
*/
void pmix_mca_base_component_close (const pmix_mca_base_component_t *component, int output_id);
/**
* Release a component without closing it.
* @param[in] component Component to close
* @param[in] output_id Output id for debugging output
*
* After calling this function the component may no longer be used.
*/
void pmix_mca_base_component_unload (const pmix_mca_base_component_t *component, int output_id);
int pmix_mca_base_components_close(int output_id, pmix_list_t *components_available,
const pmix_mca_base_component_t *skip);
int pmix_mca_base_framework_components_close (struct pmix_mca_base_framework_t *framework,
const pmix_mca_base_component_t *skip);
END_C_DECLS
#endif /* MCA_BASE_H */

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

@ -0,0 +1,61 @@
# -*- text -*-
#
# 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-2014 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is the US/English help file for PMIX MCA error messages.
#
[find-available:not-valid]
A requested component was not found, or was unable to be opened. This
means that this component is either not installed or is unable to be
used on your system (e.g., sometimes this means that shared libraries
that the component requires are unable to be found/loaded). Note that
PMIX stopped checking at the first component that it did not find.
Host: %s
Framework: %s
Component: %s
#
[find-available:none found]
No components were able to be opened in the %s framework.
This typically means that either no components of this type were
installed, or none of the installed componnets can be loaded.
Sometimes this means that shared libraries required by these
components are unable to be found/loaded.
Host: %s
Framework: %s
#
[framework-param:too-many-negates]
MCA framework parameters can only take a single negation operator
("^"), and it must be at the beginning of the value. The following
value violates this rule:
%s
When used, the negation operator sets the "exclusive" behavior mode,
meaning that it will exclude all specified components (and implicitly
include all others). If the negation operator is not specified, the
"inclusive" mode is assumed, meaning that all specified components
will be included (and implicitly exclude all others).
For example, "^a,b" specifies the exclusive behavior and means "use
all components *except* a and b", while "c,d" specifies the inclusive
behavior and means "use *only* components c and d."
You cannot mix inclusive and exclusive behavior.

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

@ -0,0 +1,139 @@
# -*- text -*-
#
# 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-2011 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is the US/English help file for PMIX MCA error messages.
#
[invalid-flag-combination]
ERROR: An invalid combination of flags was passed to pmix_mca_base_var_register.
Variable: %s
Flags: %s %s
#
[default-only-param-set]
WARNING: A user-supplied value attempted to override the default-only MCA
variable named "%s".
The user-supplied value was ignored.
#
[missing-param-file]
Process %d Unable to locate the variable file "%s" in the following search path:
%s
#
[deprecated-mca-env]
A deprecated MCA variable value was specified in the environment or
on the command line. Deprecated MCA variables should be avoided;
they may disappear in future releases.
Deprecated variable: %s
New variable: %s
#
[deprecated-mca-cli]
A deprecated MCA variable value was specified on the command line. Deprecated
MCA variables should be avoided; they may disappear in future releases.
Deprecated variable: %s
New variable: %s
#
[deprecated-mca-file]
A deprecated MCA variable value was specified in an MCA variable
file. Deprecated MCA variables should be avoided; they may disappear
in future releases.
Deprecated variable: %s
Source file: %s
New variable: %s
#
[mutually-exclusive-vars]
Two mutually-exclusive MCA variables were specified. This can result
in undefined behavior, such as ignoring the components that the MCA
variables are supposed to affect.
1st MCA variable: %s
Source of value: %s
2nd MCA variable: %s
Source of value: %s
#
[re-register-with-different-type]
An MCA variable was re-registered with a different type (i.e., it was
either originally registered as an INT and re-registered as a STRING,
or it was originially registered as a STRING and re-registered as an
INT). This a developer error; your job may abort.
MCA variable name: %s
#
[var-name-conflict]
A name collision was detected on an MCA variable name. This can happen
if two components try to register the same variable with slightly
different name components. The conflicting variables are listed below:
MCA variable name: %s
New name: %s %s %s
Existing name: %s %s %s
#
[overridden-param-set]
WARNING: A user-supplied value attempted to set a variable that is set
in the override variable file (pmix-mca-params-override.conf).
Variable: %s
The user-supplied value was ignored.
#
[invalid-value]
An invalid value was supplied for an MCA variable.
Variable : %s
Value : %s
#
[invalid-value-enum]
An invalid value was supplied for an enum variable.
Variable : %s
Value : %s
Valid values : %s
#
[environment-only-param]
WARNING: The special MCA parameter "%s" was set in
an unexpected way, and is likely not working the way you want it to.
Specifically, this MCA parameter is "special" in that it can *only* be
set in the environment. Setting this value in a file -- and sometimes
even on the command line -- will not work as intended. The *only* way
to set this value is to set "PMIX_MCA_%s" in the environment before
starting your job.
Value: %s
Source: %s
#
[incorrect-env-list-param]
WARNING: The format of "pmix_mca_base_env_list" parameter is a delimited list of VAR=VAL or
VAR instances. By default, the delimiter is a semicolon: VAR1=VAL1;VAR2;VAR3=VAL3;...
You can set other via "pmix_mca_base_env_list_delimiter" parameter. If the delimiter is a
semicolon, the value of "pmix_mca_base_env_list" variable should be quoted to not interfere
with SHELL command line parsing. In the case where a value is not assigned to variable
VAR, the value will be taken from the current environment.
The following environment variable was not found in the environment:
Variable: %s
MCA variable value: %s
#
[incorrect-env-list-sep]
An invalid value was supplied for an MCA variable "pmix_mca_base_env_list_delimiter".
The "pmix_mca_base_env_list" variable will be ignored.
Value: %s

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

@ -0,0 +1,68 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* 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) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include "src/util/output.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_component_repository.h"
#include "pmix_common.h"
extern int pmix_mca_base_opened;
/*
* Main MCA shutdown.
*/
int pmix_mca_base_close(void)
{
assert (pmix_mca_base_opened);
if (!--pmix_mca_base_opened) {
/* deregister all MCA base parameters */
int group_id = pmix_mca_base_var_group_find ("pmix", "mca", "base");
if (-1 < group_id) {
pmix_mca_base_var_group_deregister (group_id);
}
/* release the default paths */
if (NULL != pmix_mca_base_system_default_path) {
free(pmix_mca_base_system_default_path);
}
if (NULL != pmix_mca_base_user_default_path) {
free(pmix_mca_base_user_default_path);
}
/* Close down the component repository */
pmix_mca_base_component_repository_finalize();
/* Shut down the dynamic component finder */
pmix_mca_base_component_find_finalize();
/* Close pmix output stream 0 */
pmix_output_close(0);
}
/* All done */
return PMIX_SUCCESS;
}

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

@ -0,0 +1,152 @@
/*
* 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) 2016 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <string.h>
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
/*
* Function for comparing two pmix_mca_base_component_priority_t structs so
* that we can build prioritized listss of them. This assumed that
* the types of the modules are the same. Sort first by priority,
* second by module name, third by module version.
*
* Note that we acutally want a *reverse* ordering here -- the al_*
* functions will put "smaller" items at the head, and "larger" items
* at the tail. Since we want the highest priority at the head, it
* may help the gentle reader to consider this an inverse comparison.
* :-)
*/
int
pmix_mca_base_component_compare_priority(pmix_mca_base_component_priority_list_item_t *a,
pmix_mca_base_component_priority_list_item_t *b)
{
/* First, compare the priorties */
if (a->cpli_priority > b->cpli_priority) {
return -1;
} else if (a->cpli_priority < b->cpli_priority) {
return 1;
} else {
return pmix_mca_base_component_compare(a->super.cli_component,
b->super.cli_component);
}
}
int pmix_mca_base_component_compare(const pmix_mca_base_component_t* aa,
const pmix_mca_base_component_t* bb)
{
int val;
val = strncmp(aa->pmix_mca_type_name, bb->pmix_mca_type_name,
PMIX_MCA_BASE_MAX_TYPE_NAME_LEN);
if (val != 0) {
return -val;
}
val = strncmp(aa->pmix_mca_component_name, bb->pmix_mca_component_name,
PMIX_MCA_BASE_MAX_COMPONENT_NAME_LEN);
if (val != 0) {
return -val;
}
/* The names were equal, so compare the versions */
if (aa->pmix_mca_component_major_version >
bb->pmix_mca_component_major_version) {
return -1;
} else if (aa->pmix_mca_component_major_version <
bb->pmix_mca_component_major_version) {
return 1;
} else if (aa->pmix_mca_component_minor_version >
bb->pmix_mca_component_minor_version) {
return -1;
} else if (aa->pmix_mca_component_minor_version <
bb->pmix_mca_component_minor_version) {
return 1;
} else if (aa->pmix_mca_component_release_version >
bb->pmix_mca_component_release_version) {
return -1;
} else if (aa->pmix_mca_component_release_version <
bb->pmix_mca_component_release_version) {
return 1;
}
return 0;
}
/**
* compare but exclude the release version - declare compatible
* if the major/minor version are the same.
*/
int pmix_mca_base_component_compatible(const pmix_mca_base_component_t* aa,
const pmix_mca_base_component_t* bb)
{
int val;
val = strncmp(aa->pmix_mca_type_name, bb->pmix_mca_type_name,
PMIX_MCA_BASE_MAX_TYPE_NAME_LEN);
if (val != 0) {
return -val;
}
val = strncmp(aa->pmix_mca_component_name, bb->pmix_mca_component_name,
PMIX_MCA_BASE_MAX_COMPONENT_NAME_LEN);
if (val != 0) {
return -val;
}
/* The names were equal, so compare the versions */
if (aa->pmix_mca_component_major_version >
bb->pmix_mca_component_major_version) {
return -1;
} else if (aa->pmix_mca_component_major_version <
bb->pmix_mca_component_major_version) {
return 1;
} else if (aa->pmix_mca_component_minor_version >
bb->pmix_mca_component_minor_version) {
return -1;
} else if (aa->pmix_mca_component_minor_version <
bb->pmix_mca_component_minor_version) {
return 1;
}
return 0;
}
/**
* Returns a string which represents the component name and version.
* Has the form: comp_type.comp_name.major_version.minor_version
*/
char * pmix_mca_base_component_to_string(const pmix_mca_base_component_t *a) {
char * str = NULL;
if(0 > asprintf(&str, "%s.%s.%d.%d", a->pmix_mca_type_name,
a->pmix_mca_component_name, a->pmix_mca_component_major_version,
a->pmix_mca_component_minor_version)) {
return NULL;
}
return str;
}

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

@ -0,0 +1,389 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2007 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) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#include "src/mca/pinstalldirs/pinstalldirs.h"
#include "src/util/pmix_environ.h"
#include "src/util/output.h"
#include "src/util/argv.h"
#include "src/util/show_help.h"
#include "src/class/pmix_list.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_component_repository.h"
#include "pmix_common.h"
#include "src/mca/pdl/base/base.h"
#if PMIX_HAVE_PDL_SUPPORT
/*
* Private functions
*/
static void find_dyn_components(const char *path, pmix_mca_base_framework_t *framework,
const char **names, bool include_mode);
#endif /* PMIX_HAVE_PDL_SUPPORT */
static int component_find_check (pmix_mca_base_framework_t *framework, char **requested_component_names);
/*
* Dummy structure for casting for open_only logic
*/
struct pmix_mca_base_open_only_dummy_component_t {
/** MCA base component */
pmix_mca_base_component_t version;
/** MCA base data */
pmix_mca_base_component_data_t data;
};
typedef struct pmix_mca_base_open_only_dummy_component_t pmix_mca_base_open_only_dummy_component_t;
static char negate[] = "^";
static bool use_component(const bool include_mode,
const char **requested_component_names,
const char *component_name);
/*
* Function to find as many components of a given type as possible. This
* includes statically-linked in components as well as opening up a
* directory and looking for shared-library MCA components of the
* appropriate type (load them if available).
*
* Return one consolidated array of (pmix_mca_base_component_t*) pointing to all
* available components.
*/
int pmix_mca_base_component_find (const char *directory, pmix_mca_base_framework_t *framework,
bool ignore_requested, bool open_dso_components)
{
const pmix_mca_base_component_t **static_components = framework->framework_static_components;
char **requested_component_names = NULL;
pmix_mca_base_component_list_item_t *cli;
bool include_mode = true;
int ret;
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, framework->framework_output,
"mca: base: component_find: searching %s for %s components",
directory, framework->framework_name);
if (!ignore_requested) {
ret = pmix_mca_base_component_parse_requested (framework->framework_selection, &include_mode,
&requested_component_names);
if (PMIX_SUCCESS != ret) {
return ret;
}
}
/* Find all the components that were statically linked in */
if (static_components) {
for (int i = 0 ; NULL != static_components[i]; ++i) {
if ( use_component(include_mode,
(const char**)requested_component_names,
static_components[i]->pmix_mca_component_name) ) {
cli = PMIX_NEW(pmix_mca_base_component_list_item_t);
if (NULL == cli) {
ret = PMIX_ERR_OUT_OF_RESOURCE;
goto component_find_out;
}
cli->cli_component = static_components[i];
pmix_list_append(&framework->framework_components, (pmix_list_item_t *) cli);
}
}
}
#if PMIX_HAVE_PDL_SUPPORT
/* Find any available dynamic components in the specified directory */
if (open_dso_components && !pmix_mca_base_component_disable_dlopen) {
find_dyn_components(directory, framework, (const char**)requested_component_names,
include_mode);
} else {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_INFO, 0,
"pmix:mca: base: component_find: dso loading for %s MCA components disabled",
framework->framework_name);
}
#endif
if (include_mode) {
ret = component_find_check (framework, requested_component_names);
} else {
ret = PMIX_SUCCESS;
}
component_find_out:
if (NULL != requested_component_names) {
pmix_argv_free(requested_component_names);
}
/* All done */
return ret;
}
int pmix_mca_base_component_find_finalize(void)
{
return PMIX_SUCCESS;
}
int pmix_mca_base_components_filter (pmix_mca_base_framework_t *framework, uint32_t filter_flags)
{
pmix_list_t *components = &framework->framework_components;
int output_id = framework->framework_output;
pmix_mca_base_component_list_item_t *cli, *next;
char **requested_component_names = NULL;
bool include_mode, can_use;
int ret;
assert (NULL != components);
if (0 == filter_flags && NULL == framework->framework_selection) {
return PMIX_SUCCESS;
}
ret = pmix_mca_base_component_parse_requested (framework->framework_selection, &include_mode,
&requested_component_names);
if (PMIX_SUCCESS != ret) {
return ret;
}
PMIX_LIST_FOREACH_SAFE(cli, next, components, pmix_mca_base_component_list_item_t) {
const pmix_mca_base_component_t *component = cli->cli_component;
pmix_mca_base_open_only_dummy_component_t *dummy =
(pmix_mca_base_open_only_dummy_component_t *) cli->cli_component;
can_use = use_component(include_mode, (const char **) requested_component_names,
cli->cli_component->pmix_mca_component_name);
if (!can_use || (filter_flags & dummy->data.param_field) != filter_flags) {
if (can_use && (filter_flags & PMIX_MCA_BASE_METADATA_PARAM_CHECKPOINT) &&
!(PMIX_MCA_BASE_METADATA_PARAM_CHECKPOINT & dummy->data.param_field)) {
pmix_output_verbose(PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"pmix:mca: base: components_filter: "
"(%s) Component %s is *NOT* Checkpointable - Disabled",
component->reserved,
component->pmix_mca_component_name);
}
pmix_list_remove_item(components, &cli->super);
pmix_mca_base_component_unload(component, output_id);
PMIX_RELEASE(cli);
} else if (filter_flags & PMIX_MCA_BASE_METADATA_PARAM_CHECKPOINT) {
pmix_output_verbose(PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"pmix:mca: base: components_filter: "
"(%s) Component %s is Checkpointable",
component->reserved,
component->pmix_mca_component_name);
}
}
if (include_mode) {
ret = component_find_check(framework, requested_component_names);
} else {
ret = PMIX_SUCCESS;
}
if (NULL != requested_component_names) {
pmix_argv_free(requested_component_names);
}
return ret;
}
#if PMIX_HAVE_PDL_SUPPORT
/*
* Open up all directories in a given path and search for components of
* the specified type (and possibly of a given name).
*
* Note that we use our own path iteration functionality because we
* need to look at companion .ompi_info files in the same directory as
* the library to generate dependencies, etc.
*/
static void find_dyn_components(const char *path, pmix_mca_base_framework_t *framework,
const char **names, bool include_mode)
{
pmix_mca_base_component_repository_item_t *ri;
pmix_list_t *dy_components;
int ret;
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, framework->framework_output,
"mca: base: find_dyn_components: checking %s for %s components",
path, framework->framework_name);
if (NULL != path) {
ret = pmix_mca_base_component_repository_add(path);
if (PMIX_SUCCESS != ret) {
return;
}
}
ret = pmix_mca_base_component_repository_get_components(framework, &dy_components);
if (PMIX_SUCCESS != ret) {
return;
}
/* Iterate through the repository and find components that can be included */
PMIX_LIST_FOREACH(ri, dy_components, pmix_mca_base_component_repository_item_t) {
if (use_component(include_mode, names, ri->ri_name)) {
pmix_mca_base_component_repository_open(framework, ri);
}
}
}
#endif /* PMIX_HAVE_PDL_SUPPORT */
static bool use_component(const bool include_mode,
const char **requested_component_names,
const char *component_name)
{
bool found = false;
const char **req_comp_name = requested_component_names;
/*
* If no selection is specified then we use all components
* we can find.
*/
if (NULL == req_comp_name) {
return true;
}
while ( *req_comp_name != NULL ) {
if ( strcmp(component_name, *req_comp_name) == 0 ) {
found = true;
break;
}
req_comp_name++;
}
/*
* include_mode found | use
* --------------------+------
* 0 0 | true
* 0 1 | false
* 1 0 | false
* 1 1 | true
*
* -> inverted xor
* As xor is a binary operator let's implement it manually before
* a compiler screws it up.
*/
return (include_mode && found) || !(include_mode || found);
}
/* Ensure that *all* requested components exist. Print a warning
and abort if they do not. */
static int component_find_check (pmix_mca_base_framework_t *framework, char **requested_component_names)
{
pmix_list_t *components = &framework->framework_components;
pmix_mca_base_component_list_item_t *cli;
if (NULL == requested_component_names) {
return PMIX_SUCCESS;
}
for (int i = 0; NULL != requested_component_names[i]; ++i) {
bool found = false;
PMIX_LIST_FOREACH(cli, components, pmix_mca_base_component_list_item_t) {
if (0 == strcmp(requested_component_names[i],
cli->cli_component->pmix_mca_component_name)) {
found = true;
break;
}
}
if (!found) {
char h[MAXHOSTNAMELEN];
gethostname(h, sizeof(h));
pmix_show_help("help-mca-base.txt",
"find-available:not-valid", true,
h, framework->framework_name, requested_component_names[i]);
return PMIX_ERR_NOT_FOUND;
}
}
return PMIX_SUCCESS;
}
int pmix_mca_base_component_parse_requested (const char *requested, bool *include_mode,
char ***requested_component_names)
{
const char *requested_orig = requested;
*requested_component_names = NULL;
*include_mode = true;
/* See if the user requested anything */
if (NULL == requested || 0 == strlen (requested)) {
return PMIX_SUCCESS;
}
/* Are we including or excluding? We only allow the negate
character to be the *first* character of the value (but be nice
and allow any number of negate characters in the beginning). */
*include_mode = requested[0] != negate[0];
/* skip over all negate symbols at the beginning */
requested += strspn (requested, negate);
/* Double check to ensure that the user did not specify the negate
character anywhere else in the value. */
if (NULL != strstr (requested, negate)) {
pmix_show_help("help-mca-base.txt",
"framework-param:too-many-negates",
true, requested_orig);
return PMIX_ERROR;
}
/* Split up the value into individual component names */
*requested_component_names = pmix_argv_split(requested, ',');
/* All done */
return PMIX_SUCCESS;
}

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

@ -0,0 +1,572 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* 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) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "src/class/pmix_list.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_component_repository.h"
#include "src/mca/pdl/base/base.h"
#include "pmix_common.h"
#include "src/class/pmix_hash_table.h"
#include "src/util/basename.h"
#if PMIX_HAVE_PDL_SUPPORT
/*
* Private types
*/
static void ri_constructor(pmix_mca_base_component_repository_item_t *ri);
static void ri_destructor(pmix_mca_base_component_repository_item_t *ri);
PMIX_CLASS_INSTANCE(pmix_mca_base_component_repository_item_t, pmix_list_item_t,
ri_constructor, ri_destructor);
#endif /* PMIX_HAVE_PDL_SUPPORT */
/*
* Private variables
*/
static bool initialized = false;
#if PMIX_HAVE_PDL_SUPPORT
static pmix_hash_table_t pmix_mca_base_component_repository;
/* two-level macro for stringifying a number */
#define STRINGIFYX(x) #x
#define STRINGIFY(x) STRINGIFYX(x)
static int process_repository_item (const char *filename, void *data)
{
char name[PMIX_MCA_BASE_MAX_COMPONENT_NAME_LEN + 1];
char type[PMIX_MCA_BASE_MAX_TYPE_NAME_LEN + 1];
pmix_mca_base_component_repository_item_t *ri;
pmix_list_t *component_list;
char *base;
int ret;
base = pmix_basename (filename);
if (NULL == base) {
return PMIX_ERROR;
}
/* check if the plugin has the appropriate prefix */
if (0 != strncmp (base, "mca_", 4)) {
free (base);
return PMIX_SUCCESS;
}
/* read framework and component names. framework names may not include an _
* but component names may */
ret = sscanf(base, "mca_%" STRINGIFY(PMIX_MCA_BASE_MAX_TYPE_NAME_LEN) "[^_]_%"
STRINGIFY(PMIX_MCA_BASE_MAX_COMPONENT_NAME_LEN) "s", type, name);
if (0 > ret) {
/* does not patch the expected template. skip */
free(base);
return PMIX_SUCCESS;
}
/* lookup the associated framework list and create if it doesn't already exist */
ret = pmix_hash_table_get_value_ptr(&pmix_mca_base_component_repository, type,
strlen (type), (void **) &component_list);
if (PMIX_SUCCESS != ret) {
component_list = PMIX_NEW(pmix_list_t);
if (NULL == component_list) {
free (base);
/* OOM. nothing to do but fail */
return PMIX_ERR_OUT_OF_RESOURCE;
}
ret = pmix_hash_table_set_value_ptr(&pmix_mca_base_component_repository, type,
strlen (type), (void *) component_list);
if (PMIX_SUCCESS != ret) {
free (base);
PMIX_RELEASE(component_list);
return ret;
}
}
/* check for duplicate components */
PMIX_LIST_FOREACH(ri, component_list, pmix_mca_base_component_repository_item_t) {
if (0 == strcmp (ri->ri_name, name)) {
/* already scanned this component */
free (base);
return PMIX_SUCCESS;
}
}
ri = PMIX_NEW(pmix_mca_base_component_repository_item_t);
if (NULL == ri) {
free (base);
return PMIX_ERR_OUT_OF_RESOURCE;
}
ri->ri_base = base;
ri->ri_path = strdup (filename);
if (NULL == ri->ri_path) {
PMIX_RELEASE(ri);
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* strncpy does not guarantee a \0 */
ri->ri_type[PMIX_MCA_BASE_MAX_TYPE_NAME_LEN] = '\0';
strncpy (ri->ri_type, type, PMIX_MCA_BASE_MAX_TYPE_NAME_LEN);
ri->ri_name[PMIX_MCA_BASE_MAX_TYPE_NAME_LEN] = '\0';
strncpy (ri->ri_name, name, PMIX_MCA_BASE_MAX_COMPONENT_NAME_LEN);
pmix_list_append (component_list, &ri->super);
return PMIX_SUCCESS;
}
static int file_exists(const char *filename, const char *ext)
{
char *final;
int ret;
if (NULL == ext) {
return access (filename, F_OK) == 0;
}
ret = asprintf(&final, "%s.%s", filename, ext);
if (0 > ret || NULL == final) {
return 0;
}
ret = access (final, F_OK);
free(final);
return (0 == ret);
}
#endif /* PMIX_HAVE_PDL_SUPPORT */
int pmix_mca_base_component_repository_add (const char *path)
{
#if PMIX_HAVE_PDL_SUPPORT
char *path_to_use = NULL, *dir, *ctx;
const char sep[] = {PMIX_ENV_SEP, '\0'};
if (NULL == path) {
/* nothing to do */
return PMIX_SUCCESS;
}
path_to_use = strdup (path);
dir = strtok_r (path_to_use, sep, &ctx);
do {
if ((0 == strcmp(dir, "USER_DEFAULT") || 0 == strcmp(dir, "USR_DEFAULT"))
&& NULL != pmix_mca_base_user_default_path) {
dir = pmix_mca_base_user_default_path;
} else if (0 == strcmp(dir, "SYS_DEFAULT") ||
0 == strcmp(dir, "SYSTEM_DEFAULT")) {
dir = pmix_mca_base_system_default_path;
}
if (0 != pmix_pdl_foreachfile(dir, process_repository_item, NULL)) {
break;
}
} while (NULL != (dir = strtok_r (NULL, sep, &ctx)));
free (path_to_use);
#endif /* PMIX_HAVE_PDL_SUPPORT */
return PMIX_SUCCESS;
}
/*
* Initialize the repository
*/
int pmix_mca_base_component_repository_init(void)
{
/* Setup internal structures */
if (!initialized) {
#if PMIX_HAVE_PDL_SUPPORT
/* Initialize the dl framework */
int ret = pmix_mca_base_framework_open(&pmix_pdl_base_framework, 0);
if (PMIX_SUCCESS != ret) {
pmix_output(0, "%s %d:%s failed -- process will likely abort (open the dl framework returned %d instead of PMIX_SUCCESS)\n",
__FILE__, __LINE__, __func__, ret);
return ret;
}
pmix_pdl_base_select();
PMIX_CONSTRUCT(&pmix_mca_base_component_repository, pmix_hash_table_t);
ret = pmix_hash_table_init (&pmix_mca_base_component_repository, 128);
if (PMIX_SUCCESS != ret) {
(void) pmix_mca_base_framework_close(&pmix_pdl_base_framework);
return ret;
}
ret = pmix_mca_base_component_repository_add(pmix_mca_base_component_path);
if (PMIX_SUCCESS != ret) {
PMIX_DESTRUCT(&pmix_mca_base_component_repository);
(void) pmix_mca_base_framework_close(&pmix_pdl_base_framework);
return ret;
}
#endif
initialized = true;
}
/* All done */
return PMIX_SUCCESS;
}
int pmix_mca_base_component_repository_get_components (pmix_mca_base_framework_t *framework,
pmix_list_t **framework_components)
{
*framework_components = NULL;
#if PMIX_HAVE_PDL_SUPPORT
return pmix_hash_table_get_value_ptr (&pmix_mca_base_component_repository, framework->framework_name,
strlen (framework->framework_name), (void **) framework_components);
#endif
return PMIX_ERR_NOT_FOUND;
}
#if PMIX_HAVE_PDL_SUPPORT
static void pmix_mca_base_component_repository_release_internal(pmix_mca_base_component_repository_item_t *ri) {
int group_id;
group_id = pmix_mca_base_var_group_find (NULL, ri->ri_type, ri->ri_name);
if (0 <= group_id) {
/* ensure all variables are deregistered before we dlclose the component */
pmix_mca_base_var_group_deregister (group_id);
}
/* Close the component (and potentially unload it from memory */
if (ri->ri_dlhandle) {
pmix_pdl_close(ri->ri_dlhandle);
ri->ri_dlhandle = NULL;
}
}
#endif
#if PMIX_HAVE_PDL_SUPPORT
static pmix_mca_base_component_repository_item_t *find_component(const char *type, const char *name)
{
pmix_mca_base_component_repository_item_t *ri;
pmix_list_t *component_list;
int ret;
ret = pmix_hash_table_get_value_ptr (&pmix_mca_base_component_repository, type,
strlen (type), (void **) &component_list);
if (PMIX_SUCCESS != ret) {
/* component does not exist in the repository */
return NULL;
}
PMIX_LIST_FOREACH(ri, component_list, pmix_mca_base_component_repository_item_t) {
if (0 == strcmp (ri->ri_name, name)) {
return ri;
}
}
return NULL;
}
#endif
void pmix_mca_base_component_repository_release(const pmix_mca_base_component_t *component)
{
#if PMIX_HAVE_PDL_SUPPORT
pmix_mca_base_component_repository_item_t *ri;
ri = find_component (component->pmix_mca_type_name, component->pmix_mca_component_name);
if (NULL != ri && !(--ri->ri_refcnt)) {
pmix_mca_base_component_repository_release_internal (ri);
}
#endif
}
int pmix_mca_base_component_repository_retain_component(const char *type, const char *name)
{
#if PMIX_HAVE_PDL_SUPPORT
pmix_mca_base_component_repository_item_t *ri = find_component(type, name);
if (NULL != ri) {
++ri->ri_refcnt;
return PMIX_SUCCESS;
}
return PMIX_ERR_NOT_FOUND;
#else
return PMIX_ERR_NOT_SUPPORTED;
#endif
}
int pmix_mca_base_component_repository_open(pmix_mca_base_framework_t *framework,
pmix_mca_base_component_repository_item_t *ri)
{
#if PMIX_HAVE_PDL_SUPPORT
pmix_mca_base_component_t *component_struct;
pmix_mca_base_component_list_item_t *mitem = NULL;
char *struct_name = NULL;
int vl, ret;
pmix_output_verbose(PMIX_MCA_BASE_VERBOSE_INFO, 0, "pmix_mca_base_component_repository_open: examining dynamic "
"%s MCA component \"%s\" at path %s", ri->ri_type, ri->ri_name, ri->ri_path);
vl = pmix_mca_base_component_show_load_errors ? PMIX_MCA_BASE_VERBOSE_ERROR : PMIX_MCA_BASE_VERBOSE_INFO;
/* Ensure that this component is not already loaded (should only happen
if it was statically loaded). It's an error if it's already
loaded because we're evaluating this file -- not this component.
Hence, returning PMIX_ERR_PARAM indicates that the *file* failed
to load, not the component. */
PMIX_LIST_FOREACH(mitem, &framework->framework_components, pmix_mca_base_component_list_item_t) {
if (0 == strcmp(mitem->cli_component->pmix_mca_component_name, ri->ri_name)) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_INFO, 0, "pmix_mca_base_component_repository_open: already loaded (ignored)");
return PMIX_ERR_BAD_PARAM;
}
}
/* silence coverity issue (invalid free) */
mitem = NULL;
if (NULL != ri->ri_dlhandle) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_INFO, 0, "pmix_mca_base_component_repository_open: already loaded. returning cached component");
mitem = PMIX_NEW(pmix_mca_base_component_list_item_t);
if (NULL == mitem) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
mitem->cli_component = ri->ri_component_struct;
pmix_list_append (&framework->framework_components, &mitem->super);
return PMIX_SUCCESS;
}
if (0 != strcmp (ri->ri_type, framework->framework_name)) {
/* shouldn't happen. attempting to open a component belonging to
* another framework. if this happens it is likely a MCA base
* bug so assert */
assert (0);
return PMIX_ERR_NOT_SUPPORTED;
}
/* Now try to load the component */
char *err_msg = NULL;
if (PMIX_SUCCESS != pmix_pdl_open(ri->ri_path, true, false, &ri->ri_dlhandle, &err_msg)) {
if (NULL == err_msg) {
err_msg = "pmix_dl_open() error message was NULL!";
}
/* Because libltdl erroneously says "file not found" for any
type of error -- which is especially misleading when the file
is actually there but cannot be opened for some other reason
(e.g., missing symbol) -- do some simple huersitics and if
the file [probably] does exist, print a slightly better error
message. */
if (0 == strcasecmp("file not found", err_msg) &&
(file_exists(ri->ri_path, "lo") ||
file_exists(ri->ri_path, "so") ||
file_exists(ri->ri_path, "dylib") ||
file_exists(ri->ri_path, "dll"))) {
err_msg = "perhaps a missing symbol, or compiled for a different version of Open MPI?";
}
pmix_output_verbose(vl, 0, "pmix_mca_base_component_repository_open: unable to open %s: %s (ignored)",
ri->ri_base, err_msg);
return PMIX_ERR_BAD_PARAM;
}
/* Successfully opened the component; now find the public struct.
Malloc out enough space for it. */
do {
ret = asprintf (&struct_name, "mca_%s_%s_component", ri->ri_type, ri->ri_name);
if (0 > ret) {
ret = PMIX_ERR_OUT_OF_RESOURCE;
break;
}
mitem = PMIX_NEW(pmix_mca_base_component_list_item_t);
if (NULL == mitem) {
ret = PMIX_ERR_OUT_OF_RESOURCE;
break;
}
err_msg = NULL;
ret = pmix_pdl_lookup(ri->ri_dlhandle, struct_name, (void**) &component_struct, &err_msg);
if (PMIX_SUCCESS != ret || NULL == component_struct) {
if (NULL == err_msg) {
err_msg = "pmix_dl_loookup() error message was NULL!";
}
pmix_output_verbose(vl, 0, "pmix_mca_base_component_repository_open: \"%s\" does not appear to be a valid "
"%s MCA dynamic component (ignored): %s. ret %d", ri->ri_base, ri->ri_type, err_msg, ret);
ret = PMIX_ERR_BAD_PARAM;
break;
}
/* done with the structure name */
free (struct_name);
struct_name = NULL;
/* We found the public struct. Make sure its MCA major.minor
version is the same as ours. TODO -- add checks for project version (from framework) */
if (!(PMIX_MCA_BASE_VERSION_MAJOR == component_struct->pmix_mca_major_version &&
PMIX_MCA_BASE_VERSION_MINOR == component_struct->pmix_mca_minor_version)) {
pmix_output_verbose(vl, 0, "pmix_mca_base_component_repository_open: %s \"%s\" uses an MCA interface that is "
"not recognized (component MCA v%d.%d.%d != supported MCA v%d.%d.%d) -- ignored",
ri->ri_type, ri->ri_path, component_struct->pmix_mca_major_version,
component_struct->pmix_mca_minor_version, component_struct->pmix_mca_release_version,
PMIX_MCA_BASE_VERSION_MAJOR, PMIX_MCA_BASE_VERSION_MINOR, PMIX_MCA_BASE_VERSION_RELEASE);
ret = PMIX_ERR_BAD_PARAM;
break;
}
/* Also check that the component struct framework and component
names match the expected names from the filename */
if (0 != strcmp(component_struct->pmix_mca_type_name, ri->ri_type) ||
0 != strcmp(component_struct->pmix_mca_component_name, ri->ri_name)) {
pmix_output_verbose(vl, 0, "Component file data does not match filename: %s (%s / %s) != %s %s -- ignored",
ri->ri_path, ri->ri_type, ri->ri_name,
component_struct->pmix_mca_type_name,
component_struct->pmix_mca_component_name);
ret = PMIX_ERR_BAD_PARAM;
break;
}
/* Alles gut. Save the component struct, and register this
component to be closed later. */
ri->ri_component_struct = mitem->cli_component = component_struct;
ri->ri_refcnt = 1;
pmix_list_append(&framework->framework_components, &mitem->super);
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_INFO, 0, "pmix_mca_base_component_repository_open: opened dynamic %s MCA "
"component \"%s\"", ri->ri_type, ri->ri_name);
return PMIX_SUCCESS;
} while (0);
if (mitem) {
PMIX_RELEASE(mitem);
}
if (struct_name) {
free (struct_name);
}
pmix_pdl_close (ri->ri_dlhandle);
ri->ri_dlhandle = NULL;
return ret;
#else
/* no dlopen support */
return PMIX_ERR_NOT_SUPPORTED;
#endif
}
/*
* Finalize the repository -- close everything that's still open.
*/
void pmix_mca_base_component_repository_finalize(void)
{
if (!initialized) {
return;
}
initialized = false;
#if PMIX_HAVE_PDL_SUPPORT
pmix_list_t *component_list;
void *node, *key;
size_t key_size;
int ret;
ret = pmix_hash_table_get_first_key_ptr (&pmix_mca_base_component_repository, &key, &key_size,
(void **) &component_list, &node);
while (PMIX_SUCCESS == ret) {
PMIX_LIST_RELEASE(component_list);
ret = pmix_hash_table_get_next_key_ptr (&pmix_mca_base_component_repository, &key,
&key_size, (void **) &component_list,
node, &node);
}
(void) pmix_mca_base_framework_close(&pmix_pdl_base_framework);
PMIX_DESTRUCT(&pmix_mca_base_component_repository);
#endif
}
#if PMIX_HAVE_PDL_SUPPORT
/*
* Basic sentinel values, and construct the inner list
*/
static void ri_constructor (pmix_mca_base_component_repository_item_t *ri)
{
memset(ri->ri_type, 0, sizeof(ri->ri_type));
ri->ri_dlhandle = NULL;
ri->ri_component_struct = NULL;
ri->ri_path = NULL;
}
/*
* Close a component
*/
static void ri_destructor (pmix_mca_base_component_repository_item_t *ri)
{
/* dlclose the component if it is still open */
pmix_mca_base_component_repository_release_internal (ri);
/* It should be obvious, but I'll state it anyway because it bit me
during debugging: after the dlclose(), the pmix_mca_base_component_t
pointer is no longer valid because it has [potentially] been
unloaded from memory. So don't try to use it. :-) */
if (ri->ri_path) {
free (ri->ri_path);
}
if (ri->ri_base) {
free (ri->ri_base);
}
}
#endif /* PMIX_HAVE_PDL_SUPPORT */

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

@ -0,0 +1,133 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* 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) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file pmix_mca_base_component_repository.h
*
* This file provide the external interface to our base component
* module. Most of the components that depend on it, will use the
* retain_component() function to increase the reference count on a
* particular component (as opposed to the retain() function, which is
* internal to the pmix/mca/base). But it's convenient to have all
* the functions exported from one header file rather than to separate
* retain_component() and retain() into two separate header files
* (i.e., have a separate header file just for retain()).
*/
#ifndef MCA_BASE_COMPONENT_REPOSITORY_H
#define MCA_BASE_COMPONENT_REPOSITORY_H
#include <src/include/pmix_config.h>
#include "src/mca/pdl/pdl.h"
#include "src/mca/pdl/base/base.h"
BEGIN_C_DECLS
struct pmix_mca_base_component_repository_item_t {
pmix_list_item_t super;
char ri_type[PMIX_MCA_BASE_MAX_TYPE_NAME_LEN + 1];
char ri_name[PMIX_MCA_BASE_MAX_COMPONENT_NAME_LEN + 1];
char *ri_path;
char *ri_base;
pmix_pdl_handle_t *ri_dlhandle;
const pmix_mca_base_component_t *ri_component_struct;
int ri_refcnt;
};
typedef struct pmix_mca_base_component_repository_item_t pmix_mca_base_component_repository_item_t;
PMIX_CLASS_DECLARATION(pmix_mca_base_component_repository_item_t);
/**
* @brief initialize the component repository
*
* This function must be called before any frameworks are registered or
* opened. It is responsible for setting up the repository of dynamically
* loaded components. The initial search path is taken from the
* pmix_mca_base_component_path MCA parameter. pmix_mca_base_open () is a
* prerequisite call as it registers the pmix_mca_base_component_path parameter.
*/
int pmix_mca_base_component_repository_init(void);
/**
* @brief add search path for dynamically loaded components
*
* @param[in] path delimited list of search paths to add
*/
int pmix_mca_base_component_repository_add(const char *path);
/**
* @brief return the list of components that match a given framework
*
* @param[in] framework framework to match
* @param[out] framework_components components that match this framework
*
* The list returned in {framework_components} is owned by the component
* repository and CAN NOT be modified by the caller.
*/
int pmix_mca_base_component_repository_get_components(pmix_mca_base_framework_t *framework,
pmix_list_t **framework_components);
/**
* @brief finalize the mca component repository
*/
void pmix_mca_base_component_repository_finalize(void);
/**
* @brief open the repository item and add it to the framework's component
* list
*
* @param[in] framework framework that matches the component
* @param[in] ri dynamic component to open
*/
int pmix_mca_base_component_repository_open(pmix_mca_base_framework_t *framework,
pmix_mca_base_component_repository_item_t *ri);
/**
* @brief Reduce the reference count of a component and dlclose it if necessary
*/
void pmix_mca_base_component_repository_release(const pmix_mca_base_component_t *component);
/**
* @brief Increase the reference count of a component
*
* Each component repository item starts with a reference count of 0. This ensures that
* when a framework closes it's components the repository items are all correctly
* dlclosed. This function can be used to prevent the dlclose if a component is needed
* after its framework has closed the associated component. Users of this function
* should call pmix_mca_base_component_repository_release() once they are finished with the
* component.
*
* @note all components are automatically unloaded by the
* pmix_mca_base_component_repository_finalize() call.
*/
int pmix_mca_base_component_repository_retain_component(const char *type, const char *name);
END_C_DECLS
#endif /* MCA_BASE_COMPONENT_REPOSITORY_H */

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

@ -0,0 +1,94 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2006 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-2006 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include "src/class/pmix_list.h"
#include "src/util/output.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_component_repository.h"
#include "pmix_common.h"
void pmix_mca_base_component_unload (const pmix_mca_base_component_t *component, int output_id)
{
int ret;
/* Unload */
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca: base: close: unloading component %s",
component->pmix_mca_component_name);
ret = pmix_mca_base_var_group_find (component->pmix_mca_project_name, component->pmix_mca_type_name,
component->pmix_mca_component_name);
if (0 <= ret) {
pmix_mca_base_var_group_deregister (ret);
}
pmix_mca_base_component_repository_release (component);
}
void pmix_mca_base_component_close (const pmix_mca_base_component_t *component, int output_id)
{
/* Close */
if (NULL != component->pmix_mca_close_component) {
component->pmix_mca_close_component();
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca: base: close: component %s closed",
component->pmix_mca_component_name);
}
pmix_mca_base_component_unload (component, output_id);
}
int pmix_mca_base_framework_components_close (pmix_mca_base_framework_t *framework,
const pmix_mca_base_component_t *skip)
{
return pmix_mca_base_components_close (framework->framework_output,
&framework->framework_components,
skip);
}
int pmix_mca_base_components_close(int output_id, pmix_list_t *components,
const pmix_mca_base_component_t *skip)
{
pmix_mca_base_component_list_item_t *cli, *next;
/* Close and unload all components in the available list, except the
"skip" item. This is handy to close out all non-selected
components. It's easier to simply remove the entire list and
then simply re-add the skip entry when done. */
PMIX_LIST_FOREACH_SAFE(cli, next, components, pmix_mca_base_component_list_item_t) {
if (skip == cli->cli_component) {
continue;
}
pmix_mca_base_component_close (cli->cli_component, output_id);
pmix_list_remove_item (components, &cli->super);
PMIX_RELEASE(cli);
}
/* All done */
return PMIX_SUCCESS;
}

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

@ -0,0 +1,164 @@
/* -*- 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-2013 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-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Hochschule Esslingen. All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "src/class/pmix_list.h"
#include "src/util/argv.h"
#include "src/util/error.h"
#include "src/util/output.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "pmix_common.h"
/*
* Local functions
*/
static int open_components(pmix_mca_base_framework_t *framework);
struct pmix_mca_base_dummy_framework_list_item_t {
pmix_list_item_t super;
pmix_mca_base_framework_t framework;
};
/**
* Function for finding and opening either all MCA components, or the
* one that was specifically requested via a MCA parameter.
*/
int pmix_mca_base_framework_components_open (pmix_mca_base_framework_t *framework,
pmix_mca_base_open_flag_t flags)
{
/* Open flags are not used at this time. Suppress compiler warning. */
if (flags & PMIX_MCA_BASE_OPEN_FIND_COMPONENTS) {
bool open_dso_components = !(flags & PMIX_MCA_BASE_OPEN_STATIC_ONLY);
/* Find and load requested components */
int ret = pmix_mca_base_component_find(NULL, framework, false, open_dso_components);
if (PMIX_SUCCESS != ret) {
return ret;
}
}
/* Open all registered components */
return open_components (framework);
}
/*
* Traverse the entire list of found components (a list of
* pmix_mca_base_component_t instances). If the requested_component_names
* array is empty, or the name of each component in the list of found
* components is in the requested_components_array, try to open it.
* If it opens, add it to the components_available list.
*/
static int open_components(pmix_mca_base_framework_t *framework)
{
pmix_list_t *components = &framework->framework_components;
uint32_t open_only_flags = PMIX_MCA_BASE_METADATA_PARAM_NONE;
int output_id = framework->framework_output;
pmix_mca_base_component_list_item_t *cli, *next;
int ret;
/*
* Pre-process the list with parameter constraints
* e.g., If requested to select only CR enabled components
* then only make available those components.
*
* JJH Note: Currently checkpoint/restart is the only user of this
* functionality. If other component constraint options are
* added, then this logic can be used for all contraint
* options.
*
* NTH: Logic moved to pmix_mca_base_components_filter.
*/
/* If pmix_mca_base_framework_register_components was called with the MCA_BASE_COMPONENTS_ALL flag
we need to trim down and close any extra components we do not want open */
ret = pmix_mca_base_components_filter (framework, open_only_flags);
if (PMIX_SUCCESS != ret) {
return ret;
}
/* Announce */
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca: base: components_open: opening %s components",
framework->framework_name);
/* Traverse the list of components */
PMIX_LIST_FOREACH_SAFE(cli, next, components, pmix_mca_base_component_list_item_t) {
const pmix_mca_base_component_t *component = cli->cli_component;
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca: base: components_open: found loaded component %s",
component->pmix_mca_component_name);
if (NULL != component->pmix_mca_open_component) {
/* Call open if register didn't call it already */
ret = component->pmix_mca_open_component();
if (PMIX_SUCCESS == ret) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca: base: components_open: "
"component %s open function successful",
component->pmix_mca_component_name);
} else {
if (PMIX_ERR_NOT_AVAILABLE != ret) {
/* If the component returns PMIX_ERR_NOT_AVAILABLE,
it's a cue to "silently ignore me" -- it's not a
failure, it's just a way for the component to say
"nope!".
Otherwise, however, display an error. We may end
up displaying this twice, but it may go to separate
streams. So better to be redundant than to not
display the error in the stream where it was
expected. */
if (pmix_mca_base_component_show_load_errors) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_ERROR, output_id,
"mca: base: components_open: component %s "
"/ %s open function failed",
component->pmix_mca_type_name,
component->pmix_mca_component_name);
}
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca: base: components_open: "
"component %s open function failed",
component->pmix_mca_component_name);
}
pmix_mca_base_component_close (component, output_id);
pmix_list_remove_item (components, &cli->super);
PMIX_RELEASE(cli);
}
}
}
/* All done */
return PMIX_SUCCESS;
}

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

@ -0,0 +1,163 @@
/* -*- 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-2012 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-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "src/class/pmix_list.h"
#include "src/util/argv.h"
#include "src/util/error.h"
#include "src/util/output.h"
#include "src/util/show_help.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_framework.h"
#include "src/mca/base/pmix_mca_base_component_repository.h"
#include "pmix_common.h"
/*
* Local functions
*/
static int register_components(pmix_mca_base_framework_t *framework);
/**
* Function for finding and opening either all MCA components, or the
* one that was specifically requested via a MCA parameter.
*/
int pmix_mca_base_framework_components_register (pmix_mca_base_framework_t *framework,
pmix_mca_base_register_flag_t flags)
{
bool open_dso_components = !(flags & PMIX_MCA_BASE_REGISTER_STATIC_ONLY);
bool ignore_requested = !!(flags & PMIX_MCA_BASE_REGISTER_ALL);
int ret;
/* Find and load requested components */
ret = pmix_mca_base_component_find(NULL, framework, ignore_requested, open_dso_components);
if (PMIX_SUCCESS != ret) {
return ret;
}
/* Register all remaining components */
return register_components(framework);
}
/*
* Traverse the entire list of found components (a list of
* pmix_mca_base_component_t instances). If the requested_component_names
* array is empty, or the name of each component in the list of found
* components is in the requested_components_array, try to open it.
* If it opens, add it to the components_available list.
*/
static int register_components(pmix_mca_base_framework_t *framework)
{
int ret;
pmix_mca_base_component_t *component;
pmix_mca_base_component_list_item_t *cli, *next;
int output_id = framework->framework_output;
/* Announce */
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"pmix:mca: base: components_register: registering framework %s components",
framework->framework_name);
/* Traverse the list of found components */
PMIX_LIST_FOREACH_SAFE(cli, next, &framework->framework_components, pmix_mca_base_component_list_item_t) {
component = (pmix_mca_base_component_t *)cli->cli_component;
pmix_output_verbose(PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"pmix:mca: base: components_register: found loaded component %s",
component->pmix_mca_component_name);
/* Call the component's MCA parameter registration function (or open if register doesn't exist) */
if (NULL == component->pmix_mca_register_component_params) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"pmix:mca: base: components_register: "
"component %s has no register or open function",
component->pmix_mca_component_name);
ret = PMIX_SUCCESS;
} else {
ret = component->pmix_mca_register_component_params();
}
if (PMIX_SUCCESS != ret) {
if (PMIX_ERR_NOT_AVAILABLE != ret) {
/* If the component returns PMIX_ERR_NOT_AVAILABLE,
it's a cue to "silently ignore me" -- it's not a
failure, it's just a way for the component to say
"nope!".
Otherwise, however, display an error. We may end
up displaying this twice, but it may go to separate
streams. So better to be redundant than to not
display the error in the stream where it was
expected. */
if (pmix_mca_base_component_show_load_errors) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_ERROR, output_id,
"pmix:mca: base: components_register: component %s "
"/ %s register function failed",
component->pmix_mca_type_name,
component->pmix_mca_component_name);
}
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"pmix:mca: base: components_register: "
"component %s register function failed",
component->pmix_mca_component_name);
}
pmix_list_remove_item (&framework->framework_components, &cli->super);
/* Release this list item */
PMIX_RELEASE(cli);
continue;
}
if (NULL != component->pmix_mca_register_component_params) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id, "pmix:mca: base: components_register: "
"component %s register function successful",
component->pmix_mca_component_name);
}
/* Register this component's version */
pmix_mca_base_component_var_register (component, "major_version", NULL, PMIX_MCA_BASE_VAR_TYPE_INT, NULL,
0, PMIX_MCA_BASE_VAR_FLAG_DEFAULT_ONLY | PMIX_MCA_BASE_VAR_FLAG_INTERNAL,
PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_CONSTANT,
&component->pmix_mca_component_major_version);
pmix_mca_base_component_var_register (component, "minor_version", NULL, PMIX_MCA_BASE_VAR_TYPE_INT, NULL,
0, PMIX_MCA_BASE_VAR_FLAG_DEFAULT_ONLY | PMIX_MCA_BASE_VAR_FLAG_INTERNAL,
PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_CONSTANT,
&component->pmix_mca_component_minor_version);
pmix_mca_base_component_var_register (component, "release_version", NULL, PMIX_MCA_BASE_VAR_TYPE_INT, NULL,
0, PMIX_MCA_BASE_VAR_FLAG_DEFAULT_ONLY | PMIX_MCA_BASE_VAR_FLAG_INTERNAL,
PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_CONSTANT,
&component->pmix_mca_component_release_version);
}
/* All done */
return PMIX_SUCCESS;
}

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

@ -0,0 +1,147 @@
/* -*- 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) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <src/include/pmix_config.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "src/class/pmix_list.h"
#include "src/util/error.h"
#include "src/util/output.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_component_repository.h"
#include "pmix_common.h"
int pmix_mca_base_select(const char *type_name, int output_id,
pmix_list_t *components_available,
pmix_mca_base_module_t **best_module,
pmix_mca_base_component_t **best_component,
int *priority_out)
{
pmix_mca_base_component_list_item_t *cli = NULL;
pmix_mca_base_component_t *component = NULL;
pmix_mca_base_module_t *module = NULL;
int priority = 0, best_priority = INT32_MIN;
int rc;
*best_module = NULL;
*best_component = NULL;
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca:base:select: Auto-selecting %s components",
type_name);
/*
* Traverse the list of available components.
* For each call their 'query' functions to determine relative priority.
*/
PMIX_LIST_FOREACH(cli, components_available, pmix_mca_base_component_list_item_t) {
component = (pmix_mca_base_component_t *) cli->cli_component;
/*
* If there is a query function then use it.
*/
if (NULL == component->pmix_mca_query_component) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca:base:select:(%5s) Skipping component [%s]. It does not implement a query function",
type_name, component->pmix_mca_component_name );
continue;
}
/*
* Query this component for the module and priority
*/
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca:base:select:(%5s) Querying component [%s]",
type_name, component->pmix_mca_component_name);
rc = component->pmix_mca_query_component(&module, &priority);
if (PMIX_ERR_FATAL == rc) {
/* a fatal error was detected by this component - e.g., the
* user specified a required element and the component could
* not find it. In this case, we must not continue as we might
* find some other component that could run, causing us to do
* something the user didn't want */
return rc;
} else if (PMIX_SUCCESS != rc) {
/* silently skip this component */
continue;
}
/*
* If no module was returned, then skip component
*/
if (NULL == module) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca:base:select:(%5s) Skipping component [%s]. Query failed to return a module",
type_name, component->pmix_mca_component_name );
continue;
}
/*
* Determine if this is the best module we have seen by looking the priority
*/
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca:base:select:(%5s) Query of component [%s] set priority to %d",
type_name, component->pmix_mca_component_name, priority);
if (priority > best_priority) {
best_priority = priority;
*best_component = component;
*best_module = module;
}
}
if (priority_out) {
*priority_out = best_priority;
}
/*
* Finished querying all components.
* Make sure we found something in the process.
*/
if (NULL == *best_component) {
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca:base:select:(%5s) No component selected!",
type_name);
/*
* Still close the non-selected components
*/
pmix_mca_base_components_close(0, /* Pass 0 to keep this from closing the output handle */
components_available,
NULL);
return PMIX_ERR_NOT_FOUND;
}
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
"mca:base:select:(%5s) Selected component [%s]",
type_name, (*best_component)->pmix_mca_component_name);
/*
* Close the non-selected components
*/
pmix_mca_base_components_close(output_id,
components_available,
(pmix_mca_base_component_t *) (*best_component));
return PMIX_SUCCESS;
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше