From 4c47c498ace8fe0c0965e807e83c9b04cb5a7857 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 9 Sep 2015 09:55:59 -0700 Subject: [PATCH] Sync to latest PMIx master Allow the blocking send and recv to keep trying --- opal/mca/pmix/pmix1xx/pmix/INSTALL | 2 +- opal/mca/pmix/pmix1xx/pmix/VERSION | 4 +- .../pmix1xx/pmix/config/pmix_check_vendor.m4 | 7 +++ .../pmix1xx/pmix/contrib/pmix-valgrind.supp | 4 +- opal/mca/pmix/pmix1xx/pmix/examples/server.c | 18 +++--- opal/mca/pmix/pmix1xx/pmix/include/pmi.h | 16 +++--- opal/mca/pmix/pmix1xx/pmix/include/pmi2.h | 56 +++++++++---------- .../pmix/include/pmix/autogen/config.h.in | 10 ++-- .../pmix/pmix1xx/pmix/include/pmix_server.h | 6 +- .../pmix/pmix1xx/pmix/include/private/align.h | 6 +- .../pmix/include/private/hash_string.h | 4 +- .../pmix/include/private/pmix_socket_errno.h | 6 +- .../pmix/include/private/pmix_stdint.h | 10 ++-- .../pmix1xx/pmix/include/private/prefetch.h | 4 +- .../pmix/pmix1xx/pmix/include/private/types.h | 10 ++-- .../pmix1xx/pmix/src/buffer_ops/buffer_ops.h | 32 ++++++----- .../pmix/pmix1xx/pmix/src/buffer_ops/copy.c | 4 +- .../pmix1xx/pmix/src/buffer_ops/internal.h | 32 ++++++----- .../pmix1xx/pmix/src/buffer_ops/open_close.c | 24 ++++---- .../pmix/pmix1xx/pmix/src/buffer_ops/pack.c | 7 ++- .../pmix/pmix1xx/pmix/src/buffer_ops/unpack.c | 39 +++++++------ .../pmix1xx/pmix/src/class/pmix_hash_table.c | 22 ++++---- .../pmix1xx/pmix/src/class/pmix_hash_table.h | 50 +++++++++-------- .../pmix/src/class/pmix_pointer_array.c | 14 +++-- .../pmix/src/class/pmix_pointer_array.h | 21 ++++--- opal/mca/pmix/pmix1xx/pmix/src/client/pmi2.c | 5 +- .../pmix1xx/pmix/src/client/pmix_client.c | 43 +++++++------- .../pmix/src/client/pmix_client_connect.c | 21 +++---- .../pmix/src/client/pmix_client_fence.c | 19 ++++--- .../pmix1xx/pmix/src/client/pmix_client_get.c | 16 +++--- .../pmix1xx/pmix/src/client/pmix_client_pub.c | 38 ++++++------- .../pmix/src/client/pmix_client_spawn.c | 14 ++--- opal/mca/pmix/pmix1xx/pmix/src/sec/pmix_sec.h | 8 ++- .../pmix1xx/pmix/src/server/pmix_server.c | 32 ++++++----- .../pmix/src/server/pmix_server_listener.c | 27 ++++----- .../pmix1xx/pmix/src/server/pmix_server_ops.c | 6 +- .../pmix/src/server/pmix_server_regex.c | 14 +++-- opal/mca/pmix/pmix1xx/pmix/src/usock/usock.c | 38 +++++++++---- opal/mca/pmix/pmix1xx/pmix/src/usock/usock.h | 6 +- .../pmix1xx/pmix/src/usock/usock_sendrecv.c | 9 ++- opal/mca/pmix/pmix1xx/pmix/src/util/argv.c | 18 +++--- opal/mca/pmix/pmix1xx/pmix/src/util/argv.h | 20 ++++--- opal/mca/pmix/pmix1xx/pmix/src/util/fd.c | 8 ++- opal/mca/pmix/pmix1xx/pmix/src/util/fd.h | 8 ++- opal/mca/pmix/pmix1xx/pmix/src/util/hash.c | 8 ++- opal/mca/pmix/pmix1xx/pmix/src/util/hash.h | 14 +++-- .../pmix/pmix1xx/pmix/src/util/pmix_environ.h | 6 +- .../pmix1xx/pmix/src/util/progress_threads.c | 7 ++- opal/mca/pmix/pmix1xx/pmix/src/util/timings.h | 9 ++- opal/mca/pmix/pmix1xx/pmix/test/README | 2 +- opal/mca/pmix/pmix1xx/pmix/test/cli_stages.c | 6 +- opal/mca/pmix/pmix1xx/pmix/test/cli_stages.h | 6 +- opal/mca/pmix/pmix1xx/pmix/test/pmi2_client.c | 6 +- opal/mca/pmix/pmix1xx/pmix/test/pmi_client.c | 4 +- opal/mca/pmix/pmix1xx/pmix/test/pmix_regex.c | 4 +- opal/mca/pmix/pmix1xx/pmix/test/pmix_test.c | 10 ++-- .../pmix/pmix1xx/pmix/test/server_callbacks.c | 4 +- .../pmix/pmix1xx/pmix/test/simple/simpdyn.c | 14 ++--- .../pmix/pmix1xx/pmix/test/simple/simpft.c | 10 ++-- .../pmix/pmix1xx/pmix/test/simple/simptest.c | 10 ++-- opal/mca/pmix/pmix1xx/pmix/test/test_common.h | 6 +- opal/mca/pmix/pmix1xx/pmix_pmix1.c | 8 +-- 62 files changed, 496 insertions(+), 396 deletions(-) diff --git a/opal/mca/pmix/pmix1xx/pmix/INSTALL b/opal/mca/pmix/pmix1xx/pmix/INSTALL index 9f3d23ab29..74db17e5ff 100644 --- a/opal/mca/pmix/pmix1xx/pmix/INSTALL +++ b/opal/mca/pmix/pmix1xx/pmix/INSTALL @@ -4,7 +4,7 @@ Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana Copyright (c) 2004-2005 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved. -Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, University of Stuttgart. All rights reserved. Copyright (c) 2004-2005 The Regents of the University of California. All rights reserved. diff --git a/opal/mca/pmix/pmix1xx/pmix/VERSION b/opal/mca/pmix/pmix1xx/pmix/VERSION index 8c8c2f0550..9cb15f99e6 100644 --- a/opal/mca/pmix/pmix1xx/pmix/VERSION +++ b/opal/mca/pmix/pmix1xx/pmix/VERSION @@ -30,7 +30,7 @@ greek=a1 # command, or with the date (if "git describe" fails) in the form of # "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 diff --git a/opal/mca/pmix/pmix1xx/pmix/config/pmix_check_vendor.m4 b/opal/mca/pmix/pmix1xx/pmix/config/pmix_check_vendor.m4 index cacff68cf4..ba3f1a5a8d 100644 --- a/opal/mca/pmix/pmix1xx/pmix/config/pmix_check_vendor.m4 +++ b/opal/mca/pmix/pmix1xx/pmix/config/pmix_check_vendor.m4 @@ -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__], diff --git a/opal/mca/pmix/pmix1xx/pmix/contrib/pmix-valgrind.supp b/opal/mca/pmix/pmix1xx/pmix/contrib/pmix-valgrind.supp index 4de2cf66b3..94651905c7 100644 --- a/opal/mca/pmix/pmix1xx/pmix/contrib/pmix-valgrind.supp +++ b/opal/mca/pmix/pmix1xx/pmix/contrib/pmix-valgrind.supp @@ -2,9 +2,9 @@ # # Copyright (c) 2015 Intel, Inc. All rights reserved. # $COPYRIGHT$ -# +# # Additional copyrights may follow -# +# # $HEADER$ # diff --git a/opal/mca/pmix/pmix1xx/pmix/examples/server.c b/opal/mca/pmix/pmix1xx/pmix/examples/server.c index 388384dd82..d10946fd6e 100644 --- a/opal/mca/pmix/pmix1xx/pmix/examples/server.c +++ b/opal/mca/pmix/pmix1xx/pmix/examples/server.c @@ -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"); diff --git a/opal/mca/pmix/pmix1xx/pmix/include/pmi.h b/opal/mca/pmix/pmix1xx/pmix/include/pmi.h index 328eee1175..bc09ca1ed9 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/pmi.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/pmi.h @@ -220,7 +220,7 @@ Return values: int PMI_Get_appnum( int *appnum ); /*@ -PMI_Publish_name - publish a name +PMI_Publish_name - publish a name Input parameters: . service_name - string representing the service being published @@ -444,7 +444,7 @@ This function returns the string length required to store a keyval space name. A routine is used rather than setting a maximum value in 'pmi.h' to allow different implementations of PMI to be used with the same executable. These -different implementations may allow different maximum lengths; by using a +different implementations may allow different maximum lengths; by using a routine here, we can interface with a variety of implementations of PMI. @*/ @@ -544,7 +544,7 @@ Return values: Notes: This function puts the key/value pair in the specified keyval space. The -value is not visible to other processes until 'PMI_KVS_Commit()' is called. +value is not visible to other processes until 'PMI_KVS_Commit()' is called. The function may complete locally. After 'PMI_KVS_Commit()' is called, the value may be retrieved by calling 'PMI_KVS_Get()'. All keys put to a keyval space must be unique to the keyval space. You may not put more than once @@ -649,7 +649,7 @@ Return values: - PMI_FAIL - failed to get the next keyval pair Notes: -This function retrieves the next keyval pair from the specified keyval space. +This function retrieves the next keyval pair from the specified keyval space. 'PMI_KVS_Iter_first()' must have been previously called. The end of the keyval space is specified by returning an empty key string. The output parameters, key and val, must be at least as long as the values returned by @@ -682,7 +682,7 @@ Input Parameters: . cmds - array of command strings . argvs - array of argv arrays for each command string . maxprocs - array of maximum processes to spawn for each command string -. info_keyval_sizes - array giving the number of elements in each of the +. info_keyval_sizes - array giving the number of elements in each of the 'info_keyval_vectors' . info_keyval_vectors - array of keyval vector arrays . preput_keyval_size - Number of elements in 'preput_keyval_vector' @@ -703,7 +703,7 @@ field refers to the size of the array parameters - 'cmd', 'argvs', 'maxprocs', to the size of the 'preput_keyval_vector' array. The 'preput_keyval_vector' contains keyval pairs that will be put in the keyval space of the newly created process group before the processes are started. The 'maxprocs' array -specifies the desired number of processes to create for each 'cmd' string. +specifies the desired number of processes to create for each 'cmd' string. The actual number of processes may be less than the numbers specified in maxprocs. The acceptable number of processes spawned may be controlled by ``soft'' keyvals in the info arrays. The ``soft'' option is specified by @@ -774,7 +774,7 @@ Notes: This function removes PMI specific arguments from the command line and creates the corresponding 'PMI_keyval_t' structures for them. It returns an array and size to the caller that can then be passed to 'PMI_Spawn_multiple()'. -The array can be freed by 'PMI_Free_keyvals()'. The routine 'free()' should +The array can be freed by 'PMI_Free_keyvals()'. The routine 'free()' should not be used to free this array as there is no requirement that the array be allocated with 'malloc()'. @@ -795,7 +795,7 @@ Return values: Notes: This function frees the data returned by 'PMI_Args_to_keyval' and 'PMI_Parse_option'. - Using this routine instead of 'free' allows the PMI package to track + Using this routine instead of 'free' allows the PMI package to track allocation of storage or to use interal storage as it sees fit. @*/ int PMI_Free_keyvals(PMI_keyval_t keyvalp[], int size); diff --git a/opal/mca/pmix/pmix1xx/pmix/include/pmi2.h b/opal/mca/pmix/pmix1xx/pmix/include/pmi2.h index 9dbf67e3dd..a01de5f30d 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/pmi2.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/pmi2.h @@ -89,7 +89,7 @@ typedef struct PMI_keyval_t cannot access the KVS spaces of another job (this may happen, for example, if each mpiexec creates the KVS spaces for the processes that it manages). - + @*/ typedef struct PMI2_Connect_comm { int (*read)( void *buf, int maxlen, void *ctx ); @@ -107,10 +107,10 @@ typedef struct PMI2_Connect_comm { . size - number of processes in the job . rank - rank of this process in the job - appnum - which executable is this on the mpiexec commandline - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. - + Notes: Initialize PMI for this process group. The value of spawned indicates whether this process was created by 'PMI2_Spawn_multiple'. 'spawned' will be non-zero @@ -121,13 +121,13 @@ int PMI2_Init(int *spawned, int *size, int *rank, int *appnum); /*@ PMI2_Finalize - finalize the Process Manager Interface - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. - + Notes: Finalize PMI for this job. - + @*/ int PMI2_Finalize(void); @@ -136,17 +136,17 @@ int PMI2_Finalize(void); Return values: Non-zero if PMI2_Initialize has been called successfully, zero otherwise. - + @*/ int PMI2_Initialized(void); /*@ PMI2_Abort - abort the process group associated with this process - + Input Parameters: + flag - non-zero if all processes in this job should abort, zero otherwise - error_msg - error message to be printed - + Return values: If the abort succeeds this function will not return. Returns an MPI error code otherwise. @@ -163,7 +163,7 @@ int PMI2_Abort(int flag, const char msg[]); . argcs - size of argv arrays for each command string . argvs - array of argv arrays for each command string . maxprocs - array of maximum processes to spawn for each command string - . info_keyval_sizes - array giving the number of elements in each of the + . info_keyval_sizes - array giving the number of elements in each of the 'info_keyval_vectors' . info_keyval_vectors - array of keyval vector arrays . preput_keyval_size - Number of elements in 'preput_keyval_vector' @@ -184,7 +184,7 @@ int PMI2_Abort(int flag, const char msg[]); to the size of the 'preput_keyval_vector' array. The 'preput_keyval_vector' contains keyval pairs that will be put in the keyval space of the newly created job before the processes are started. The 'maxprocs' array - specifies the desired number of processes to create for each 'cmd' string. + specifies the desired number of processes to create for each 'cmd' string. The actual number of processes may be less than the numbers specified in maxprocs. The acceptable number of processes spawned may be controlled by ``soft'' keyvals in the info arrays. The ``soft'' option is specified by @@ -202,14 +202,14 @@ int PMI2_Job_Spawn(int count, const char * cmds[], int errors[]); /*@ - PMI2_Job_GetId - get job id of this job + PMI2_Job_GetId - get job id of this job Input parameters: . jobid_size - size of buffer provided in jobid Output parameters: . jobid - the job id of this job - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -225,7 +225,7 @@ int PMI2_Job_GetId(char jobid[], int jobid_size); Output parameters: . conn - connection structure used to exteblish communication with the remote job - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -258,7 +258,7 @@ int PMI2_Job_Disconnect(const char jobid[]); Input Parameters: + key - key - value - value - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -287,7 +287,7 @@ int PMI2_KVS_Put(const char key[], const char value[]); their corresponding PMI2_KVS_Fence until some process issues a PMI2_KVS_Get. This might be appropriate for some wide-area implementations. - + @*/ int PMI2_KVS_Fence(void); @@ -308,7 +308,7 @@ int PMI2_KVS_Fence(void); + value - value associated with key - vallen - length of the returned value, or, if the length is longer than maxvalue, the negative of the required length is returned - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -328,7 +328,7 @@ int PMI2_KVS_Get(const char *jobid, int src_pmi_id, const char key[], char value Output Parameters: + value - value of the attribute - found - non-zero indicates that the attribute was found - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -367,7 +367,7 @@ int PMI2_Info_GetNodeAttr(const char name[], char value[], int valuelen, int *fo + array - value of attribute . outlen - number of elements returned - found - non-zero if attribute was found - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -403,7 +403,7 @@ int PMI2_Info_GetNodeAttrIntArray(const char name[], int array[], int arraylen, Notes: For example, it might be used to share segment ids with other processes on the same SMP node. - + @*/ int PMI2_Info_PutNodeAttr(const char name[], const char value[]); @@ -418,7 +418,7 @@ int PMI2_Info_PutNodeAttr(const char name[], const char value[]); Output Parameters: + value - value of the attribute - found - non-zero indicates that the attribute was found - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -437,7 +437,7 @@ int PMI2_Info_GetJobAttr(const char name[], char value[], int valuelen, int *fou + array - value of attribute . outlen - number of elements returned - found - non-zero if attribute was found - + Return values: Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @@ -449,7 +449,7 @@ int PMI2_Info_GetJobAttr(const char name[], char value[], int valuelen, int *fou . hasNameServ - The value hasNameServ is true if the PMI2 environment supports the name service operations (publish, lookup, and unpublish). - + . physTopology - Return the topology of the underlying network. The valid topology types include cartesian, hierarchical, complete, kautz, hypercube; additional types may be added as necessary. If @@ -471,7 +471,7 @@ int PMI2_Info_GetJobAttr(const char name[], char value[], int valuelen, int *fou is cartesian,complete. All processes are connected by the cartesian part of this, but for each complete network, only the processes on the same node are connected. - + . cartDims - Return a string of comma-separated values describing the dimensions of the Cartesian topology. This must be consistent with the value of cartCoords that may be returned by @@ -482,7 +482,7 @@ int PMI2_Info_GetJobAttr(const char name[], char value[], int valuelen, int *fou PMI interface and how extensions can be added within the same API and wire protocol. For example, adding more complex network topologies requires only adding new keys, not new routines. - + . isHeterogeneous - The value isHeterogeneous is true if the processes belonging to the job are running on nodes with different underlying data models. @@ -491,7 +491,7 @@ int PMI2_Info_GetJobAttr(const char name[], char value[], int valuelen, int *fou int PMI2_Info_GetJobAttrIntArray(const char name[], int array[], int arraylen, int *outlen, int *found); /*@ - PMI2_Nameserv_publish - publish a name + PMI2_Nameserv_publish - publish a name Input parameters: + service_name - string representing the service being published @@ -511,7 +511,7 @@ int PMI2_Nameserv_publish(const char service_name[], const PMI_keyval_t *info_pt + service_name - string representing the service being published . info_ptr - - portLen - size of buffer provided in port - + Output parameters: . port - string representing the port on which to contact the service @@ -532,7 +532,7 @@ int PMI2_Nameserv_lookup(const char service_name[], const PMI_keyval_t *info_ptr Returns 'MPI_SUCCESS' on success and an MPI error code on failure. @*/ -int PMI2_Nameserv_unpublish(const char service_name[], +int PMI2_Nameserv_unpublish(const char service_name[], const PMI_keyval_t *info_ptr); diff --git a/opal/mca/pmix/pmix1xx/pmix/include/pmix/autogen/config.h.in b/opal/mca/pmix/pmix1xx/pmix/include/pmix/autogen/config.h.in index ad68ae2777..a68887ff2c 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/pmix/autogen/config.h.in +++ b/opal/mca/pmix/pmix1xx/pmix/include/pmix/autogen/config.h.in @@ -69,7 +69,7 @@ /* Maybe before gcc 2.95 too */ #ifdef PMIX_HAVE_ATTRIBUTE_UNUSED -#define __PMIX_HAVE_ATTRIBUTE_UNUSED PMIX_HAVE_ATTRIBUTE_UNUSED +#define __PMIX_HAVE_ATTRIBUTE_UNUSED PMIX_HAVE_ATTRIBUTE_UNUSED #elif defined(__GNUC__) # define __PMIX_HAVE_ATTRIBUTE_UNUSED (GXX_ABOVE_3_4 || GCC_ABOVE_2_95) #else @@ -82,7 +82,7 @@ #endif #ifdef PMIX_HAVE_ATTRIBUTE_MALLOC -#define __PMIX_HAVE_ATTRIBUTE_MALLOC PMIX_HAVE_ATTRIBUTE_MALLOC +#define __PMIX_HAVE_ATTRIBUTE_MALLOC PMIX_HAVE_ATTRIBUTE_MALLOC #elif defined(__GNUC__) # define __PMIX_HAVE_ATTRIBUTE_MALLOC (GXX_ABOVE_3_4 || GCC_ABOVE_2_96) #else @@ -95,7 +95,7 @@ #endif #ifdef PMIX_HAVE_ATTRIBUTE_CONST -#define __PMIX_HAVE_ATTRIBUTE_CONST PMIX_HAVE_ATTRIBUTE_CONST +#define __PMIX_HAVE_ATTRIBUTE_CONST PMIX_HAVE_ATTRIBUTE_CONST #elif defined(__GNUC__) # define __PMIX_HAVE_ATTRIBUTE_CONST (GXX_ABOVE_3_4 || GCC_ABOVE_2_95) #else @@ -108,7 +108,7 @@ #endif #ifdef PMIX_HAVE_ATTRIBUTE_PURE -#define __PMIX_HAVE_ATTRIBUTE_PURE PMIX_HAVE_ATTRIBUTE_PURE +#define __PMIX_HAVE_ATTRIBUTE_PURE PMIX_HAVE_ATTRIBUTE_PURE #elif defined(__GNUC__) # define __PMIX_HAVE_ATTRIBUTE_PURE (GXX_ABOVE_3_4 || GCC_ABOVE_2_96) #else @@ -121,7 +121,7 @@ #endif #ifdef PMIX_HAVE_ATTRIBUTE_DEPRECATED -#define __PMIX_HAVE_ATTRIBUTE_DEPRECATED PMIX_HAVE_ATTRIBUTE_DEPRECATED +#define __PMIX_HAVE_ATTRIBUTE_DEPRECATED PMIX_HAVE_ATTRIBUTE_DEPRECATED #elif defined(__GNUC__) # define __PMIX_HAVE_ATTRIBUTE_DEPRECATED (GXX_ABOVE_3_4 || GCC_ABOVE_3_3) #else diff --git a/opal/mca/pmix/pmix1xx/pmix/include/pmix_server.h b/opal/mca/pmix/pmix1xx/pmix/include/pmix_server.h index 8e4e506c84..c8304ec0b2 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/pmix_server.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/pmix_server.h @@ -2,6 +2,8 @@ * Copyright (c) 2013-2015 Intel, Inc. All rights reserved * Copyright (c) 2015 Artem Y. Polyakov . * 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 diff --git a/opal/mca/pmix/pmix1xx/pmix/include/private/align.h b/opal/mca/pmix/pmix1xx/pmix/include/private/align.h index e55c303603..02b361110c 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/private/align.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/private/align.h @@ -5,7 +5,7 @@ * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. @@ -13,9 +13,9 @@ * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/opal/mca/pmix/pmix1xx/pmix/include/private/hash_string.h b/opal/mca/pmix/pmix1xx/pmix/include/private/hash_string.h index e8f856f5da..6a91395cc0 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/private/hash_string.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/private/hash_string.h @@ -3,9 +3,9 @@ * of Tennessee Research Foundation. All rights * reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_socket_errno.h b/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_socket_errno.h index 2b7ecb506c..38b1c367b0 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_socket_errno.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_socket_errno.h @@ -5,15 +5,15 @@ * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ #ifndef PMIX_GET_SOCKET_ERROR_H diff --git a/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_stdint.h b/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_stdint.h index 7cebe3950d..59981f2ff7 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_stdint.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/private/pmix_stdint.h @@ -5,14 +5,14 @@ * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ * * This file includes the C99 stdint.h file if available, and otherwise @@ -186,7 +186,7 @@ typedef unsigned long long uintptr_t; /* inttypes.h printf specifiers */ #ifdef HAVE_INTTYPES_H # include -#else +#else # if SIZEOF_LONG == 8 # define __PRI64_PREFIX "l" @@ -305,7 +305,7 @@ typedef unsigned long long uintptr_t; # define PRIoPTR __PRIPTR_PREFIX "o" # define PRIuPTR __PRIPTR_PREFIX "u" # define PRIxPTR __PRIPTR_PREFIX "x" -# define PRIXPTR __PRIPTR_PREFIX "X" +# define PRIXPTR __PRIPTR_PREFIX "X" #endif diff --git a/opal/mca/pmix/pmix1xx/pmix/include/private/prefetch.h b/opal/mca/pmix/pmix1xx/pmix/include/private/prefetch.h index 78fc3f49ae..77db04a16a 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/private/prefetch.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/private/prefetch.h @@ -3,9 +3,9 @@ * All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/opal/mca/pmix/pmix1xx/pmix/include/private/types.h b/opal/mca/pmix/pmix1xx/pmix/include/private/types.h index 6b0f5e1612..9b45e1d9b9 100644 --- a/opal/mca/pmix/pmix1xx/pmix/include/private/types.h +++ b/opal/mca/pmix/pmix1xx/pmix/include/private/types.h @@ -5,15 +5,15 @@ * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -158,7 +158,7 @@ static inline void* pmix_ptr_ltop( uint64_t value ) #if defined(WORDS_BIGENDIAN) || !defined(HAVE_UNIX_BYTESWAP) static inline uint16_t pmix_swap_bytes2(uint16_t val) __pmix_attribute_const__; -static inline uint16_t pmix_swap_bytes2(uint16_t val) +static inline uint16_t pmix_swap_bytes2(uint16_t val) { union { uint16_t bigval; uint8_t arrayval[2]; @@ -203,7 +203,7 @@ static inline uint64_t pmix_swap_bytes8(uint64_t val) r.arrayval[5] = w.arrayval[2]; r.arrayval[6] = w.arrayval[1]; r.arrayval[7] = w.arrayval[0]; - + return r.bigval; } diff --git a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/buffer_ops.h b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/buffer_ops.h index e5d94de5bd..a0ea21d8ad 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/buffer_ops.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/buffer_ops.h @@ -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 diff --git a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/copy.c b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/copy.c index 2dc7d09032..b38a039f68 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/copy.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/copy.c @@ -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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/internal.h b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/internal.h index f0e9c7f28e..1f99363824 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/internal.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/internal.h @@ -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 diff --git a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/open_close.c b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/open_close.c index 43f062e9ce..bd0a263032 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/open_close.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/open_close.c @@ -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) { diff --git a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/pack.c b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/pack.c index f1db83c110..faa9a6e782 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/pack.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/pack.c @@ -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); } diff --git a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/unpack.c b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/unpack.c index c74e8a596d..45c8b201b7 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/unpack.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/buffer_ops/unpack.c @@ -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); diff --git a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.c b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.c index 4992519193..59ff4c2835 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.c @@ -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; iht_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); diff --git a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.h b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.h index ec37491fef..55168ab409 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_hash_table.h @@ -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 + 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. diff --git a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.c b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.c index 85bb262750..8e968595b2 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.c @@ -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)) { diff --git a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.h b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.h index 6d7d960766..680d52cdfd 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/class/pmix_pointer_array.h @@ -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 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 diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmi2.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmi2.c index 1ebcc9ae1d..10c29b7f91 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmi2.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmi2.c @@ -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) { diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c index 95e8aa59dd..7c411608a5 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c @@ -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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_connect.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_connect.c index 1b3a752f9f..acd4fb3e94 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_connect.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_connect.c @@ -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 . * 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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_fence.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_fence.c index c65e309984..d36a1ade8a 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_fence.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_fence.c @@ -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 . * 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"); diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_get.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_get.c index 19bd046e8f..622b6ba44c 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_get.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_get.c @@ -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 . * 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, diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_pub.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_pub.c index c69b513603..a8c1db34c1 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_pub.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_pub.c @@ -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 . * 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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_spawn.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_spawn.c index c226299252..afad908228 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_spawn.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client_spawn.c @@ -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 . * 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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/sec/pmix_sec.h b/opal/mca/pmix/pmix1xx/pmix/src/sec/pmix_sec.h index c7c1fd6a2e..78f1677798 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/sec/pmix_sec.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/sec/pmix_sec.h @@ -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 diff --git a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c index 7f20360ef5..2dbfb2b473 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c @@ -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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_listener.c b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_listener.c index afd3ed6f26..3c3c418c3a 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_listener.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_listener.c @@ -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 . * 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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_ops.c b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_ops.c index d1c001b6c8..1037e5d5ea 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_ops.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_ops.c @@ -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; } diff --git a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_regex.c b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_regex.c index 58963e18f1..4c26e67745 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_regex.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server_regex.c @@ -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 . * 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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.c b/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.c index f24ebffc7c..fc3b506d9c 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.c @@ -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; } diff --git a/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.h b/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.h index 8ed64f5efe..42df5055cf 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/usock/usock.h @@ -16,6 +16,8 @@ * Copyright (c) 2013-2015 Intel, Inc. All rights reserved. * Copyright (c) 2014-2015 Artem Y. Polyakov . * 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); diff --git a/opal/mca/pmix/pmix1xx/pmix/src/usock/usock_sendrecv.c b/opal/mca/pmix/pmix1xx/pmix/src/usock/usock_sendrecv.c index 531dbd2b34..99a4811478 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/usock/usock_sendrecv.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/usock/usock_sendrecv.c @@ -2,6 +2,8 @@ * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. * Copyright (c) 2014 Artem Y. Polyakov . * 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", diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/argv.c b/opal/mca/pmix/pmix1xx/pmix/src/util/argv.c index 13cc3ee5eb..bb9db24940 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/argv.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/argv.c @@ -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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/argv.h b/opal/mca/pmix/pmix1xx/pmix/src/util/argv.h index 5eb1aea10d..2dfc7d20f7 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/argv.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/argv.h @@ -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 #endif +#include + 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 diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/fd.c b/opal/mca/pmix/pmix1xx/pmix/src/util/fd.c index a90758575f..7c08a6d352 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/fd.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/fd.c @@ -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; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/fd.h b/opal/mca/pmix/pmix1xx/pmix/src/util/fd.h index c687c8c120..705a5ff733 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/fd.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/fd.h @@ -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 diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/hash.c b/opal/mca/pmix/pmix1xx/pmix/src/util/hash.c index 3993c55aaa..84fc6cda75 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/hash.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/hash.c @@ -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", diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/hash.h b/opal/mca/pmix/pmix1xx/pmix/src/util/hash.h index 15c8650135..d40728e983 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/hash.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/hash.h @@ -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 diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/pmix_environ.h b/opal/mca/pmix/pmix1xx/pmix/src/util/pmix_environ.h index 89cb018bc4..15e018558f 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/pmix_environ.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/pmix_environ.h @@ -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 #endif +#include + 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. diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/progress_threads.c b/opal/mca/pmix/pmix1xx/pmix/src/util/progress_threads.c index 9d0cb02094..2ce45dfd37 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/progress_threads.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/progress_threads.c @@ -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) { diff --git a/opal/mca/pmix/pmix1xx/pmix/src/util/timings.h b/opal/mca/pmix/pmix1xx/pmix/src/util/timings.h index 1405ca7fd9..92dc9e8231 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/util/timings.h +++ b/opal/mca/pmix/pmix1xx/pmix/src/util/timings.h @@ -1,6 +1,8 @@ /* * Copyright (C) 2014 Artem Polyakov * 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'. diff --git a/opal/mca/pmix/pmix1xx/pmix/test/README b/opal/mca/pmix/pmix1xx/pmix/test/README index 552558320c..15cd5f69ca 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/README +++ b/opal/mca/pmix/pmix1xx/pmix/test/README @@ -1,6 +1,6 @@ This is a short description how to run tests for pmix standalone library. -To compile test the user should run make in the test subdirectory. +To compile test the user should run make in the test subdirectory. To start testing, the user should run either pmix_test or pmix_test_lite executable. These applications are using two different versions of server functionality and fork diff --git a/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.c b/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.c index dcf8267237..bd384a2d9e 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.c @@ -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; diff --git a/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.h b/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.h index 30d24dca09..6426a142e3 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.h +++ b/opal/mca/pmix/pmix1xx/pmix/test/cli_stages.h @@ -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); diff --git a/opal/mca/pmix/pmix1xx/pmix/test/pmi2_client.c b/opal/mca/pmix/pmix1xx/pmix/test/pmi2_client.c index da53503a37..a22e9ec994 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/pmi2_client.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/pmi2_client.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2013 Los Alamos National Security, LLC. + * Copyright (c) 2006-2013 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. @@ -33,7 +33,7 @@ int main(int argc, char **argv) int spawned, size, rank, appnum; int rc; char *key; - + /* init us */ if (PMI2_SUCCESS != (rc = PMI2_Init(&spawned, &size, &rank, &appnum))) { fprintf(stderr, "PMI2_Init failed: %d\n", rc); @@ -66,6 +66,6 @@ int main(int argc, char **argv) fprintf(stderr, "PMI2_Finalize failed: %d\n", rc); return rc; } - + return 0; } diff --git a/opal/mca/pmix/pmix1xx/pmix/test/pmi_client.c b/opal/mca/pmix/pmix1xx/pmix/test/pmi_client.c index 343e3fb5d2..8ea0de49c3 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/pmi_client.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/pmi_client.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2013 Los Alamos National Security, LLC. + * Copyright (c) 2006-2013 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. @@ -71,6 +71,6 @@ int main(int argc, char **argv) if (PMI_SUCCESS != (rc = PMI_Finalize())) { fprintf(stderr, "PMI_Finalize failed: %d\n", rc); } - + return rc; } diff --git a/opal/mca/pmix/pmix1xx/pmix/test/pmix_regex.c b/opal/mca/pmix/pmix1xx/pmix/test/pmix_regex.c index 027f6fc5a3..ece191ebc6 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/pmix_regex.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/pmix_regex.c @@ -42,7 +42,7 @@ int main(int argc, char **argv) char *regex; char **nodes, **procs; pmix_status_t rc; - + /* smoke test */ if (PMIX_SUCCESS != 0) { TEST_ERROR(("ERROR IN COMPUTING CONSTANTS: PMIX_SUCCESS = %d", PMIX_SUCCESS)); @@ -68,7 +68,7 @@ int main(int argc, char **argv) } else { fprintf(stderr, "Node reverse failed: %d\n\n\n", rc); } - + fprintf(stderr, "PROCS: %s\n", TEST_PROCS); PMIx_generate_ppn(TEST_PROCS, ®ex); fprintf(stderr, "PPN: %s\n\n", regex); diff --git a/opal/mca/pmix/pmix1xx/pmix/test/pmix_test.c b/opal/mca/pmix/pmix1xx/pmix/test/pmix_test.c index 69e9951546..3432324a7f 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/pmix_test.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/pmix_test.c @@ -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 */ diff --git a/opal/mca/pmix/pmix1xx/pmix/test/server_callbacks.c b/opal/mca/pmix/pmix1xx/pmix/test/server_callbacks.c index 8bd03942fe..bb5d5a8ef7 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/server_callbacks.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/server_callbacks.c @@ -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; diff --git a/opal/mca/pmix/pmix1xx/pmix/test/simple/simpdyn.c b/opal/mca/pmix/pmix1xx/pmix/test/simple/simpdyn.c index fb45917a42..462729cd6b 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/simple/simpdyn.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/simple/simpdyn.c @@ -53,9 +53,9 @@ int main(int argc, char **argv) pmix_proc_t *peers; size_t npeers, ntmp=0; char *nodelist; - + gethostname(hostname, 1024); - + /* init us */ if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) { pmix_output(0, "Client ns %s rank %d: PMIx_Init failed: %d", myproc.nspace, myproc.rank, rc); @@ -71,7 +71,7 @@ int main(int argc, char **argv) nprocs = val->data.uint32; PMIX_VALUE_RELEASE(val); pmix_output(0, "Client %s:%d universe size %d", myproc.nspace, myproc.rank, nprocs); - + /* call fence to sync */ PMIX_PROC_CONSTRUCT(&proc); (void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN); @@ -80,7 +80,7 @@ int main(int argc, char **argv) pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc); goto done; } - + /* rank=0 calls spawn */ if (0 == myproc.rank) { PMIX_APP_CREATE(app, 1); @@ -172,7 +172,7 @@ int main(int argc, char **argv) } PMIX_PROC_FREE(peers, npeers); free(nodelist); - + done: /* call fence to sync */ PMIX_PROC_CONSTRUCT(&proc); @@ -182,10 +182,10 @@ int main(int argc, char **argv) pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc); goto done; } - + /* finalize us */ pmix_output(0, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank); - + if (PMIX_SUCCESS != (rc = PMIx_Finalize())) { fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc); } else { diff --git a/opal/mca/pmix/pmix1xx/pmix/test/simple/simpft.c b/opal/mca/pmix/pmix1xx/pmix/test/simple/simpft.c index 330f4f72d6..a09e0ea824 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/simple/simpft.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/simple/simpft.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) pmix_value_t *val = &value; pmix_proc_t proc; uint32_t nprocs; - + /* init us */ if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) { pmix_output(0, "Client ns %s rank %d: PMIx_Init failed: %d", myproc.nspace, myproc.rank, rc); @@ -72,10 +72,10 @@ int main(int argc, char **argv) PMIX_VALUE_RELEASE(val); pmix_output(0, "Client %s:%d universe size %d", myproc.nspace, myproc.rank, nprocs); completed = false; - + /* register our errhandler */ PMIx_Register_errhandler(NULL, 0, notification_fn); - + /* call fence to sync */ PMIX_PROC_CONSTRUCT(&proc); (void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN); @@ -84,7 +84,7 @@ int main(int argc, char **argv) pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc); goto done; } - + /* rank=0 calls abort */ if (0 == myproc.rank) { PMIx_Abort(PMIX_ERR_OUT_OF_RESOURCE, "Eat rocks", @@ -103,7 +103,7 @@ int main(int argc, char **argv) /* finalize us */ pmix_output(0, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank); PMIx_Deregister_errhandler(); - + if (PMIX_SUCCESS != (rc = PMIx_Finalize())) { fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc); } else { diff --git a/opal/mca/pmix/pmix1xx/pmix/test/simple/simptest.c b/opal/mca/pmix/pmix1xx/pmix/test/simple/simptest.c index 1b4cfd93d6..1cfc94c8a2 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/simple/simptest.c +++ b/opal/mca/pmix/pmix1xx/pmix/test/simple/simptest.c @@ -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"); diff --git a/opal/mca/pmix/pmix1xx/pmix/test/test_common.h b/opal/mca/pmix/pmix1xx/pmix/test/test_common.h index 98b0e8fa48..85779bd8f6 100644 --- a/opal/mca/pmix/pmix1xx/pmix/test/test_common.h +++ b/opal/mca/pmix/pmix1xx/pmix/test/test_common.h @@ -2,6 +2,8 @@ * Copyright (c) 2013-2015 Intel, Inc. All rights reserved. * Copyright (c) 2015 Artem Y. Polyakov . * 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); \ } diff --git a/opal/mca/pmix/pmix1xx/pmix_pmix1.c b/opal/mca/pmix/pmix1xx/pmix_pmix1.c index 3abeee934c..84c777400d 100644 --- a/opal/mca/pmix/pmix1xx/pmix_pmix1.c +++ b/opal/mca/pmix/pmix1xx/pmix_pmix1.c @@ -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;