11/*
2- * Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
2+ * Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
33 * Copyright (c) 2016 IBM Corporation. All rights reserved.
44 * Copyright (c) 2016-2017 Mellanox Technologies, Inc.
55 * All rights reserved.
@@ -2995,44 +2995,35 @@ static pmix_status_t dstore_store_modex(struct pmix_nspace_t *nspace,
29952995 pmix_byte_object_t * bo )
29962996{
29972997 pmix_nspace_t * ns = (pmix_nspace_t * )nspace ;
2998- pmix_server_caddy_t * scd ;
29992998 pmix_status_t rc = PMIX_SUCCESS ;
30002999 int32_t cnt ;
30013000 pmix_buffer_t pbkt ;
30023001 pmix_proc_t proc ;
30033002 pmix_kval_t * kv ;
3004- pmix_peer_t * peer ;
30053003
30063004 pmix_output_verbose (2 , pmix_gds_base_framework .framework_output ,
30073005 "[%s:%d] gds:dstore:store_modex for nspace %s" ,
30083006 pmix_globals .myid .nspace , pmix_globals .myid .rank ,
30093007 ns -> nspace );
30103008
3009+ /* NOTE: THE BYTE OBJECT DELIVERED HERE WAS CONSTRUCTED
3010+ * BY A SERVER, AND IS THEREFORE PACKED USING THE SERVER'S
3011+ * PEER OBJECT (WHICH IS REQUIRED TO BE THE SAME AS OUR OWN) */
3012+
30113013 /* this is data returned via the PMIx_Fence call when
30123014 * data collection was requested, so it only contains
30133015 * REMOTE/GLOBAL data. The byte object contains
30143016 * the rank followed by pmix_kval_t's. The list of callbacks
30153017 * contains all local participants. */
3016- peer = NULL ;
3017- PMIX_LIST_FOREACH (scd , cbs , pmix_server_caddy_t ) {
3018- if (scd -> peer -> nptr == ns ) {
3019- peer = scd -> peer ;
3020- break ;
3021- }
3022- }
3023- if (NULL == peer ) {
3024- /* we can ignore this one */
3025- return PMIX_SUCCESS ;
3026- }
30273018
30283019 /* setup the byte object for unpacking */
30293020 PMIX_CONSTRUCT (& pbkt , pmix_buffer_t );
30303021 /* the next step unfortunately NULLs the byte object's
30313022 * entries, so we need to ensure we restore them! */
3032- PMIX_LOAD_BUFFER (peer , & pbkt , bo -> bytes , bo -> size );
3023+ PMIX_LOAD_BUFFER (pmix_globals . mypeer , & pbkt , bo -> bytes , bo -> size );
30333024 /* unload the proc that provided this data */
30343025 cnt = 1 ;
3035- PMIX_BFROPS_UNPACK (rc , peer , & pbkt , & proc , & cnt , PMIX_PROC );
3026+ PMIX_BFROPS_UNPACK (rc , pmix_globals . mypeer , & pbkt , & proc , & cnt , PMIX_PROC );
30363027 if (PMIX_SUCCESS != rc ) {
30373028 PMIX_ERROR_LOG (rc );
30383029 bo -> bytes = pbkt .base_ptr ;
@@ -3052,7 +3043,7 @@ static pmix_status_t dstore_store_modex(struct pmix_nspace_t *nspace,
30523043 /* unpack the remaining values until we hit the end of the buffer */
30533044 cnt = 1 ;
30543045 kv = PMIX_NEW (pmix_kval_t );
3055- PMIX_BFROPS_UNPACK (rc , peer , & pbkt , kv , & cnt , PMIX_KVAL );
3046+ PMIX_BFROPS_UNPACK (rc , pmix_globals . mypeer , & pbkt , kv , & cnt , PMIX_KVAL );
30563047 while (PMIX_SUCCESS == rc ) {
30573048 /* store this in the hash table */
30583049 PMIX_GDS_STORE_KV (rc , pmix_globals .mypeer , & proc , PMIX_REMOTE , kv );
@@ -3071,7 +3062,7 @@ static pmix_status_t dstore_store_modex(struct pmix_nspace_t *nspace,
30713062 /* continue along */
30723063 kv = PMIX_NEW (pmix_kval_t );
30733064 cnt = 1 ;
3074- PMIX_BFROPS_UNPACK (rc , peer , & pbkt , kv , & cnt , PMIX_KVAL );
3065+ PMIX_BFROPS_UNPACK (rc , pmix_globals . mypeer , & pbkt , kv , & cnt , PMIX_KVAL );
30753066 }
30763067 PMIX_RELEASE (kv ); // maintain accounting
30773068 if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc ) {
0 commit comments