1
1

Merge pull request #4305 from rhc54/topic/pup

Update to track PMIx master
Этот коммит содержится в:
Ralph Castain 2017-10-05 13:46:09 -05:00 коммит произвёл GitHub
родитель be7b0af5d9 073eff5dcd
Коммит 3660cedc48
17 изменённых файлов: 95 добавлений и 109 удалений

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

@ -30,7 +30,7 @@ greek=
# command, or with the date (if "git describe" fails) in the form of
# "date<date>".
repo_rev=git6ab9c8d
repo_rev=git0de7b68
# 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="Oct 03, 2017"
date="Oct 05, 2017"
# The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library

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

@ -164,7 +164,8 @@ typedef uint32_t pmix_rank_t;
// MCA param select the active transport
/* attributes for TCP connections */
#define PMIX_TCP_URI "pmix.tcp.uri" // (char*) URI of server to connect to
#define PMIX_TCP_REPORT_URI "pmix.tcp.repuri" // (char*) output URI - '-' => stdout, '+' => stderr, or filename
#define PMIX_TCP_URI "pmix.tcp.uri" // (char*) URI of server to connect to, or file:<name of file containing it>
#define PMIX_TCP_IF_INCLUDE "pmix.tcp.ifinclude" // (char*) comma-delimited list of devices and/or CIDR notation
#define PMIX_TCP_IF_EXCLUDE "pmix.tcp.ifexclude" // (char*) comma-delimited list of devices and/or CIDR notation
#define PMIX_TCP_IPV4_PORT "pmix.tcp.ipv4" // (int) IPv4 port to be used
@ -1170,6 +1171,14 @@ struct pmix_info_t {
pmix_list_append((l), &_kv->super); \
} \
} while(0)
/* define a special macro for checking if a boolean
* info is true - when info structs are provided, a
* type of PMIX_UNDEF is taken to imply a boolean "true"
* as the presence of the key defaults to indicating
* "true" */
#define PMIX_INFO_TRUE(m) \
(PMIX_UNDEF == (m)->value.type || (PMIX_BOOL == (m)->value.type && (m)->value.data.flag)) ? true : false
/**** PMIX LOOKUP RETURN STRUCT ****/
typedef struct pmix_pdata {

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

@ -664,15 +664,7 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
if (NULL != info && 0 < ninfo) {
for (n=0; n < ninfo; n++) {
if (0 == strcmp(PMIX_EMBED_BARRIER, info[n].key)) {
/* did they specify a value? */
if (PMIX_BOOL == info[n].value.type) {
if (info[n].value.data.flag) {
/* they do want the barrier */
PMIx_Fence(NULL, 0, NULL, 0);
}
} else {
/* providing this attribute is considered
* to be "true" by default */
if (PMIX_INFO_TRUE(&info[n])) {
PMIx_Fence(NULL, 0, NULL, 0);
}
break;

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

@ -492,15 +492,9 @@ static void _getnbfn(int fd, short flags, void *cbdata)
if (NULL != cb->info) {
for (n=0; n < cb->ninfo; n++) {
if (0 == strncmp(cb->info[n].key, PMIX_OPTIONAL, PMIX_MAX_KEYLEN)) {
if (PMIX_UNDEF == cb->info[n].value.type ||
cb->info[n].value.data.flag) {
optional = true;
}
optional = PMIX_INFO_TRUE(&cb->info[n]);
} else if (0 == strncmp(cb->info[n].key, PMIX_IMMEDIATE, PMIX_MAX_KEYLEN)) {
if (PMIX_UNDEF == cb->info[n].value.type ||
cb->info[n].value.data.flag) {
immediate = true;
}
immediate = PMIX_INFO_TRUE(&cb->info[n]);
} else if (0 == strncmp(cb->info[n].key, PMIX_TIMEOUT, PMIX_MAX_KEYLEN)) {
/* set a timer to kick us out if we don't
* have an answer within their window */

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

@ -813,11 +813,8 @@ static void _notify_client_event(int sd, short args, void *cbdata)
/* check for caching instructions */
for (n=0; n < cd->ninfo; n++) {
if (0 == strncmp(cd->info[n].key, PMIX_EVENT_DO_NOT_CACHE, PMIX_MAX_KEYLEN)) {
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
holdcd = false;
break;
}
holdcd = PMIX_INFO_TRUE(&cd->info[n]);
break;
}
}
}

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

@ -443,45 +443,32 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
for (n=0; n < cd->ninfo; n++) {
if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_FIRST, PMIX_MAX_KEYLEN)) {
/* flag if they asked to put this one first overall */
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
firstoverall = true;
}
firstoverall = PMIX_INFO_TRUE(&cd->info[n]);
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_LAST, PMIX_MAX_KEYLEN)) {
/* flag if they asked to put this one last overall */
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
lastoverall = true;
}
lastoverall = PMIX_INFO_TRUE(&cd->info[n]);
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_PREPEND, PMIX_MAX_KEYLEN)) {
/* flag if they asked to prepend this handler */
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
if (PMIX_INFO_TRUE(&cd->info[n])) {
location = PMIX_EVENT_ORDER_PREPEND;
}
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_APPEND, PMIX_MAX_KEYLEN)) {
/* flag if they asked to append this handler */
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
if (PMIX_INFO_TRUE(&cd->info[n])) {
location = PMIX_EVENT_ORDER_APPEND;
}
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_NAME, PMIX_MAX_KEYLEN)) {
name = cd->info[n].value.data.string;
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_ENVIRO_LEVEL, PMIX_MAX_KEYLEN)) {
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
cd->enviro = true;
}
cd->enviro = PMIX_INFO_TRUE(&cd->info[n]);
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_RETURN_OBJECT, PMIX_MAX_KEYLEN)) {
cbobject = cd->info[n].value.data.ptr;
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_FIRST_IN_CATEGORY, PMIX_MAX_KEYLEN)) {
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
if (PMIX_INFO_TRUE(&cd->info[n])) {
location = PMIX_EVENT_ORDER_FIRST;
}
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_LAST_IN_CATEGORY, PMIX_MAX_KEYLEN)) {
if (PMIX_UNDEF == cd->info[n].value.type ||
cd->info[n].value.data.flag) {
if (PMIX_INFO_TRUE(&cd->info[n])) {
location = PMIX_EVENT_ORDER_LAST;
}
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_HDLR_BEFORE, PMIX_MAX_KEYLEN)) {

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

@ -2754,7 +2754,9 @@ static pmix_status_t dstore_del_nspace(const char* nspace)
PMIX_ERROR_LOG(rc);
goto exit;
}
PMIX_DESTRUCT(trk);
if (true == trk->in_use) {
PMIX_DESTRUCT(trk);
}
}
/* A lot of nspaces may be using same session info

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

@ -354,6 +354,9 @@ typedef pmix_status_t (*pmix_gds_base_module_add_nspace_fn_t)(const char *nspace
pmix_gds_base_active_module_t *_g; \
pmix_status_t _s = PMIX_SUCCESS; \
(s) = PMIX_SUCCESS; \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS ADD NSPACE %s", \
__FILE__, __LINE__, (n)); \
PMIX_LIST_FOREACH(_g, &pmix_gds_globals.actives, \
pmix_gds_base_active_module_t) { \
if (NULL != _g->module->add_nspace) { \
@ -381,6 +384,9 @@ typedef pmix_status_t (*pmix_gds_base_module_del_nspace_fn_t)(const char* nspace
pmix_gds_base_active_module_t *_g; \
pmix_status_t _s = PMIX_SUCCESS; \
(s) = PMIX_SUCCESS; \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS DEL NSPACE %s", \
__FILE__, __LINE__, (n)); \
PMIX_LIST_FOREACH(_g, &pmix_gds_globals.actives, \
pmix_gds_base_active_module_t) { \
if (NULL != _g->module->del_nspace) { \

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

@ -199,11 +199,11 @@ static pmix_status_t start(pmix_peer_t *requestor, pmix_status_t error,
/* check the directives to see if what they want monitored */
for (n=0; n < ndirs; n++) {
if (0 == strcmp(directives[n].key, PMIX_MONITOR_FILE_SIZE)) {
ft->file_size = directives[n].value.data.flag;
ft->file_size = PMIX_INFO_TRUE(&directives[n]);
} else if (0 == strcmp(directives[n].key, PMIX_MONITOR_FILE_ACCESS)) {
ft->file_access = directives[n].value.data.flag;
ft->file_access = PMIX_INFO_TRUE(&directives[n]);
} else if (0 == strcmp(directives[n].key, PMIX_MONITOR_FILE_MODIFY)) {
ft->file_mod = directives[n].value.data.flag;
ft->file_mod = PMIX_INFO_TRUE(&directives[n]);
} else if (0 == strcmp(directives[n].key, PMIX_MONITOR_FILE_DROPS)) {
ft->ndrops = directives[n].value.data.uint32;
} else if (0 == strcmp(directives[n].key, PMIX_MONITOR_FILE_CHECK_TIME)) {

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

@ -79,9 +79,8 @@ static pmix_status_t setup_listeners(pmix_info_t *info, size_t ninfo, bool *need
/* scan the directives to see if they want only one listener setup */
if (NULL != info) {
for (n=0; n < ninfo; n++) {
if (0 == strncmp(info[n].key, PMIX_SINGLE_LISTENER, PMIX_MAX_KEYLEN) &&
(PMIX_UNDEF == info[n].value.type || info[n].value.data.flag)) {
single = true;
if (0 == strncmp(info[n].key, PMIX_SINGLE_LISTENER, PMIX_MAX_KEYLEN)) {
single = PMIX_INFO_TRUE(&info[n]);
break;
}
}

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

@ -212,21 +212,12 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (NULL != info) {
for (n=0; n < ninfo; n++) {
if (0 == strcmp(info[n].key, PMIX_CONNECT_TO_SYSTEM)) {
if (PMIX_UNDEF == info[n].value.type) {
system_level_only = true;
} else {
system_level_only = info[n].value.data.flag;
}
system_level_only = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strcmp(info[n].key, PMIX_CONNECT_SYSTEM_FIRST)) {
/* try the system-level */
if (PMIX_UNDEF == info[n].value.type) {
system_level = true;
} else {
system_level = info[n].value.data.flag;
}
system_level = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strcmp(info[n].key, PMIX_SERVER_PIDINFO)) {
pid = info[n].value.data.pid;
pmix_output(0, "GOT PID %d", (int)pid);
} else if (0 == strcmp(info[n].key, PMIX_SERVER_URI)) {
if (NULL == mca_ptl_tcp_component.super.uri) {
free(mca_ptl_tcp_component.super.uri);

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

@ -49,6 +49,7 @@ typedef struct {
char *system_filename;
int wait_to_connect;
int max_retries;
char *report_uri;
} pmix_ptl_tcp_component_t;
extern pmix_ptl_tcp_component_t mca_ptl_tcp_component;

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

@ -114,7 +114,8 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo,
.session_filename = NULL,
.system_filename = NULL,
.wait_to_connect = 4,
.max_retries = 2
.max_retries = 2,
.report_uri = NULL
};
static char **split_and_resolve(char **orig_str, char *name);
@ -127,12 +128,20 @@ static int component_register(void)
pmix_mca_base_component_t *component = &mca_ptl_tcp_component.super.base;
(void)pmix_mca_base_component_var_register(component, "server_uri",
"URI of a server a tool wishes to connect to",
"URI of a server a tool wishes to connect to - either the "
"URI itself, or file:path-to-file-containing-uri",
PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
PMIX_INFO_LVL_2,
PMIX_MCA_BASE_VAR_SCOPE_LOCAL,
&mca_ptl_tcp_component.super.uri);
(void)pmix_mca_base_component_var_register(component, "report_uri",
"Output URI [- => stdout, + => stderr, or filename]",
PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
PMIX_INFO_LVL_2,
PMIX_MCA_BASE_VAR_SCOPE_LOCAL,
&mca_ptl_tcp_component.report_uri);
(void)pmix_mca_base_component_var_register(component, "if_include",
"Comma-delimited list of devices and/or CIDR notation of TCP networks (e.g., \"eth0,192.168.0.0/16\"). Mutually exclusive with ptl_tcp_if_exclude.",
PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
@ -308,28 +317,21 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo,
} else if (0 == strcmp(info[n].key, PMIX_TCP_IPV6_PORT)) {
mca_ptl_tcp_component.ipv6_port = info[n].value.data.integer;
} else if (0 == strcmp(info[n].key, PMIX_TCP_DISABLE_IPV4)) {
if (PMIX_UNDEF == info[n].value.type) {
mca_ptl_tcp_component.disable_ipv4_family = true;
} else {
mca_ptl_tcp_component.disable_ipv4_family = info[n].value.data.flag;
}
mca_ptl_tcp_component.disable_ipv4_family = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strcmp(info[n].key, PMIX_TCP_DISABLE_IPV6)) {
if (PMIX_UNDEF == info[n].value.type) {
mca_ptl_tcp_component.disable_ipv6_family = true;
} else {
mca_ptl_tcp_component.disable_ipv6_family = info[n].value.data.flag;
}
mca_ptl_tcp_component.disable_ipv6_family = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strcmp(info[n].key, PMIX_SERVER_REMOTE_CONNECTIONS)) {
if (PMIX_UNDEF == info[n].value.type) {
remote_connections = true;
} else {
remote_connections = info[n].value.data.flag;
}
remote_connections = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strcmp(info[n].key, PMIX_TCP_URI)) {
if (NULL != mca_ptl_tcp_component.super.uri) {
free(mca_ptl_tcp_component.super.uri);
}
mca_ptl_tcp_component.super.uri = strdup(info[n].value.data.string);
} else if (0 == strcmp(info[n].key, PMIX_TCP_REPORT_URI)) {
if (NULL != mca_ptl_tcp_component.report_uri) {
free(mca_ptl_tcp_component.report_uri);
}
mca_ptl_tcp_component.report_uri = strdup(info[n].value.data.string);
} else if (0 == strcmp(info[n].key, PMIX_SERVER_TMPDIR)) {
if (NULL != mca_ptl_tcp_component.session_tmpdir) {
free(mca_ptl_tcp_component.session_tmpdir);
@ -341,17 +343,9 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo,
}
mca_ptl_tcp_component.system_tmpdir = strdup(info[n].value.data.string);
} else if (0 == strcmp(info[n].key, PMIX_SERVER_TOOL_SUPPORT)) {
if (PMIX_UNDEF == info[n].value.type) {
session_tool = true;
} else {
session_tool = info[n].value.data.flag;
}
session_tool = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strcmp(info[n].key, PMIX_SERVER_SYSTEM_SUPPORT)) {
if (PMIX_UNDEF == info[n].value.type) {
system_tool = true;
} else {
system_tool = info[n].value.data.flag;
}
system_tool = PMIX_INFO_TRUE(&info[n]);
}
}
}
@ -575,6 +569,33 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo,
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"ptl:tcp URI %s", lt->uri);
if (NULL != mca_ptl_tcp_component.report_uri) {
/* if the string is a "-", then output to stdout */
if (0 == strcmp(mca_ptl_tcp_component.report_uri, "-")) {
fprintf(stdout, "%s\n", lt->uri);
} else if (0 == strcmp(mca_ptl_tcp_component.report_uri, "+")) {
/* output to stderr */
fprintf(stderr, "%s\n", lt->uri);
} else {
/* must be a file */
FILE *fp;
fp = fopen(mca_ptl_tcp_component.report_uri, "w");
if (NULL == fp) {
pmix_output(0, "Impossible to open the file %s in write mode\n", mca_ptl_tcp_component.report_uri);
PMIX_ERROR_LOG(PMIX_ERR_FILE_OPEN_FAILURE);
CLOSE_THE_SOCKET(lt->socket);
free(mca_ptl_tcp_component.system_filename);
mca_ptl_tcp_component.system_filename = NULL;
goto sockerror;
}
/* output my nspace and rank plus the URI */
fprintf(fp, "%s\n", lt->uri);
/* add a flag that indicates we accept v2.1 protocols */
fprintf(fp, "v%s\n", PMIX_VERSION);
fclose(fp);
}
}
/* if we are going to support tools, then drop contact file(s) */
if (system_tool) {
FILE *fp;

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

@ -191,11 +191,7 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo,
if (NULL != info) {
for (n=0; n < ninfo; n++) {
if (0 == strcmp(info[n].key, PMIX_USOCK_DISABLE)) {
if (PMIX_UNDEF == info[n].value.type) {
disabled = true;;
} else {
disabled = info[n].value.data.flag;
}
disabled = PMIX_INFO_TRUE(&info[n]);;
break;
}
}

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

@ -176,11 +176,9 @@ pmix_status_t pmix_server_get(pmix_buffer_t *buf,
/* search for directives we can deal with here */
for (n=0; n < ninfo; n++) {
if (0 == strcmp(info[n].key, PMIX_IMMEDIATE)) {
if (PMIX_UNDEF == info[n].value.type || info[n].value.data.flag) {
/* just check our own data - don't wait
* or request it from someone else */
localonly = true;
}
/* just check our own data - don't wait
* or request it from someone else */
localonly = PMIX_INFO_TRUE(&info[n]);
}
}

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

@ -1301,10 +1301,7 @@ pmix_status_t pmix_server_register_events(pmix_peer_t *peer,
/* see if they asked for enviro events */
for (n=0; n < ninfo; n++) {
if (0 == strcmp(info[n].key, PMIX_EVENT_ENVIRO_LEVEL)) {
if (PMIX_UNDEF == info[n].value.type ||
(PMIX_BOOL == info[n].value.type && info[n].value.data.flag)) {
enviro_events = true;
}
enviro_events = PMIX_INFO_TRUE(&info[n]);
break;
}
}

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

@ -267,11 +267,7 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
PMIX_INFO_LOAD(&ginfo, PMIX_GDS_MODULE, info[n].value.data.string, PMIX_STRING);
found = true;
} else if (0 == strncmp(info[n].key, PMIX_TOOL_DO_NOT_CONNECT, PMIX_MAX_KEYLEN)) {
if (PMIX_UNDEF == info[n].value.type) {
do_not_connect = true;
} else {
do_not_connect = info[n].value.data.flag;
}
do_not_connect = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strncmp(info[n].key, PMIX_TOOL_NSPACE, PMIX_MAX_KEYLEN)) {
(void)strncpy(pmix_globals.myid.nspace, info[n].value.data.string, PMIX_MAX_NSLEN);
nspace_given = true;