Sync to latest PMIx master
Allow the blocking send and recv to keep trying
Этот коммит содержится в:
родитель
f360eebfeb
Коммит
4c47c498ac
@ -30,7 +30,7 @@ greek=a1
|
||||
# command, or with the date (if "git describe" fails) in the form of
|
||||
# "date<date>".
|
||||
|
||||
repo_rev=git6afbc98
|
||||
repo_rev=gita18ba6f
|
||||
|
||||
# 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="Sep 04, 2015"
|
||||
date="Sep 09, 2015"
|
||||
|
||||
# The shared library version of each of PMIx's public libraries.
|
||||
# These versions are maintained in accordance with the "Library
|
||||
|
@ -13,6 +13,8 @@ dnl All rights reserved.
|
||||
dnl Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
|
||||
dnl Copyright (c) 2013 Intel, Inc. All rights reserved
|
||||
dnl Copyright (c) 2015 Cisco Systems, 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
|
||||
@ -91,6 +93,11 @@ AC_DEFUN([_PMIX_CHECK_COMPILER_VENDOR], [
|
||||
[PMIX_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)],
|
||||
[pmix_check_compiler_vendor_result="intel"])])
|
||||
|
||||
# Fujitsu
|
||||
AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"],
|
||||
[PMIX_IF_IFELSE([defined(__FUJITSU)],
|
||||
[pmix_check_compiler_vendor_result="fujitsu"])])
|
||||
|
||||
# GNU
|
||||
AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"],
|
||||
[PMIX_IFDEF_IFELSE([__GNUC__],
|
||||
|
@ -14,6 +14,8 @@
|
||||
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -371,13 +373,13 @@ static void abcbfunc(pmix_status_t status, void *cbdata)
|
||||
PMIX_RELEASE(x);
|
||||
}
|
||||
|
||||
static int abort_fn(const pmix_proc_t *proc,
|
||||
void *server_object,
|
||||
int status, const char msg[],
|
||||
pmix_proc_t procs[], size_t nprocs,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
static pmix_status_t abort_fn(const pmix_proc_t *proc,
|
||||
void *server_object,
|
||||
pmix_status_t status, const char msg[],
|
||||
pmix_proc_t procs[], size_t nprocs,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
myxfer_t *x;
|
||||
|
||||
pmix_output(0, "SERVER: ABORT on %s:%d", procs[0].nspace, procs[0].rank);
|
||||
@ -404,7 +406,7 @@ static int abort_fn(const pmix_proc_t *proc,
|
||||
if (PMIX_SUCCESS != (rc = PMIx_server_notify_error(status, procs, nprocs,
|
||||
&x->caller, 1, x->info, 2,
|
||||
abcbfunc, x))) {
|
||||
pmix_output(0, "SERVER: FAILED NOTIFY ERROR %d", rc);
|
||||
pmix_output(0, "SERVER: FAILED NOTIFY ERROR %d", (int)rc);
|
||||
}
|
||||
|
||||
return PMIX_SUCCESS;
|
||||
@ -472,7 +474,7 @@ static int lookup_fn(const pmix_proc_t *proc, char **keys,
|
||||
pmix_list_t results;
|
||||
size_t i, n;
|
||||
pmix_pdata_t *pd;
|
||||
int ret=PMIX_ERR_NOT_FOUND;
|
||||
pmix_status_t ret = PMIX_ERR_NOT_FOUND;
|
||||
|
||||
pmix_output(0, "SERVER: LOOKUP");
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
|
||||
* Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -100,8 +102,8 @@ BEGIN_C_DECLS
|
||||
|
||||
|
||||
/* Notify the host server that a client connected to us */
|
||||
typedef int (*pmix_server_client_connected_fn_t)(const pmix_proc_t *proc,
|
||||
void* server_object);
|
||||
typedef pmix_status_t (*pmix_server_client_connected_fn_t)(const pmix_proc_t *proc,
|
||||
void* server_object);
|
||||
|
||||
/* Notify the host server that a client called PMIx_Finalize - note
|
||||
* that the client will be in a blocked state until the host server
|
||||
|
@ -12,6 +12,8 @@
|
||||
* 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) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -52,11 +54,11 @@ PMIX_CLASS_DECLARATION(pmix_kval_t);
|
||||
* of places throughout the code base - transferring a value to
|
||||
* another pmix_value_t structure
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_value_xfer(pmix_value_t *kv, pmix_value_t *src);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_value_xfer(pmix_value_t *kv, pmix_value_t *src);
|
||||
PMIX_DECLSPEC void pmix_value_load(pmix_value_t *v, void *data,
|
||||
pmix_data_type_t type);
|
||||
PMIX_DECLSPEC int pmix_value_unload(pmix_value_t *kv, void **data,
|
||||
size_t *sz, pmix_data_type_t type);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_value_unload(pmix_value_t *kv, void **data,
|
||||
size_t *sz, pmix_data_type_t type);
|
||||
|
||||
|
||||
#define PMIX_LOAD_BUFFER(b, d, s) \
|
||||
@ -130,9 +132,9 @@ PMIX_DECLSPEC int pmix_value_unload(pmix_value_t *kv, void **data,
|
||||
* status_code = pmix_bfrop.pack(buffer, &src, 1, PMIX_INT32);
|
||||
* @endcode
|
||||
*/
|
||||
typedef int (*pmix_bfrop_pack_fn_t)(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_values,
|
||||
pmix_data_type_t type);
|
||||
typedef pmix_status_t (*pmix_bfrop_pack_fn_t)(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_values,
|
||||
pmix_data_type_t type);
|
||||
|
||||
/**
|
||||
* Unpack values from a buffer.
|
||||
@ -227,9 +229,9 @@ typedef int (*pmix_bfrop_pack_fn_t)(pmix_buffer_t *buffer, const void *src,
|
||||
*
|
||||
* @endcode
|
||||
*/
|
||||
typedef int (*pmix_bfrop_unpack_fn_t)(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *max_num_values,
|
||||
pmix_data_type_t type);
|
||||
typedef pmix_status_t (*pmix_bfrop_unpack_fn_t)(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *max_num_values,
|
||||
pmix_data_type_t type);
|
||||
/**
|
||||
* Copy a payload from one buffer to another
|
||||
* This function will append a copy of the payload in one buffer into
|
||||
@ -241,8 +243,8 @@ typedef int (*pmix_bfrop_unpack_fn_t)(pmix_buffer_t *buffer, void *dest,
|
||||
* source buffer's payload will remain intact, as will any pre-existing
|
||||
* payload in the destination's buffer.
|
||||
*/
|
||||
typedef int (*pmix_bfrop_copy_payload_fn_t)(pmix_buffer_t *dest,
|
||||
pmix_buffer_t *src);
|
||||
typedef pmix_status_t (*pmix_bfrop_copy_payload_fn_t)(pmix_buffer_t *dest,
|
||||
pmix_buffer_t *src);
|
||||
|
||||
/**
|
||||
* BFROP initialization function.
|
||||
@ -252,12 +254,12 @@ typedef int (*pmix_bfrop_copy_payload_fn_t)(pmix_buffer_t *dest,
|
||||
* structure gets loaded, so we provide an "open" call that is
|
||||
* executed as part of the program startup.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_bfrop_open(void);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_bfrop_open(void);
|
||||
|
||||
/**
|
||||
* BFROP finalize function
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_bfrop_close(void);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_bfrop_close(void);
|
||||
|
||||
|
||||
/**
|
||||
@ -283,7 +285,7 @@ PMIX_DECLSPEC int pmix_bfrop_close(void);
|
||||
* @retval PMIX_ERROR(s) An appropriate error code.
|
||||
*
|
||||
*/
|
||||
typedef int (*pmix_bfrop_copy_fn_t)(void **dest, void *src, pmix_data_type_t type);
|
||||
typedef pmix_status_t (*pmix_bfrop_copy_fn_t)(void **dest, void *src, pmix_data_type_t type);
|
||||
|
||||
/**
|
||||
* Print a data value.
|
||||
@ -296,7 +298,7 @@ typedef int (*pmix_bfrop_copy_fn_t)(void **dest, void *src, pmix_data_type_t typ
|
||||
*
|
||||
* @retval PMIX_ERROR(s) An appropriate error code.
|
||||
*/
|
||||
typedef int (*pmix_bfrop_print_fn_t)(char **output, char *prefix, void *src, pmix_data_type_t type);
|
||||
typedef pmix_status_t (*pmix_bfrop_print_fn_t)(char **output, char *prefix, void *src, pmix_data_type_t type);
|
||||
|
||||
/**
|
||||
* Base structure for the BFROP
|
||||
|
@ -10,6 +10,8 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -166,7 +168,7 @@ int pmix_bfrop_copy_string(char **dest, char *src, pmix_data_type_t type)
|
||||
}
|
||||
|
||||
/* COPY FUNCTIONS FOR GENERIC PMIX TYPES */
|
||||
int pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
|
||||
pmix_status_t pmix_value_xfer(pmix_value_t *p, pmix_value_t *src)
|
||||
{
|
||||
pmix_info_t *p1, *s1;
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -232,11 +234,11 @@ int pmix_bfrop_copy_payload(pmix_buffer_t *dest, pmix_buffer_t *src);
|
||||
/*
|
||||
* Specialized functions
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_bfrop_pack_buffer(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_vals, pmix_data_type_t type);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_bfrop_pack_buffer(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_vals, pmix_data_type_t type);
|
||||
|
||||
PMIX_DECLSPEC int pmix_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
|
||||
/*
|
||||
* Internal pack functions
|
||||
@ -306,21 +308,21 @@ int pmix_bfrop_pack_pdata(pmix_buffer_t *buffer, const void *src,
|
||||
*/
|
||||
int pmix_bfrop_unpack_bool(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_byte(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_string(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
pmix_status_t pmix_bfrop_unpack_byte(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
pmix_status_t pmix_bfrop_unpack_string(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_sizet(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_pid(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
|
||||
int pmix_bfrop_unpack_int(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
pmix_status_t pmix_bfrop_unpack_int(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_int16(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_int32(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
pmix_status_t pmix_bfrop_unpack_int32(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_datatype(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_int64(pmix_buffer_t *buffer, void *dest,
|
||||
@ -340,8 +342,8 @@ int pmix_bfrop_unpack_time(pmix_buffer_t *buffer, void *dest,
|
||||
int pmix_bfrop_unpack_topo(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
#endif
|
||||
int pmix_bfrop_unpack_value(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
pmix_status_t pmix_bfrop_unpack_value(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
int pmix_bfrop_unpack_proc(pmix_buffer_t *buffer, void *dest,
|
||||
@ -464,7 +466,7 @@ pmix_bfrop_type_info_t* pmix_bfrop_find_type(pmix_data_type_t type);
|
||||
|
||||
int pmix_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type);
|
||||
|
||||
int pmix_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type);
|
||||
pmix_status_t pmix_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -49,8 +49,8 @@ bool pmix_bfrop_initialized = false;
|
||||
int pmix_bfrop_initial_size = 0;
|
||||
int pmix_bfrop_threshold_size = 0;
|
||||
pmix_pointer_array_t pmix_bfrop_types = {{0}};
|
||||
pmix_data_type_t pmix_bfrop_num_reg_types = {0};
|
||||
pmix_bfrop_buffer_type_t default_buf_type = PMIX_BFROP_BUFFER_NON_DESC;
|
||||
pmix_data_type_t pmix_bfrop_num_reg_types = PMIX_UNDEF;
|
||||
static pmix_bfrop_buffer_type_t pmix_default_buf_type = PMIX_BFROP_BUFFER_NON_DESC;
|
||||
|
||||
pmix_bfrop_t pmix_bfrop = {
|
||||
pmix_bfrop_pack,
|
||||
@ -67,7 +67,7 @@ pmix_bfrop_t pmix_bfrop = {
|
||||
static void pmix_buffer_construct (pmix_buffer_t* buffer)
|
||||
{
|
||||
/** set the default buffer type */
|
||||
buffer->type = default_buf_type;
|
||||
buffer->type = pmix_default_buf_type;
|
||||
|
||||
/* Make everything NULL to begin with */
|
||||
buffer->base_ptr = buffer->pack_ptr = buffer->unpack_ptr = NULL;
|
||||
@ -155,9 +155,9 @@ PMIX_CLASS_INSTANCE(pmix_regex_value_t,
|
||||
pmix_list_item_t,
|
||||
rvcon, rvdes);
|
||||
|
||||
int pmix_bfrop_open(void)
|
||||
pmix_status_t pmix_bfrop_open(void)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
if (pmix_bfrop_initialized) {
|
||||
return PMIX_SUCCESS;
|
||||
@ -168,9 +168,9 @@ int pmix_bfrop_open(void)
|
||||
* and performance
|
||||
*/
|
||||
#if PMIX_ENABLE_DEBUG
|
||||
default_buf_type = PMIX_BFROP_BUFFER_FULLY_DESC;
|
||||
pmix_default_buf_type = PMIX_BFROP_BUFFER_FULLY_DESC;
|
||||
#else
|
||||
default_buf_type = PMIX_BFROP_BUFFER_NON_DESC;
|
||||
pmix_default_buf_type = PMIX_BFROP_BUFFER_NON_DESC;
|
||||
#endif
|
||||
|
||||
/* Setup the types array */
|
||||
@ -178,7 +178,7 @@ int pmix_bfrop_open(void)
|
||||
if (PMIX_SUCCESS != (rc = pmix_pointer_array_init(&pmix_bfrop_types, 64, 255, 64))) {
|
||||
return rc;
|
||||
}
|
||||
pmix_bfrop_num_reg_types = 0;
|
||||
pmix_bfrop_num_reg_types = PMIX_UNDEF;
|
||||
pmix_bfrop_threshold_size = PMIX_BFROP_DEFAULT_THRESHOLD_SIZE;
|
||||
pmix_bfrop_initial_size = 1;
|
||||
|
||||
@ -377,7 +377,7 @@ int pmix_bfrop_open(void)
|
||||
}
|
||||
|
||||
|
||||
int pmix_bfrop_close(void)
|
||||
pmix_status_t pmix_bfrop_close(void)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
@ -487,10 +487,10 @@ void pmix_value_load(pmix_value_t *v, void *data,
|
||||
}
|
||||
}
|
||||
|
||||
int pmix_value_unload(pmix_value_t *kv, void **data,
|
||||
size_t *sz, pmix_data_type_t type)
|
||||
pmix_status_t pmix_value_unload(pmix_value_t *kv, void **data,
|
||||
size_t *sz, pmix_data_type_t type)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
rc = PMIX_SUCCESS;
|
||||
if (type != kv->type) {
|
||||
|
@ -11,6 +11,8 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -264,7 +266,7 @@ int pmix_bfrop_pack_int64(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_vals, pmix_data_type_t type)
|
||||
{
|
||||
int32_t i;
|
||||
uint64_t tmp, *srctmp = (uint64_t*) src;
|
||||
uint64_t tmp, tmp2;
|
||||
char *dst;
|
||||
size_t bytes_packed = num_vals * sizeof(tmp);
|
||||
|
||||
@ -275,7 +277,8 @@ int pmix_bfrop_pack_int64(pmix_buffer_t *buffer, const void *src,
|
||||
}
|
||||
|
||||
for (i = 0; i < num_vals; ++i) {
|
||||
tmp = pmix_hton64(srctmp[i]);
|
||||
memcpy(&tmp2, (char *)src+i*sizeof(uint64_t), sizeof(uint64_t));
|
||||
tmp = pmix_hton64(tmp2);
|
||||
memcpy(dst, &tmp, sizeof(tmp));
|
||||
dst += sizeof(tmp);
|
||||
}
|
||||
|
@ -11,6 +11,8 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -106,10 +108,10 @@ int pmix_bfrop_unpack(pmix_buffer_t *buffer, void *dst, int32_t *num_vals,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int pmix_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst, int32_t *num_vals,
|
||||
pmix_data_type_t type)
|
||||
pmix_status_t pmix_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst, int32_t *num_vals,
|
||||
pmix_data_type_t type)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_data_type_t local_type;
|
||||
pmix_bfrop_type_info_t *info;
|
||||
|
||||
@ -177,10 +179,10 @@ int pmix_bfrop_unpack_bool(pmix_buffer_t *buffer, void *dest,
|
||||
/*
|
||||
* INT
|
||||
*/
|
||||
int pmix_bfrop_unpack_int(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
pmix_status_t pmix_bfrop_unpack_int(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
{
|
||||
int ret;
|
||||
pmix_status_t ret;
|
||||
pmix_data_type_t remote_type;
|
||||
|
||||
if (PMIX_SUCCESS != (ret = pmix_bfrop_get_data_type(buffer, &remote_type))) {
|
||||
@ -258,8 +260,8 @@ int pmix_bfrop_unpack_pid(pmix_buffer_t *buffer, void *dest,
|
||||
/*
|
||||
* BYTE, CHAR, INT8
|
||||
*/
|
||||
int pmix_bfrop_unpack_byte(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
pmix_status_t pmix_bfrop_unpack_byte(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
{
|
||||
pmix_output_verbose(20, pmix_globals.debug_output, "pmix_bfrop_unpack_byte * %d\n", (int)*num_vals);
|
||||
/* check to see if there's enough data in buffer */
|
||||
@ -299,8 +301,8 @@ int pmix_bfrop_unpack_int16(pmix_buffer_t *buffer, void *dest,
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_bfrop_unpack_int32(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
pmix_status_t pmix_bfrop_unpack_int32(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
{
|
||||
int32_t i;
|
||||
uint32_t tmp, *desttmp = (uint32_t*) dest;
|
||||
@ -351,10 +353,10 @@ int pmix_bfrop_unpack_int64(pmix_buffer_t *buffer, void *dest,
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_bfrop_unpack_string(pmix_buffer_t *buffer, void *dest,
|
||||
pmix_status_t pmix_bfrop_unpack_string(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
{
|
||||
int ret;
|
||||
pmix_status_t ret;
|
||||
int32_t i, len, n=1;
|
||||
char **sdest = (char**) dest;
|
||||
|
||||
@ -501,9 +503,10 @@ int pmix_bfrop_unpack_time(pmix_buffer_t *buffer, void *dest,
|
||||
/*
|
||||
* PMIX_VALUE
|
||||
*/
|
||||
static int unpack_val(pmix_buffer_t *buffer, pmix_value_t *val)
|
||||
static pmix_status_t unpack_val(pmix_buffer_t *buffer, pmix_value_t *val)
|
||||
{
|
||||
int ret, m;
|
||||
int m;
|
||||
pmix_status_t ret;
|
||||
|
||||
m = 1;
|
||||
switch (val->type) {
|
||||
@ -615,12 +618,12 @@ static int unpack_val(pmix_buffer_t *buffer, pmix_value_t *val)
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_bfrop_unpack_value(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
pmix_status_t pmix_bfrop_unpack_value(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
{
|
||||
pmix_value_t *ptr;
|
||||
int32_t i, m, n;
|
||||
int ret;
|
||||
pmix_status_t ret;
|
||||
|
||||
ptr = (pmix_value_t *) dest;
|
||||
n = *num_vals;
|
||||
@ -894,7 +897,7 @@ int pmix_bfrop_unpack_kval(pmix_buffer_t *buffer, void *dest,
|
||||
{
|
||||
pmix_kval_t *ptr;
|
||||
int32_t i, n, m;
|
||||
int ret;
|
||||
pmix_status_t ret;
|
||||
|
||||
pmix_output_verbose(20, pmix_globals.debug_output,
|
||||
"pmix_bfrop_unpack: %d kvals", *num_vals);
|
||||
|
@ -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) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved
|
||||
* $COPYRIGHT$
|
||||
@ -70,7 +70,7 @@ static void pmix_hash_table_destruct(pmix_hash_table_t* ht)
|
||||
}
|
||||
|
||||
|
||||
int pmix_hash_table_init(pmix_hash_table_t* ht, size_t table_size)
|
||||
pmix_status_t pmix_hash_table_init(pmix_hash_table_t* ht, size_t table_size)
|
||||
{
|
||||
size_t i;
|
||||
size_t power2 = pmix_next_poweroftwo (table_size);
|
||||
@ -88,7 +88,7 @@ int pmix_hash_table_init(pmix_hash_table_t* ht, size_t table_size)
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_hash_table_remove_all(pmix_hash_table_t* ht)
|
||||
pmix_status_t pmix_hash_table_remove_all(pmix_hash_table_t* ht)
|
||||
{
|
||||
size_t i;
|
||||
for(i=0; i<ht->ht_table_size; i++) {
|
||||
@ -128,8 +128,8 @@ static PMIX_CLASS_INSTANCE(pmix_uint32_hash_node_t,
|
||||
NULL);
|
||||
|
||||
|
||||
int pmix_hash_table_get_value_uint32(pmix_hash_table_t* ht, uint32_t key,
|
||||
void **ptr)
|
||||
pmix_status_t pmix_hash_table_get_value_uint32(pmix_hash_table_t* ht, uint32_t key,
|
||||
void **ptr)
|
||||
{
|
||||
pmix_list_t* list = ht->ht_table + (key & ht->ht_mask);
|
||||
pmix_uint32_hash_node_t *node;
|
||||
@ -153,8 +153,8 @@ int pmix_hash_table_get_value_uint32(pmix_hash_table_t* ht, uint32_t key,
|
||||
}
|
||||
|
||||
|
||||
int pmix_hash_table_set_value_uint32(pmix_hash_table_t* ht,
|
||||
uint32_t key, void* value)
|
||||
pmix_status_t pmix_hash_table_set_value_uint32(pmix_hash_table_t* ht,
|
||||
uint32_t key, void* value)
|
||||
{
|
||||
pmix_list_t* list = ht->ht_table + (key & ht->ht_mask);
|
||||
pmix_uint32_hash_node_t *node;
|
||||
@ -189,7 +189,7 @@ int pmix_hash_table_set_value_uint32(pmix_hash_table_t* ht,
|
||||
}
|
||||
|
||||
|
||||
int pmix_hash_table_remove_value_uint32(pmix_hash_table_t* ht, uint32_t key)
|
||||
pmix_status_t pmix_hash_table_remove_value_uint32(pmix_hash_table_t* ht, uint32_t key)
|
||||
{
|
||||
pmix_list_t* list = ht->ht_table + (key & ht->ht_mask);
|
||||
pmix_uint32_hash_node_t *node;
|
||||
@ -234,8 +234,8 @@ static PMIX_CLASS_INSTANCE(pmix_uint64_hash_node_t,
|
||||
NULL);
|
||||
|
||||
|
||||
int pmix_hash_table_get_value_uint64(pmix_hash_table_t* ht, uint64_t key,
|
||||
void **ptr)
|
||||
pmix_status_t pmix_hash_table_get_value_uint64(pmix_hash_table_t* ht, uint64_t key,
|
||||
void **ptr)
|
||||
{
|
||||
pmix_list_t* list = ht->ht_table + (key & ht->ht_mask);
|
||||
pmix_uint64_hash_node_t *node;
|
||||
@ -259,7 +259,7 @@ int pmix_hash_table_get_value_uint64(pmix_hash_table_t* ht, uint64_t key,
|
||||
}
|
||||
|
||||
|
||||
int pmix_hash_table_set_value_uint64(pmix_hash_table_t* ht,
|
||||
pmix_status_t pmix_hash_table_set_value_uint64(pmix_hash_table_t* ht,
|
||||
uint64_t key, void* value)
|
||||
{
|
||||
pmix_list_t* list = ht->ht_table + (key & ht->ht_mask);
|
||||
|
@ -10,6 +10,8 @@
|
||||
* 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 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -38,6 +40,8 @@
|
||||
|
||||
#include "src/class/pmix_list.h"
|
||||
|
||||
#include <pmix_common.h>
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_hash_table_t);
|
||||
@ -96,7 +100,7 @@ static inline size_t pmix_hash_table_get_size(pmix_hash_table_t *ht)
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_remove_all(pmix_hash_table_t *ht);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_all(pmix_hash_table_t *ht);
|
||||
|
||||
/**
|
||||
* Retrieve value via uint32_t key.
|
||||
@ -111,8 +115,8 @@ PMIX_DECLSPEC int pmix_hash_table_remove_all(pmix_hash_table_t *ht);
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_get_value_uint32(pmix_hash_table_t* table, uint32_t key,
|
||||
void** ptr);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint32(pmix_hash_table_t* table, uint32_t key,
|
||||
void** ptr);
|
||||
|
||||
/**
|
||||
* Set value based on uint32_t key.
|
||||
@ -124,7 +128,7 @@ PMIX_DECLSPEC int pmix_hash_table_get_value_uint32(pmix_hash_table_t* table, uin
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_set_value_uint32(pmix_hash_table_t* table, uint32_t key, void* value);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint32(pmix_hash_table_t* table, uint32_t key, void* value);
|
||||
|
||||
/**
|
||||
* Remove value based on uint32_t key.
|
||||
@ -135,7 +139,7 @@ PMIX_DECLSPEC int pmix_hash_table_set_value_uint32(pmix_hash_table_t* table, uin
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_remove_value_uint32(pmix_hash_table_t* table, uint32_t key);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint32(pmix_hash_table_t* table, uint32_t key);
|
||||
|
||||
/**
|
||||
* Retrieve value via uint64_t key.
|
||||
@ -150,8 +154,8 @@ PMIX_DECLSPEC int pmix_hash_table_remove_value_uint32(pmix_hash_table_t* table,
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_get_value_uint64(pmix_hash_table_t *table, uint64_t key,
|
||||
void **ptr);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint64(pmix_hash_table_t *table, uint64_t key,
|
||||
void **ptr);
|
||||
|
||||
/**
|
||||
* Set value based on uint64_t key.
|
||||
@ -163,7 +167,7 @@ PMIX_DECLSPEC int pmix_hash_table_get_value_uint64(pmix_hash_table_t *table, uin
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_set_value_uint64(pmix_hash_table_t *table, uint64_t key, void* value);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint64(pmix_hash_table_t *table, uint64_t key, void* value);
|
||||
|
||||
/**
|
||||
* Remove value based on uint64_t key.
|
||||
@ -174,7 +178,7 @@ PMIX_DECLSPEC int pmix_hash_table_set_value_uint64(pmix_hash_table_t *table, uin
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_remove_value_uint64(pmix_hash_table_t *table, uint64_t key);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint64(pmix_hash_table_t *table, uint64_t key);
|
||||
|
||||
/**
|
||||
* Retrieve value via arbitrary length binary key.
|
||||
@ -189,8 +193,8 @@ PMIX_DECLSPEC int pmix_hash_table_remove_value_uint64(pmix_hash_table_t *table,
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_get_value_ptr(pmix_hash_table_t *table, const void* key,
|
||||
size_t keylen, void **ptr);
|
||||
PMIX_DECLSPEC pmix_status_t 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.
|
||||
@ -202,7 +206,7 @@ PMIX_DECLSPEC int pmix_hash_table_get_value_ptr(pmix_hash_table_t *table, const
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_set_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen, void* value);
|
||||
PMIX_DECLSPEC pmix_status_t 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.
|
||||
@ -213,7 +217,7 @@ PMIX_DECLSPEC int pmix_hash_table_set_value_ptr(pmix_hash_table_t *table, const
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_remove_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen);
|
||||
PMIX_DECLSPEC pmix_status_t 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
|
||||
@ -238,8 +242,8 @@ PMIX_DECLSPEC int pmix_hash_table_remove_value_ptr(pmix_hash_table_t *table, con
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_get_first_key_uint32(pmix_hash_table_t *table, uint32_t *key,
|
||||
void **value, void **node);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint32(pmix_hash_table_t *table, uint32_t *key,
|
||||
void **value, void **node);
|
||||
|
||||
|
||||
/**
|
||||
@ -256,9 +260,9 @@ PMIX_DECLSPEC int pmix_hash_table_get_first_key_uint32(pmix_hash_table_t *table,
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_get_next_key_uint32(pmix_hash_table_t *table, uint32_t *key,
|
||||
void **value, void *in_node,
|
||||
void **out_node);
|
||||
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);
|
||||
|
||||
|
||||
/**
|
||||
@ -274,8 +278,8 @@ PMIX_DECLSPEC int pmix_hash_table_get_next_key_uint32(pmix_hash_table_t *table,
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_get_first_key_uint64(pmix_hash_table_t *table, uint64_t *key,
|
||||
void **value, void **node);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint64(pmix_hash_table_t *table, uint64_t *key,
|
||||
void **value, void **node);
|
||||
|
||||
|
||||
/**
|
||||
@ -292,9 +296,9 @@ PMIX_DECLSPEC int pmix_hash_table_get_first_key_uint64(pmix_hash_table_t *table,
|
||||
*
|
||||
*/
|
||||
|
||||
PMIX_DECLSPEC int pmix_hash_table_get_next_key_uint64(pmix_hash_table_t *table, uint64_t *key,
|
||||
void **value, void *in_node,
|
||||
void **out_node);
|
||||
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);
|
||||
|
||||
/**
|
||||
* @brief Returns next power-of-two of the given value.
|
||||
|
@ -11,6 +11,8 @@
|
||||
* 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) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -72,9 +74,9 @@ static void pmix_pointer_array_destruct(pmix_pointer_array_t *array)
|
||||
/**
|
||||
* initialize an array object
|
||||
*/
|
||||
int pmix_pointer_array_init(pmix_pointer_array_t* array,
|
||||
int initial_allocation,
|
||||
int max_size, int block_size)
|
||||
pmix_status_t pmix_pointer_array_init(pmix_pointer_array_t* array,
|
||||
int initial_allocation,
|
||||
int max_size, int block_size)
|
||||
{
|
||||
size_t num_bytes;
|
||||
|
||||
@ -159,8 +161,8 @@ int pmix_pointer_array_add(pmix_pointer_array_t *table, void *ptr)
|
||||
*
|
||||
* Assumption: NULL element is free element.
|
||||
*/
|
||||
int pmix_pointer_array_set_item(pmix_pointer_array_t *table, int index,
|
||||
void * value)
|
||||
pmix_status_t pmix_pointer_array_set_item(pmix_pointer_array_t *table, int index,
|
||||
void * value)
|
||||
{
|
||||
assert(table != NULL);
|
||||
|
||||
@ -283,7 +285,7 @@ bool pmix_pointer_array_test_and_set_item (pmix_pointer_array_t *table,
|
||||
return true;
|
||||
}
|
||||
|
||||
int pmix_pointer_array_set_size(pmix_pointer_array_t *array, int new_size)
|
||||
pmix_status_t pmix_pointer_array_set_size(pmix_pointer_array_t *array, int new_size)
|
||||
{
|
||||
if(new_size > array->size) {
|
||||
if (!grow_table(array, new_size, new_size)) {
|
||||
|
@ -11,6 +11,8 @@
|
||||
* 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) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -28,6 +30,7 @@
|
||||
#endif
|
||||
|
||||
#include "src/class/pmix_object.h"
|
||||
#include <pmix_common.h>
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
@ -76,9 +79,9 @@ 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 int pmix_pointer_array_init( pmix_pointer_array_t* array,
|
||||
int initial_allocation,
|
||||
int max_size, int block_size );
|
||||
PMIX_DECLSPEC pmix_status_t pmix_pointer_array_init(pmix_pointer_array_t* array,
|
||||
int initial_allocation,
|
||||
int max_size, int block_size );
|
||||
|
||||
/**
|
||||
* Add a pointer to the array (Grow the array, if need be)
|
||||
@ -98,10 +101,11 @@ PMIX_DECLSPEC int pmix_pointer_array_add(pmix_pointer_array_t *array, void *ptr)
|
||||
* @param index Index of element to be reset (IN)
|
||||
* @param value New value to be set at element index (IN)
|
||||
*
|
||||
* @return Error code. (-1) indicates an error.
|
||||
* @return PMIX_SUCCESS if item was inserted. Otherwise,
|
||||
* the error indicate what went wrong in the function.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_pointer_array_set_item(pmix_pointer_array_t *array,
|
||||
int index, void *value);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_pointer_array_set_item(pmix_pointer_array_t *array,
|
||||
int index, void *value);
|
||||
|
||||
/**
|
||||
* Get the value of an element in array
|
||||
@ -147,10 +151,13 @@ static inline int pmix_pointer_array_get_size(pmix_pointer_array_t *array)
|
||||
*
|
||||
* @param size Desired size of the array
|
||||
*
|
||||
* @return PMIX_SUCCESS new size was set. Otherwise,
|
||||
* the error indicate what went wrong in the function.
|
||||
*
|
||||
* Simple function to set the size of the array in order to
|
||||
* hide the member field from external users.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_pointer_array_set_size(pmix_pointer_array_t *array, int size);
|
||||
PMIX_DECLSPEC 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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -219,7 +219,8 @@ int PMI2_Info_GetJobAttrIntArray(const char name[], int array[], int arraylen, i
|
||||
|
||||
int PMI2_Nameserv_publish(const char service_name[], const PMI_keyval_t *info_ptr, const char port[])
|
||||
{
|
||||
pmix_status_t rc, nvals;
|
||||
pmix_status_t rc;
|
||||
int nvals;
|
||||
pmix_info_t info[2];
|
||||
|
||||
if (NULL == service_name || NULL == port) {
|
||||
|
@ -69,8 +69,7 @@ static void myerrhandler(pmix_status_t status,
|
||||
static void pmix_client_notify_recv(struct pmix_peer_t *peer, pmix_usock_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_status_t pstatus;
|
||||
int status, rc;
|
||||
pmix_status_t pstatus, status, rc;
|
||||
int32_t cnt;
|
||||
pmix_proc_t *procs=NULL;
|
||||
size_t nprocs, ninfo;
|
||||
@ -170,16 +169,17 @@ static void job_data(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
cb->active = false;
|
||||
}
|
||||
|
||||
static int connect_to_server(struct sockaddr_un *address, void *cbdata)
|
||||
static pmix_status_t connect_to_server(struct sockaddr_un *address, void *cbdata)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t ret;
|
||||
pmix_cmd_t cmd = PMIX_REQ_CMD;
|
||||
pmix_buffer_t *req;
|
||||
|
||||
rc = usock_connect((struct sockaddr *)address);
|
||||
if( rc < 0 ){
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return rc;
|
||||
PMIX_ERROR_LOG((pmix_status_t)rc);
|
||||
return (pmix_status_t)rc;
|
||||
}
|
||||
pmix_client_globals.myserver.sd = rc;
|
||||
/* setup recv event */
|
||||
@ -203,10 +203,10 @@ static int connect_to_server(struct sockaddr_un *address, void *cbdata)
|
||||
* transaction because some systems cannot handle very large
|
||||
* blocking operations and error out if we try them. */
|
||||
req = PMIX_NEW(pmix_buffer_t);
|
||||
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(req, &cmd, 1, PMIX_CMD))) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
if (PMIX_SUCCESS != (ret = pmix_bfrop.pack(req, &cmd, 1, PMIX_CMD))) {
|
||||
PMIX_ERROR_LOG(ret);
|
||||
PMIX_RELEASE(req);
|
||||
return rc;
|
||||
return ret;
|
||||
}
|
||||
PMIX_ACTIVATE_SEND_RECV(&pmix_client_globals.myserver, req, job_data, cbdata);
|
||||
|
||||
@ -230,8 +230,7 @@ int PMIx_Init(pmix_proc_t *proc)
|
||||
return PMIX_ERR_BAD_PARAM;
|
||||
}
|
||||
|
||||
++pmix_globals.init_cntr;
|
||||
if (1 < pmix_globals.init_cntr) {
|
||||
if (0 < pmix_globals.init_cntr) {
|
||||
/* since we have been called before, the nspace and
|
||||
* rank should be known. So return them here if
|
||||
* requested */
|
||||
@ -339,6 +338,9 @@ int PMIx_Init(pmix_proc_t *proc)
|
||||
rc = cb.status;
|
||||
PMIX_DESTRUCT(&cb);
|
||||
|
||||
if (PMIX_SUCCESS == rc) {
|
||||
pmix_globals.init_cntr++;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -350,12 +352,12 @@ int PMIx_Initialized(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
int PMIx_Finalize(void)
|
||||
pmix_status_t PMIx_Finalize(void)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cb_t *cb;
|
||||
pmix_cmd_t cmd = PMIX_FINALIZE_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
if (1 != pmix_globals.init_cntr) {
|
||||
--pmix_globals.init_cntr;
|
||||
@ -426,7 +428,7 @@ int PMIx_Abort(int flag, const char msg[],
|
||||
{
|
||||
pmix_buffer_t *bfr;
|
||||
pmix_cmd_t cmd = PMIX_ABORT_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -491,7 +493,7 @@ int PMIx_Abort(int flag, const char msg[],
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int PMIx_Put(pmix_scope_t scope, const char key[], pmix_value_t *val)
|
||||
pmix_status_t PMIx_Put(pmix_scope_t scope, const char key[], pmix_value_t *val)
|
||||
{
|
||||
pmix_status_t rc;
|
||||
pmix_kval_t *kv;
|
||||
@ -560,7 +562,7 @@ int PMIx_Put(pmix_scope_t scope, const char key[], pmix_value_t *val)
|
||||
|
||||
pmix_status_t PMIx_Commit(void)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_scope_t scope;
|
||||
pmix_buffer_t *msgout;
|
||||
pmix_cmd_t cmd=PMIX_COMMIT_CMD;
|
||||
@ -700,7 +702,7 @@ pmix_status_t PMIx_Resolve_nodes(const char *nspace, char **nodelist)
|
||||
}
|
||||
|
||||
|
||||
static int send_connect_ack(int sd)
|
||||
static pmix_status_t send_connect_ack(int sd)
|
||||
{
|
||||
char *msg;
|
||||
pmix_usock_hdr_t hdr;
|
||||
@ -771,10 +773,10 @@ static int send_connect_ack(int sd)
|
||||
/* we receive a connection acknowledgement from the server,
|
||||
* consisting of nothing more than a status report. If success,
|
||||
* then we initiate authentication method */
|
||||
static int recv_connect_ack(int sd)
|
||||
static pmix_status_t recv_connect_ack(int sd)
|
||||
{
|
||||
int reply;
|
||||
int rc;
|
||||
pmix_status_t reply;
|
||||
pmix_status_t rc;
|
||||
struct timeval tv, save;
|
||||
pmix_socklen_t sz;
|
||||
|
||||
@ -987,7 +989,8 @@ void pmix_client_process_nspace_blob(const char *nspace, pmix_buffer_t *bptr)
|
||||
|
||||
static int usock_connect(struct sockaddr *addr)
|
||||
{
|
||||
int rc, sd=-1;
|
||||
int sd=-1;
|
||||
pmix_status_t rc;
|
||||
pmix_socklen_t addrlen = 0;
|
||||
int retries = 0;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
@ -99,13 +99,13 @@ int PMIx_Connect(const pmix_proc_t procs[], size_t nprocs,
|
||||
return rc;
|
||||
}
|
||||
|
||||
int PMIx_Connect_nb(const pmix_proc_t procs[], size_t nprocs,
|
||||
const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
pmix_status_t PMIx_Connect_nb(const pmix_proc_t procs[], size_t nprocs,
|
||||
const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cmd_t cmd = PMIX_CONNECTNB_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -206,13 +206,13 @@ int PMIx_Disconnect(const pmix_proc_t procs[], size_t nprocs,
|
||||
return rc;
|
||||
}
|
||||
|
||||
int PMIx_Disconnect_nb(const pmix_proc_t procs[], size_t nprocs,
|
||||
const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
pmix_status_t PMIx_Disconnect_nb(const pmix_proc_t procs[], size_t nprocs,
|
||||
const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cmd_t cmd = PMIX_DISCONNECTNB_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -283,7 +283,8 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
int rc, ret;
|
||||
pmix_status_t rc;
|
||||
pmix_status_t ret;
|
||||
int32_t cnt;
|
||||
char *nspace;
|
||||
pmix_buffer_t *bptr;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
@ -163,9 +163,10 @@ int PMIx_Fence_nb(const pmix_proc_t procs[], size_t nprocs,
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
static int unpack_return(pmix_buffer_t *data)
|
||||
static pmix_status_t unpack_return(pmix_buffer_t *data)
|
||||
{
|
||||
int rc, ret;
|
||||
pmix_status_t rc;
|
||||
int ret;
|
||||
int32_t cnt;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -179,14 +180,14 @@ static int unpack_return(pmix_buffer_t *data)
|
||||
}
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
"client:unpack fence received status %d", ret);
|
||||
return ret;
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
static int pack_fence(pmix_buffer_t *msg, pmix_cmd_t cmd,
|
||||
const pmix_proc_t *procs, size_t nprocs,
|
||||
const pmix_info_t *info, size_t ninfo)
|
||||
static pmix_status_t pack_fence(pmix_buffer_t *msg, pmix_cmd_t cmd,
|
||||
const pmix_proc_t *procs, size_t nprocs,
|
||||
const pmix_info_t *info, size_t ninfo)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
/* pack the cmd */
|
||||
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &cmd, 1, PMIX_CMD))) {
|
||||
@ -224,7 +225,7 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
"pmix: fence_nb callback recvd");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
@ -107,14 +107,14 @@ int PMIx_Get(const pmix_proc_t *proc, const char key[],
|
||||
return rc;
|
||||
}
|
||||
|
||||
int 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)
|
||||
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)
|
||||
{
|
||||
pmix_value_t *val;
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cb_t *cb;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
char *nm;
|
||||
pmix_nspace_t *ns, *nptr;
|
||||
|
||||
@ -324,7 +324,7 @@ static pmix_buffer_t* pack_get(char *nspace, int rank,
|
||||
pmix_cmd_t cmd)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
/* nope - see if we can get it */
|
||||
msg = PMIX_NEW(pmix_buffer_t);
|
||||
@ -367,7 +367,7 @@ static void getnb_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
{
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
pmix_cb_t *cb2;
|
||||
int rc, ret;
|
||||
pmix_status_t rc, ret;
|
||||
pmix_value_t *val = NULL;
|
||||
int32_t cnt;
|
||||
pmix_buffer_t *bptr;
|
||||
@ -488,7 +488,7 @@ static void getnb_shortcut(int fd, short flags, void *cbdata)
|
||||
{
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
pmix_value_t val;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
int32_t m;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
@ -61,10 +61,10 @@ static void wait_lookup_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
static void lookup_cbfunc(int status, pmix_pdata_t pdata[], size_t ndata,
|
||||
void *cbdata);
|
||||
|
||||
int PMIx_Publish(const pmix_info_t info[],
|
||||
size_t ninfo)
|
||||
pmix_status_t PMIx_Publish(const pmix_info_t info[],
|
||||
size_t ninfo)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -91,18 +91,18 @@ int PMIx_Publish(const pmix_info_t info[],
|
||||
|
||||
/* wait for the server to ack our request */
|
||||
PMIX_WAIT_FOR_COMPLETION(cb->active);
|
||||
rc = cb->status;
|
||||
rc = (pmix_status_t)cb->status;
|
||||
PMIX_RELEASE(cb);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int PMIx_Publish_nb(const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
pmix_status_t PMIx_Publish_nb(const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cmd_t cmd = PMIX_PUBLISHNB_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -214,12 +214,12 @@ int PMIx_Lookup(pmix_pdata_t pdata[], size_t ndata,
|
||||
return rc;
|
||||
}
|
||||
|
||||
int PMIx_Lookup_nb(char **keys, const pmix_info_t info[], size_t ninfo,
|
||||
pmix_lookup_cbfunc_t cbfunc, void *cbdata)
|
||||
pmix_status_t PMIx_Lookup_nb(char **keys, const pmix_info_t info[], size_t ninfo,
|
||||
pmix_lookup_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cmd_t cmd = PMIX_LOOKUPNB_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
size_t nkeys, n;
|
||||
|
||||
@ -320,17 +320,17 @@ int PMIx_Unpublish(char **keys, const pmix_info_t info[], size_t ninfo)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int PMIx_Unpublish_nb(char **keys, const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
pmix_status_t PMIx_Unpublish_nb(char **keys, const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cmd_t cmd = PMIX_UNPUBLISHNB_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
size_t i, j;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
"pmix: unpublish_nb called");
|
||||
"pmix: unpublish called");
|
||||
|
||||
if (pmix_globals.init_cntr <= 0) {
|
||||
return PMIX_ERR_INIT;
|
||||
@ -396,7 +396,8 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
int rc, ret;
|
||||
pmix_status_t rc;
|
||||
int ret;
|
||||
int32_t cnt;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -407,10 +408,9 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
cnt = 1;
|
||||
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(buf, &ret, &cnt, PMIX_INT))) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
ret = rc;
|
||||
}
|
||||
if (NULL != cb->op_cbfunc) {
|
||||
cb->op_cbfunc(ret, cb->cbdata);
|
||||
cb->op_cbfunc(rc, cb->cbdata);
|
||||
}
|
||||
PMIX_RELEASE(cb);
|
||||
}
|
||||
@ -427,7 +427,7 @@ static void wait_lookup_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
int rc, ret;
|
||||
pmix_status_t rc, ret;
|
||||
int32_t cnt;
|
||||
pmix_pdata_t *pdata;
|
||||
size_t ndata;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
@ -101,13 +101,13 @@ int PMIx_Spawn(const pmix_info_t job_info[], size_t ninfo,
|
||||
return rc;
|
||||
}
|
||||
|
||||
int PMIx_Spawn_nb(const pmix_info_t job_info[], size_t ninfo,
|
||||
const pmix_app_t apps[], size_t napps,
|
||||
pmix_spawn_cbfunc_t cbfunc, void *cbdata)
|
||||
pmix_status_t PMIx_Spawn_nb(const pmix_info_t job_info[], size_t ninfo,
|
||||
const pmix_app_t apps[], size_t napps,
|
||||
pmix_spawn_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
pmix_buffer_t *msg;
|
||||
pmix_cmd_t cmd = PMIX_SPAWNNB_CMD;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_cb_t *cb;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -176,7 +176,7 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
char nspace[PMIX_MAX_NSLEN+1];
|
||||
char *n2;
|
||||
int rc, ret;
|
||||
pmix_status_t rc, ret;
|
||||
int32_t cnt;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
@ -212,7 +212,7 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
}
|
||||
}
|
||||
|
||||
static void spawn_cbfunc(int status, char nspace[], void *cbdata)
|
||||
static void spawn_cbfunc(pmix_status_t status, char nspace[], void *cbdata)
|
||||
{
|
||||
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
* Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -98,21 +100,21 @@ typedef char* (*pmix_sec_base_module_create_cred_fn_t)(void);
|
||||
* (and indeed, would be rare) for a protocol to use both the
|
||||
* credential and handshake interfaces. It is acceptable, therefore,
|
||||
* for one of them to be NULL */
|
||||
typedef int (*pmix_sec_base_module_client_hndshk_fn_t)(int sd);
|
||||
typedef pmix_status_t (*pmix_sec_base_module_client_hndshk_fn_t)(int sd);
|
||||
|
||||
|
||||
/**** SERVER-SIDE FUNCTIONS ****/
|
||||
/**
|
||||
* Validate a client's credential
|
||||
*/
|
||||
typedef int (*pmix_sec_base_module_validate_cred_fn_t)(pmix_peer_t *peer, char *cred);
|
||||
typedef pmix_status_t (*pmix_sec_base_module_validate_cred_fn_t)(pmix_peer_t *peer, char *cred);
|
||||
|
||||
/**
|
||||
* Perform the server-side handshake. Note that it is not required
|
||||
* (and indeed, would be rare) for a protocol to use both the
|
||||
* credential and handshake interfaces. It is acceptable, therefore,
|
||||
* for one of them to be NULL */
|
||||
typedef int (*pmix_sec_base_module_server_hndshk_fn_t)(pmix_peer_t *peer);
|
||||
typedef pmix_status_t (*pmix_sec_base_module_server_hndshk_fn_t)(pmix_peer_t *peer);
|
||||
|
||||
/**
|
||||
* Struct for holding CPC module function pointers
|
||||
|
@ -272,7 +272,7 @@ static pmix_status_t initialize_server_base(pmix_server_module_t *module)
|
||||
pmix_status_t PMIx_server_init(pmix_server_module_t *module)
|
||||
{
|
||||
pmix_usock_posted_recv_t *req;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
++pmix_globals.init_cntr;
|
||||
if (1 < pmix_globals.init_cntr) {
|
||||
@ -786,7 +786,7 @@ static void _dmodex_req(int sd, short args, void *cbdata)
|
||||
char *data = NULL;
|
||||
size_t sz = 0;
|
||||
pmix_dmdx_remote_t *dcd;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
"DMODX LOOKING FOR %s:%d",
|
||||
@ -903,7 +903,7 @@ pmix_status_t PMIx_server_dmodex_request(const pmix_proc_t *proc,
|
||||
static void _notify_error(int sd, short args, void *cbdata)
|
||||
{
|
||||
pmix_notify_caddy_t *cd = (pmix_notify_caddy_t*)cbdata;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
int i;
|
||||
size_t j;
|
||||
pmix_peer_t *peer;
|
||||
@ -1510,7 +1510,7 @@ static void _spcb(int sd, short args, void *cbdata)
|
||||
cd->active = false;
|
||||
}
|
||||
|
||||
static void spawn_cbfunc(int status, char *nspace, void *cbdata)
|
||||
static void spawn_cbfunc(pmix_status_t status, char *nspace, void *cbdata)
|
||||
{
|
||||
pmix_shift_caddy_t *cd;
|
||||
|
||||
@ -1525,12 +1525,12 @@ static void spawn_cbfunc(int status, char *nspace, void *cbdata)
|
||||
PMIX_RELEASE(cd);
|
||||
}
|
||||
|
||||
static void lookup_cbfunc(int status, pmix_pdata_t pdata[], size_t ndata,
|
||||
static void lookup_cbfunc(pmix_status_t status, pmix_pdata_t pdata[], size_t ndata,
|
||||
void *cbdata)
|
||||
{
|
||||
pmix_server_caddy_t *cd = (pmix_server_caddy_t*)cbdata;
|
||||
pmix_buffer_t *reply;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
/* no need to thread-shift as no global data is accessed */
|
||||
|
||||
@ -1571,7 +1571,8 @@ static void _mdxcbfunc(int sd, short argc, void *cbdata)
|
||||
pmix_nspace_t *nptr, *ns;
|
||||
pmix_server_caddy_t *cd;
|
||||
char *nspace;
|
||||
int rank, rc;
|
||||
int rank;
|
||||
pmix_status_t rc;
|
||||
int32_t cnt = 1;
|
||||
char byte;
|
||||
|
||||
@ -1731,7 +1732,7 @@ finish_collective:
|
||||
}
|
||||
PMIX_RELEASE(scd);
|
||||
}
|
||||
static void modex_cbfunc(int status, const char *data, size_t ndata, void *cbdata,
|
||||
static void modex_cbfunc(pmix_status_t status, const char *data, size_t ndata, void *cbdata,
|
||||
pmix_release_cbfunc_t relfn, void *relcbd)
|
||||
{
|
||||
pmix_server_trkr_t *tracker = (pmix_server_trkr_t*)cbdata;
|
||||
@ -1760,12 +1761,12 @@ static void modex_cbfunc(int status, const char *data, size_t ndata, void *cbdat
|
||||
PMIX_THREADSHIFT(scd, _mdxcbfunc);
|
||||
}
|
||||
|
||||
static void get_cbfunc(int status, const char *data, size_t ndata, void *cbdata,
|
||||
static void get_cbfunc(pmix_status_t status, const char *data, size_t ndata, void *cbdata,
|
||||
pmix_release_cbfunc_t relfn, void *relcbd)
|
||||
{
|
||||
pmix_server_caddy_t *cd = (pmix_server_caddy_t*)cbdata;
|
||||
pmix_buffer_t *reply, buf;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
"server:get_cbfunc called with %d elements", (int)ndata);
|
||||
@ -1813,7 +1814,8 @@ static void _cnct(int sd, short args, void *cbdata)
|
||||
pmix_shift_caddy_t *scd = (pmix_shift_caddy_t*)cbdata;
|
||||
pmix_server_trkr_t *tracker = scd->tracker;
|
||||
pmix_buffer_t *reply;
|
||||
int rc, i;
|
||||
pmix_status_t rc;
|
||||
int i;
|
||||
pmix_server_caddy_t *cd;
|
||||
char **nspaces=NULL;
|
||||
pmix_nspace_t *nptr;
|
||||
@ -1868,7 +1870,7 @@ static void _cnct(int sd, short args, void *cbdata)
|
||||
PMIX_RELEASE(scd);
|
||||
}
|
||||
|
||||
static void cnct_cbfunc(int status, void *cbdata)
|
||||
static void cnct_cbfunc(pmix_status_t status, void *cbdata)
|
||||
{
|
||||
pmix_server_trkr_t *tracker = (pmix_server_trkr_t*)cbdata;
|
||||
pmix_shift_caddy_t *scd;
|
||||
@ -1906,10 +1908,10 @@ static void cnct_cbfunc(int status, void *cbdata)
|
||||
* Should an error be encountered at any time within the switchyard, an
|
||||
* error reply buffer will be returned so that the caller can be notified,
|
||||
* thereby preventing the process from hanging. */
|
||||
static int server_switchyard(pmix_peer_t *peer, uint32_t tag,
|
||||
pmix_buffer_t *buf)
|
||||
static pmix_status_t server_switchyard(pmix_peer_t *peer, uint32_t tag,
|
||||
pmix_buffer_t *buf)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
int32_t cnt;
|
||||
pmix_cmd_t cmd;
|
||||
pmix_server_caddy_t *cd;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
@ -67,9 +67,10 @@ static pthread_t engine;
|
||||
/*
|
||||
* start listening on our rendezvous file
|
||||
*/
|
||||
int pmix_start_listening(struct sockaddr_un *address)
|
||||
pmix_status_t pmix_start_listening(struct sockaddr_un *address)
|
||||
{
|
||||
int flags, rc;
|
||||
int flags;
|
||||
pmix_status_t rc;
|
||||
unsigned int addrlen;
|
||||
char *ptr;
|
||||
|
||||
@ -77,30 +78,30 @@ int pmix_start_listening(struct sockaddr_un *address)
|
||||
pmix_server_globals.listen_socket = socket(PF_UNIX, SOCK_STREAM, 0);
|
||||
if (pmix_server_globals.listen_socket < 0) {
|
||||
printf("%s:%d socket() failed", __FILE__, __LINE__);
|
||||
return -1;
|
||||
return PMIX_ERROR;
|
||||
}
|
||||
|
||||
addrlen = sizeof(struct sockaddr_un);
|
||||
if (bind(pmix_server_globals.listen_socket, (struct sockaddr*)address, addrlen) < 0) {
|
||||
printf("%s:%d bind() failed", __FILE__, __LINE__);
|
||||
return -1;
|
||||
return PMIX_ERROR;
|
||||
}
|
||||
|
||||
/* setup listen backlog to maximum allowed by kernel */
|
||||
if (listen(pmix_server_globals.listen_socket, SOMAXCONN) < 0) {
|
||||
printf("%s:%d listen() failed", __FILE__, __LINE__);
|
||||
return -1;
|
||||
return PMIX_ERROR;
|
||||
}
|
||||
|
||||
/* set socket up to be non-blocking, otherwise accept could block */
|
||||
if ((flags = fcntl(pmix_server_globals.listen_socket, F_GETFL, 0)) < 0) {
|
||||
printf("%s:%d fcntl(F_GETFL) failed", __FILE__, __LINE__);
|
||||
return -1;
|
||||
return PMIX_ERROR;
|
||||
}
|
||||
flags |= O_NONBLOCK;
|
||||
if (fcntl(pmix_server_globals.listen_socket, F_SETFL, flags) < 0) {
|
||||
printf("%s:%d fcntl(F_SETFL) failed", __FILE__, __LINE__);
|
||||
return -1;
|
||||
return PMIX_ERROR;
|
||||
}
|
||||
|
||||
/* setup my version for validating connections - we
|
||||
@ -138,14 +139,13 @@ int pmix_start_listening(struct sockaddr_un *address)
|
||||
return PMIX_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
/* fork off the listener thread */
|
||||
if (PMIX_SUCCESS != (rc = pthread_create(&engine, NULL, listen_thread, NULL))) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return rc;
|
||||
if (0 > pthread_create(&engine, NULL, listen_thread, NULL)) {
|
||||
return PMIX_ERROR;
|
||||
}
|
||||
pmix_server_globals.listen_thread_active = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
void pmix_stop_listening(void)
|
||||
@ -292,7 +292,8 @@ static pmix_status_t pmix_server_authenticate(int sd, int *out_rank,
|
||||
pmix_peer_t **peer)
|
||||
{
|
||||
char *msg, *nspace, *version, *cred;
|
||||
int rc, rank;
|
||||
pmix_status_t rc;
|
||||
int rank;
|
||||
pmix_usock_hdr_t hdr;
|
||||
pmix_nspace_t *nptr, *tmp;
|
||||
pmix_rank_info_t *info;
|
||||
|
@ -84,7 +84,7 @@ static pmix_status_t _satisfy_request(pmix_nspace_t *nptr, int rank,
|
||||
pmix_hash_table_t *ht,
|
||||
pmix_modex_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
pmix_buffer_t pbkt, xfer;
|
||||
pmix_value_t *val;
|
||||
char *data;
|
||||
@ -120,7 +120,7 @@ pmix_status_t pmix_pending_request(pmix_nspace_t *nptr, int rank,
|
||||
pmix_dmdx_local_t *lcd = NULL, *cd;
|
||||
pmix_rank_info_t *iptr;
|
||||
pmix_hash_table_t *ht;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
/* 1. Try to satisfy the request right now */
|
||||
|
||||
@ -1256,6 +1256,7 @@ pmix_status_t pmix_server_connect(pmix_server_caddy_t *cd,
|
||||
pmix_server_trkr_t *trk;
|
||||
pmix_info_t *info = NULL;
|
||||
size_t ninfo=0;
|
||||
pmix_cmd_t type = PMIX_CONNECTNB_CMD;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
"recvd CONNECT from peer %s:%d",
|
||||
@ -1305,7 +1306,6 @@ pmix_status_t pmix_server_connect(pmix_server_caddy_t *cd,
|
||||
}
|
||||
|
||||
/* find/create the local tracker for this operation */
|
||||
pmix_cmd_t type = PMIX_CONNECTNB_CMD;
|
||||
if (disconnect) {
|
||||
type = PMIX_DISCONNECTNB_CMD;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
@ -120,7 +120,7 @@ void pmix_pack_proc_map(pmix_buffer_t *buf,
|
||||
pmix_status_t pmix_regex_parse_nodes(const char *regexp, char ***names)
|
||||
{
|
||||
char *tmp, *ptr;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
/* set default */
|
||||
*names = NULL;
|
||||
@ -162,7 +162,7 @@ pmix_status_t pmix_regex_parse_nodes(const char *regexp, char ***names)
|
||||
pmix_status_t pmix_regex_parse_procs(const char *regexp, char ***procs)
|
||||
{
|
||||
char *tmp, *ptr;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
/* set default */
|
||||
*procs = NULL;
|
||||
@ -203,7 +203,8 @@ pmix_status_t pmix_regex_parse_procs(const char *regexp, char ***procs)
|
||||
|
||||
static pmix_status_t pmix_regex_extract_nodes(char *regexp, char ***names)
|
||||
{
|
||||
int i, j, k, len, ret;
|
||||
int i, j, k, len;
|
||||
pmix_status_t ret;
|
||||
char *base;
|
||||
char *orig, *suffix;
|
||||
bool found_range = false;
|
||||
@ -350,7 +351,8 @@ static pmix_status_t regex_parse_value_ranges(char *base, char *ranges,
|
||||
int num_digits, char *suffix,
|
||||
char ***names)
|
||||
{
|
||||
int i, len, ret;
|
||||
int i, len;
|
||||
pmix_status_t ret;
|
||||
char *start, *orig;
|
||||
|
||||
/* Look for commas, the separator between ranges */
|
||||
@ -403,7 +405,7 @@ static pmix_status_t regex_parse_value_range(char *base, char *range,
|
||||
size_t i, k, start, end;
|
||||
size_t base_len, len;
|
||||
bool found;
|
||||
int ret;
|
||||
pmix_status_t ret;
|
||||
|
||||
if (NULL == base || NULL == range) {
|
||||
return PMIX_ERROR;
|
||||
|
@ -115,19 +115,27 @@ int pmix_usock_set_blocking(int sd)
|
||||
* A blocking send on a non-blocking socket. Used to send the small amount of connection
|
||||
* information that identifies the peers endpoint.
|
||||
*/
|
||||
int pmix_usock_send_blocking(int sd, char *ptr, size_t size)
|
||||
pmix_status_t pmix_usock_send_blocking(int sd, char *ptr, size_t size)
|
||||
{
|
||||
size_t cnt = 0;
|
||||
int retval;
|
||||
|
||||
pmix_output_verbose(10, pmix_globals.debug_output,
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"send blocking of %"PRIsize_t" bytes to socket %d",
|
||||
size, sd );
|
||||
while (cnt < size) {
|
||||
retval = send(sd, (char*)ptr+cnt, size-cnt, 0);
|
||||
if (retval < 0) {
|
||||
if (EAGAIN == pmix_socket_errno ||
|
||||
EWOULDBLOCK == pmix_socket_errno) {
|
||||
/* just cycle and let it try again */
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"blocking_send received error %d:%s from remote - cycling",
|
||||
pmix_socket_errno, strerror(pmix_socket_errno));
|
||||
continue;
|
||||
}
|
||||
if (pmix_socket_errno != EINTR) {
|
||||
pmix_output(0, "usock_peer_send_blocking: send() to socket %d failed: %s (%d)\n",
|
||||
pmix_output(8, "usock_peer_send_blocking: send() to socket %d failed: %s (%d)\n",
|
||||
sd, strerror(pmix_socket_errno),
|
||||
pmix_socket_errno);
|
||||
return PMIX_ERR_UNREACH;
|
||||
@ -137,7 +145,7 @@ int pmix_usock_send_blocking(int sd, char *ptr, size_t size)
|
||||
cnt += retval;
|
||||
}
|
||||
|
||||
pmix_output_verbose(10, pmix_globals.debug_output,
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"blocking send complete to socket %d", sd);
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
@ -146,25 +154,33 @@ int pmix_usock_send_blocking(int sd, char *ptr, size_t size)
|
||||
* A blocking recv on a non-blocking socket. Used to receive the small amount of connection
|
||||
* information that identifies the peers endpoint.
|
||||
*/
|
||||
int pmix_usock_recv_blocking(int sd, char *data, size_t size)
|
||||
pmix_status_t pmix_usock_recv_blocking(int sd, char *data, size_t size)
|
||||
{
|
||||
size_t cnt = 0;
|
||||
|
||||
pmix_output_verbose(10, pmix_globals.debug_output,
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"waiting for blocking recv of %"PRIsize_t" bytes", size);
|
||||
|
||||
while (cnt < size) {
|
||||
int retval = recv(sd, (char *)data+cnt, size-cnt, 0);
|
||||
int retval = recv(sd, (char *)data+cnt, size-cnt, MSG_WAITALL);
|
||||
|
||||
/* remote closed connection */
|
||||
if (retval == 0) {
|
||||
pmix_output_verbose(10, pmix_globals.debug_output,
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"usock_recv_blocking: remote closed connection");
|
||||
return PMIX_ERR_UNREACH;
|
||||
}
|
||||
|
||||
/* handle errors */
|
||||
if (retval < 0) {
|
||||
if (EAGAIN == pmix_socket_errno ||
|
||||
EWOULDBLOCK == pmix_socket_errno) {
|
||||
/* just cycle and let it try again */
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"blocking_recv received error %d:%s from remote - cycling",
|
||||
pmix_socket_errno, strerror(pmix_socket_errno));
|
||||
continue;
|
||||
}
|
||||
if (pmix_socket_errno != EINTR ) {
|
||||
/* If we overflow the listen backlog, it's
|
||||
possible that even though we finished the three
|
||||
@ -180,8 +196,8 @@ int pmix_usock_recv_blocking(int sd, char *data, size_t size)
|
||||
CONNECT_ACK and propogate the error up to
|
||||
recv_connect_ack, who will try to establish the
|
||||
connection again */
|
||||
pmix_output_verbose(10, pmix_globals.debug_output,
|
||||
"blocking_recv received error %d:%s from remote",
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"blocking_recv received error %d:%s from remote - aborting",
|
||||
pmix_socket_errno, strerror(pmix_socket_errno));
|
||||
return PMIX_ERR_UNREACH;
|
||||
}
|
||||
@ -190,7 +206,7 @@ int pmix_usock_recv_blocking(int sd, char *data, size_t size)
|
||||
cnt += retval;
|
||||
}
|
||||
|
||||
pmix_output_verbose(10, pmix_globals.debug_output,
|
||||
pmix_output_verbose(8, pmix_globals.debug_output,
|
||||
"blocking receive complete from remote");
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -264,8 +266,8 @@ void pmix_usock_init(pmix_usock_cbfunc_t cbfunc);
|
||||
void pmix_usock_finalize(void);
|
||||
int pmix_usock_set_nonblocking(int sd);
|
||||
int pmix_usock_set_blocking(int sd);
|
||||
int pmix_usock_send_blocking(int sd, char *ptr, size_t size);
|
||||
int pmix_usock_recv_blocking(int sd, char *data, size_t size);
|
||||
pmix_status_t pmix_usock_send_blocking(int sd, char *ptr, size_t size);
|
||||
pmix_status_t pmix_usock_recv_blocking(int sd, char *data, size_t size);
|
||||
void pmix_usock_send_recv(int sd, short args, void *cbdata);
|
||||
void pmix_usock_send_handler(int sd, short flags, void *cbdata);
|
||||
void pmix_usock_recv_handler(int sd, short flags, void *cbdata);
|
||||
|
@ -2,6 +2,8 @@
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -41,9 +43,10 @@
|
||||
|
||||
static uint32_t current_tag = 1; // 0 is reserved for system purposes
|
||||
|
||||
static int send_bytes(int sd, char **buf, size_t *remain)
|
||||
static pmix_status_t send_bytes(int sd, char **buf, size_t *remain)
|
||||
{
|
||||
int ret = PMIX_SUCCESS, rc;
|
||||
pmix_status_t ret = PMIX_SUCCESS;
|
||||
int rc;
|
||||
char *ptr = *buf;
|
||||
while (0 < *remain) {
|
||||
rc = write(sd, ptr, *remain);
|
||||
@ -141,7 +144,7 @@ void pmix_usock_send_handler(int sd, short flags, void *cbdata)
|
||||
{
|
||||
pmix_peer_t *peer = (pmix_peer_t*)cbdata;
|
||||
pmix_usock_send_t *msg = peer->send_msg;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||
"sock:send_handler SENDING TO PEER %s:%d with %s msg",
|
||||
|
@ -13,6 +13,8 @@
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -40,9 +42,9 @@
|
||||
/*
|
||||
* Append a string to the end of a new or existing argv array.
|
||||
*/
|
||||
int pmix_argv_append(int *argc, char ***argv, const char *arg)
|
||||
pmix_status_t pmix_argv_append(int *argc, char ***argv, const char *arg)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
/* add the new element */
|
||||
if (PMIX_SUCCESS != (rc = pmix_argv_append_nosize(argv, arg))) {
|
||||
@ -54,7 +56,7 @@ int pmix_argv_append(int *argc, char ***argv, const char *arg)
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_argv_append_nosize(char ***argv, const char *arg)
|
||||
pmix_status_t pmix_argv_append_nosize(char ***argv, const char *arg)
|
||||
{
|
||||
int argc;
|
||||
|
||||
@ -94,7 +96,7 @@ int pmix_argv_append_nosize(char ***argv, const char *arg)
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_argv_prepend_nosize(char ***argv, const char *arg)
|
||||
pmix_status_t pmix_argv_prepend_nosize(char ***argv, const char *arg)
|
||||
{
|
||||
int argc;
|
||||
int i;
|
||||
@ -128,7 +130,7 @@ int pmix_argv_prepend_nosize(char ***argv, const char *arg)
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_argv_append_unique_nosize(char ***argv, const char *arg, bool overwrite)
|
||||
pmix_status_t pmix_argv_append_unique_nosize(char ***argv, const char *arg, bool overwrite)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -442,7 +444,7 @@ char **pmix_argv_copy(char **argv)
|
||||
}
|
||||
|
||||
|
||||
int pmix_argv_delete(int *argc, char ***argv, int start, int num_to_delete)
|
||||
pmix_status_t pmix_argv_delete(int *argc, char ***argv, int start, int num_to_delete)
|
||||
{
|
||||
int i;
|
||||
int count;
|
||||
@ -495,7 +497,7 @@ int pmix_argv_delete(int *argc, char ***argv, int start, int num_to_delete)
|
||||
}
|
||||
|
||||
|
||||
int pmix_argv_insert(char ***target, int start, char **source)
|
||||
pmix_status_t pmix_argv_insert(char ***target, int start, char **source)
|
||||
{
|
||||
int i, source_count, target_count;
|
||||
int suffix_count;
|
||||
@ -548,7 +550,7 @@ int pmix_argv_insert(char ***target, int start, char **source)
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_argv_insert_element(char ***target, int location, char *source)
|
||||
pmix_status_t pmix_argv_insert_element(char ***target, int location, char *source)
|
||||
{
|
||||
int i, target_count;
|
||||
int suffix_count;
|
||||
|
@ -15,6 +15,8 @@
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved.
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -39,6 +41,8 @@
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <pmix_common.h>
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
@ -70,7 +74,7 @@ BEGIN_C_DECLS
|
||||
* value into the argv array; there is no need to keep the original
|
||||
* string (i.e., the arg parameter) after invoking this function.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_argv_append(int *argc, char ***argv, const char *arg) __pmix_attribute_nonnull__(1) __pmix_attribute_nonnull__(3);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_argv_append(int *argc, char ***argv, const char *arg) __pmix_attribute_nonnull__(1) __pmix_attribute_nonnull__(3);
|
||||
|
||||
/**
|
||||
* Append to an argv-style array, but ignore the size of the array.
|
||||
@ -87,7 +91,7 @@ PMIX_DECLSPEC int pmix_argv_append(int *argc, char ***argv, const char *arg) __
|
||||
* argv-style arrays that do not have integers that are actively
|
||||
* maintaing their sizes.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_argv_append_nosize(char ***argv, const char *arg);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_argv_append_nosize(char ***argv, const char *arg);
|
||||
|
||||
/**
|
||||
* Insert the provided arg at the beginning of the array
|
||||
@ -98,7 +102,7 @@ PMIX_DECLSPEC int pmix_argv_append_nosize(char ***argv, const char *arg);
|
||||
* @retval PMIX_SUCCESS On success
|
||||
* @retval PMIX_ERROR On failure
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_argv_prepend_nosize(char ***argv, const char *arg);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_argv_prepend_nosize(char ***argv, const char *arg);
|
||||
|
||||
/**
|
||||
* Append to an argv-style array, but only if the provided argument
|
||||
@ -115,7 +119,7 @@ PMIX_DECLSPEC int pmix_argv_prepend_nosize(char ***argv, const char *arg);
|
||||
* except that it only appends the provided argument if it does not already
|
||||
* exist in the provided array, or overwrites it if it is.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_argv_append_unique_nosize(char ***argv, const char *arg, bool overwrite);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_argv_append_unique_nosize(char ***argv, const char *arg, bool overwrite);
|
||||
|
||||
/**
|
||||
* Free a NULL-terminated argv array.
|
||||
@ -248,8 +252,8 @@ PMIX_DECLSPEC char **pmix_argv_copy(char **argv) __pmix_attribute_malloc__ __pm
|
||||
* free()ed (it is assumed that the argv "owns" the memory that
|
||||
* the pointer points to).
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_argv_delete(int *argc, char ***argv,
|
||||
int start, int num_to_delete);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_argv_delete(int *argc, char ***argv,
|
||||
int start, int num_to_delete);
|
||||
|
||||
/**
|
||||
* Insert one argv array into the middle of another
|
||||
@ -272,7 +276,7 @@ PMIX_DECLSPEC int pmix_argv_delete(int *argc, char ***argv,
|
||||
* source points to are strdup'ed into the new locations in
|
||||
* target).
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_argv_insert(char ***target, int start, char **source);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_argv_insert(char ***target, int start, char **source);
|
||||
|
||||
/**
|
||||
* Insert one argv element in front of a specific position in an array
|
||||
@ -295,7 +299,7 @@ PMIX_DECLSPEC int pmix_argv_insert(char ***target, int start, char **source);
|
||||
* source points to is strdup'ed into the new location in
|
||||
* target).
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_argv_insert_element(char ***target, int location, char *source);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_argv_insert_element(char ***target, int location, char *source);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
* Copyright (c) 2009 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -26,7 +28,7 @@
|
||||
/*
|
||||
* Simple loop over reading from a fd
|
||||
*/
|
||||
int pmix_fd_read(int fd, int len, void *buffer)
|
||||
pmix_status_t pmix_fd_read(int fd, int len, void *buffer)
|
||||
{
|
||||
int rc;
|
||||
char *b = buffer;
|
||||
@ -51,7 +53,7 @@ int pmix_fd_read(int fd, int len, void *buffer)
|
||||
/*
|
||||
* Simple loop over writing to an fd
|
||||
*/
|
||||
int pmix_fd_write(int fd, int len, const void *buffer)
|
||||
pmix_status_t pmix_fd_write(int fd, int len, const void *buffer)
|
||||
{
|
||||
int rc;
|
||||
const char *b = buffer;
|
||||
@ -72,7 +74,7 @@ int pmix_fd_write(int fd, int len, const void *buffer)
|
||||
}
|
||||
|
||||
|
||||
int pmix_fd_set_cloexec(int fd)
|
||||
pmix_status_t pmix_fd_set_cloexec(int fd)
|
||||
{
|
||||
#ifdef FD_CLOEXEC
|
||||
int flags;
|
||||
|
@ -3,6 +3,8 @@
|
||||
* Copyright (c) 2009 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
*
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -34,7 +36,7 @@ BEGIN_C_DECLS
|
||||
* Loop over reading from the fd until len bytes are read or an error
|
||||
* occurs. EAGAIN and EINTR are transparently handled.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_fd_read(int fd, int len, void *buffer);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_fd_read(int fd, int len, void *buffer);
|
||||
|
||||
/**
|
||||
* Write a complete buffer to a file descriptor.
|
||||
@ -49,7 +51,7 @@ PMIX_DECLSPEC int pmix_fd_read(int fd, int len, void *buffer);
|
||||
* Loop over writing to the fd until len bytes are written or an error
|
||||
* occurs. EAGAIN and EINTR are transparently handled.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_fd_write(int fd, int len, const void *buffer);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_fd_write(int fd, int len, const void *buffer);
|
||||
|
||||
/**
|
||||
* Convenience function to set a file descriptor to be close-on-exec.
|
||||
@ -63,7 +65,7 @@ PMIX_DECLSPEC int pmix_fd_write(int fd, int len, const void *buffer);
|
||||
* This is simply a convenience function because there's a few steps
|
||||
* to setting a file descriptor to be close-on-exec.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_fd_set_cloexec(int fd);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_fd_set_cloexec(int fd);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
* Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -98,13 +100,13 @@ int pmix_hash_store(pmix_hash_table_t *table,
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
int pmix_hash_fetch(pmix_hash_table_t *table, int rank,
|
||||
const char *key, pmix_value_t **kvs)
|
||||
pmix_status_t pmix_hash_fetch(pmix_hash_table_t *table, int rank,
|
||||
const char *key, pmix_value_t **kvs)
|
||||
{
|
||||
pmix_proc_data_t *proc_data;
|
||||
pmix_kval_t *hv;
|
||||
uint64_t id;
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
|
||||
pmix_output_verbose(10, pmix_globals.debug_output,
|
||||
"HASH:FETCH rank %d key %s",
|
||||
|
@ -2,6 +2,8 @@
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -22,13 +24,13 @@ BEGIN_C_DECLS
|
||||
|
||||
/* store a value in the given hash table for the specified
|
||||
* rank index.*/
|
||||
int pmix_hash_store(pmix_hash_table_t *table,
|
||||
int rank, pmix_kval_t *kv);
|
||||
pmix_status_t pmix_hash_store(pmix_hash_table_t *table,
|
||||
int rank, pmix_kval_t *kv);
|
||||
|
||||
/* Fetch the value for a specified key from within
|
||||
* the given hash_table */
|
||||
int pmix_hash_fetch(pmix_hash_table_t *table, int rank,
|
||||
const char *key, pmix_value_t **kvs);
|
||||
pmix_status_t pmix_hash_fetch(pmix_hash_table_t *table, int rank,
|
||||
const char *key, pmix_value_t **kvs);
|
||||
|
||||
/* remove the specified key-value from the given hash_table.
|
||||
* A NULL key will result in removal of all data for the
|
||||
@ -37,8 +39,8 @@ int pmix_hash_fetch(pmix_hash_table_t *table, int rank,
|
||||
* ranks in the table. Combining key=NULL with rank=PMIX_RANK_WILDCARD
|
||||
* will therefore result in removal of all data from the
|
||||
* table */
|
||||
int pmix_hash_remove_data(pmix_hash_table_t *table,
|
||||
int rank, const char *key);
|
||||
pmix_status_t pmix_hash_remove_data(pmix_hash_table_t *table,
|
||||
int rank, const char *key);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -35,6 +37,8 @@
|
||||
#include <crt_externs.h>
|
||||
#endif
|
||||
|
||||
#include <pmix_common.h>
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
@ -125,7 +129,7 @@ PMIX_DECLSPEC int pmix_setenv(const char *name, const char *value,
|
||||
* If \em name is found in \em env, the string corresponding to
|
||||
* that entry is freed and its entry is eliminated from the array.
|
||||
*/
|
||||
PMIX_DECLSPEC int pmix_unsetenv(const char *name, char ***env) __pmix_attribute_nonnull__(1);
|
||||
PMIX_DECLSPEC pmix_status_t pmix_unsetenv(const char *name, char ***env) __pmix_attribute_nonnull__(1);
|
||||
|
||||
/* A consistent way to retrieve the home and tmp directory on all supported
|
||||
* platforms.
|
||||
|
@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -51,7 +53,6 @@ static void* progress_engine(void *obj)
|
||||
|
||||
pmix_event_base_t* pmix_start_progress_thread()
|
||||
{
|
||||
int rc;
|
||||
pmix_event_base_t *ev_base;
|
||||
/* Setup threading */
|
||||
evthread_use_pthreads();
|
||||
@ -83,8 +84,8 @@ pmix_event_base_t* pmix_start_progress_thread()
|
||||
block_active = true;
|
||||
|
||||
/* fork off a thread to progress it */
|
||||
if (PMIX_SUCCESS != (rc = pthread_create(&engine, NULL, progress_engine, (void*)ev_base))) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
if (0 > pthread_create(&engine, NULL, progress_engine, (void*)ev_base)) {
|
||||
PMIX_ERROR_LOG(PMIX_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
if (!thread_initalized) {
|
||||
|
@ -1,6 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Artem Polyakov <artpol84@gmail.com>
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -70,9 +72,6 @@ void pmix_init_id(char* nspace, int rank);
|
||||
* Initialize timing structure.
|
||||
*
|
||||
* @param t pointer to the timing handler structure
|
||||
*
|
||||
* @retval PMIX_SUCCESS On success
|
||||
* @retval PMIX_ERROR On failure
|
||||
*/
|
||||
void pmix_timing_init(pmix_timing_t *t);
|
||||
|
||||
@ -208,7 +207,7 @@ void pmix_timing_end_prep(pmix_timing_prep_t p,
|
||||
* @retval PMIX_SUCCESS On success
|
||||
* @retval PMIX_ERROR or PMIX_ERR_OUT_OF_RESOURCE On failure
|
||||
*/
|
||||
int pmix_timing_report(pmix_timing_t *t, char *fname);
|
||||
pmix_status_t pmix_timing_report(pmix_timing_t *t, char *fname);
|
||||
|
||||
/**
|
||||
* Report all intervals that were enqueued in the timing handler 't'.
|
||||
@ -225,7 +224,7 @@ int pmix_timing_report(pmix_timing_t *t, char *fname);
|
||||
* @retval PMIX_SUCCESS On success
|
||||
* @retval PMIX_ERROR or PMIX_ERR_OUT_OF_RESOURCE On failure
|
||||
*/
|
||||
int pmix_timing_deltas(pmix_timing_t *t, char *fname);
|
||||
pmix_status_t pmix_timing_deltas(pmix_timing_t *t, char *fname);
|
||||
|
||||
/**
|
||||
* Release all memory allocated for the timing handler 't'.
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -25,7 +27,7 @@ int cli_rank(cli_info_t *cli)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void cli_init(int nprocs, int order[])
|
||||
void cli_init(int nprocs, cli_state_t order[])
|
||||
{
|
||||
int n, i;
|
||||
cli_info = malloc( sizeof(cli_info_t) * nprocs);
|
||||
@ -124,7 +126,7 @@ void cli_terminate(cli_info_t *cli)
|
||||
|
||||
void cli_cleanup(cli_info_t *cli)
|
||||
{
|
||||
if (0 > cli->state || CLI_TERM < cli->state) {
|
||||
if (CLI_TERM < cli->state) {
|
||||
TEST_ERROR(("Bad rank %d state %d", cli_rank(cli), cli->state));
|
||||
test_abort = true;
|
||||
return;
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -29,7 +31,7 @@
|
||||
|
||||
// In correct scenario each client has to sequentially pass all of this stages
|
||||
typedef enum {
|
||||
CLI_UNINIT, CLI_FORKED, CLI_CONNECTED, CLI_FIN, CLI_DISCONN, CLI_TERM
|
||||
CLI_UNINIT, CLI_FORKED, CLI_CONNECTED, CLI_FIN, CLI_DISCONN, CLI_TERM, CLI_UNDEF
|
||||
} cli_state_t;
|
||||
|
||||
typedef struct {
|
||||
@ -48,7 +50,7 @@ extern int cli_info_cnt;
|
||||
extern bool test_abort;
|
||||
|
||||
int cli_rank(cli_info_t *cli);
|
||||
void cli_init(int nprocs, int order[]);
|
||||
void cli_init(int nprocs, cli_state_t order[]);
|
||||
void cli_connect(cli_info_t *cli, int sd, struct event_base * ebase, event_callback_fn callback);
|
||||
void cli_finalize(cli_info_t *cli);
|
||||
void cli_disconnect(cli_info_t *cli);
|
||||
|
@ -14,6 +14,8 @@
|
||||
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -40,7 +42,7 @@ int main(int argc, char **argv)
|
||||
struct stat stat_buf;
|
||||
struct timeval tv;
|
||||
double test_start;
|
||||
int order[CLI_TERM+1];
|
||||
cli_state_t order[CLI_TERM+1];
|
||||
test_params params;
|
||||
INIT_TEST_PARAMS(params);
|
||||
int test_fail = 0;
|
||||
@ -87,10 +89,10 @@ int main(int argc, char **argv)
|
||||
|
||||
order[CLI_UNINIT] = CLI_FORKED;
|
||||
order[CLI_FORKED] = CLI_FIN;
|
||||
order[CLI_CONNECTED] = -1;
|
||||
order[CLI_CONNECTED] = CLI_UNDEF;
|
||||
order[CLI_FIN] = CLI_TERM;
|
||||
order[CLI_DISCONN] = -1;
|
||||
order[CLI_TERM] = -1;
|
||||
order[CLI_DISCONN] = CLI_UNDEF;
|
||||
order[CLI_TERM] = CLI_UNDEF;
|
||||
cli_init(params.nprocs, order);
|
||||
|
||||
/* set common argv and env */
|
||||
|
@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -248,7 +250,7 @@ int unpublish_fn(const pmix_proc_t *proc, char **keys,
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
int status;
|
||||
pmix_status_t status;
|
||||
pmix_spawn_cbfunc_t cbfunc;
|
||||
void *cbdata;
|
||||
} release_cbdata;
|
||||
|
@ -14,6 +14,8 @@
|
||||
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -383,11 +385,11 @@ static void abcbfunc(pmix_status_t status, void *cbdata)
|
||||
|
||||
static int abort_fn(const pmix_proc_t *proc,
|
||||
void *server_object,
|
||||
int status, const char msg[],
|
||||
pmix_status_t status, const char msg[],
|
||||
pmix_proc_t procs[], size_t nprocs,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
int rc;
|
||||
pmix_status_t rc;
|
||||
myxfer_t *x;
|
||||
|
||||
pmix_output(0, "SERVER: ABORT on %s:%d", procs[0].nspace, procs[0].rank);
|
||||
@ -414,7 +416,7 @@ static int abort_fn(const pmix_proc_t *proc,
|
||||
if (PMIX_SUCCESS != (rc = PMIx_server_notify_error(status, procs, nprocs,
|
||||
&x->caller, 1, x->info, 2,
|
||||
abcbfunc, x))) {
|
||||
pmix_output(0, "SERVER: FAILED NOTIFY ERROR %d", rc);
|
||||
pmix_output(0, "SERVER: FAILED NOTIFY ERROR %d", (int)rc);
|
||||
}
|
||||
|
||||
return PMIX_SUCCESS;
|
||||
@ -482,7 +484,7 @@ static int lookup_fn(const pmix_proc_t *proc, char **keys,
|
||||
pmix_list_t results;
|
||||
size_t i, n;
|
||||
pmix_pdata_t *pd;
|
||||
int ret=PMIX_ERR_NOT_FOUND;
|
||||
pmix_status_t ret = PMIX_ERR_NOT_FOUND;
|
||||
|
||||
pmix_output(0, "SERVER: LOOKUP");
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -39,7 +41,7 @@ extern FILE *file;
|
||||
#define STRIPPED_FILE_NAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
#define TEST_OUTPUT(x) { \
|
||||
fprintf(file,"%s:%s: %s\n",STRIPPED_FILE_NAME, __FUNCTION__, \
|
||||
fprintf(file,"%s:%s: %s\n",STRIPPED_FILE_NAME, __func__, \
|
||||
pmix_test_output_prepare x ); \
|
||||
fflush(file); \
|
||||
}
|
||||
@ -53,7 +55,7 @@ extern FILE *file;
|
||||
|
||||
// Always write errors to the stderr
|
||||
#define TEST_ERROR(x) { \
|
||||
fprintf(stderr,"ERROR [%s:%d:%s]: %s\n", STRIPPED_FILE_NAME, __LINE__, __FUNCTION__, \
|
||||
fprintf(stderr,"ERROR [%s:%d:%s]: %s\n", STRIPPED_FILE_NAME, __LINE__, __func__, \
|
||||
pmix_test_output_prepare x ); \
|
||||
fflush(stderr); \
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ void pmix1_value_load(pmix_value_t *v,
|
||||
break;
|
||||
case OPAL_SIZE:
|
||||
v->type = PMIX_SIZE;
|
||||
memcpy(&(v->data.size), &kv->data.size, sizeof(size_t));
|
||||
v->data.size = (size_t)kv->data.size;
|
||||
break;
|
||||
case OPAL_PID:
|
||||
v->type = PMIX_PID;
|
||||
@ -344,7 +344,7 @@ void pmix1_value_load(pmix_value_t *v,
|
||||
if (NULL != kv->data.bo.bytes) {
|
||||
v->data.bo.bytes = (char*)malloc(kv->data.bo.size);
|
||||
memcpy(v->data.bo.bytes, kv->data.bo.bytes, kv->data.bo.size);
|
||||
memcpy(&(v->data.bo.size), &kv->data.bo.size, sizeof(size_t));
|
||||
v->data.bo.size = (size_t)kv->data.bo.size;
|
||||
} else {
|
||||
v->data.bo.bytes = NULL;
|
||||
v->data.bo.size = 0;
|
||||
@ -382,7 +382,7 @@ int pmix1_value_unload(opal_value_t *kv,
|
||||
break;
|
||||
case PMIX_SIZE:
|
||||
kv->type = OPAL_SIZE;
|
||||
memcpy(&kv->data.size, &(v->data.size), sizeof(size_t));
|
||||
kv->data.size = (int)v->data.size;
|
||||
break;
|
||||
case PMIX_PID:
|
||||
kv->type = OPAL_PID;
|
||||
@ -444,7 +444,7 @@ int pmix1_value_unload(opal_value_t *kv,
|
||||
kv->type = OPAL_BYTE_OBJECT;
|
||||
if (NULL != v->data.bo.bytes && 0 < v->data.bo.size) {
|
||||
kv->data.bo.bytes = (uint8_t*)v->data.bo.bytes;
|
||||
kv->data.bo.size = v->data.bo.size;
|
||||
kv->data.bo.size = (int)v->data.bo.size;
|
||||
} else {
|
||||
kv->data.bo.bytes = NULL;
|
||||
kv->data.bo.size = 0;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user