Skip to content

Commit 7be09f8

Browse files
author
Ralph Castain
authored
Merge pull request #3658 from rhc54/topic/pmixup
Update to PMIx master
2 parents ba46b35 + 2f85d10 commit 7be09f8

File tree

5 files changed

+43
-26
lines changed

5 files changed

+43
-26
lines changed

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ greek=
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=gitd5e4801
33+
repo_rev=git707f8cf
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="May 30, 2017"
47+
date="Jun 06, 2017"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix2x/pmix/src/class/pmix_pointer_array.c

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,37 +86,42 @@ static void pmix_pointer_array_destruct(pmix_pointer_array_t *array)
8686
* A classical find first zero bit (ffs) on a large array. It checks starting
8787
* from the indicated position until it finds a zero bit. If SET is true,
8888
* the bit is set. The position of the bit is returned in store.
89+
*
90+
* According to Section 6.4.4.1 of the C standard we don't need to prepend a type
91+
* indicator to constants (the type is inferred by the compiler according to
92+
* the number of bits necessary to represent it).
8993
*/
90-
#define FIND_FIRST_ZERO(START_IDX, STORE, SET) \
94+
#define FIND_FIRST_ZERO(START_IDX, STORE) \
9195
do { \
9296
uint32_t __b_idx, __b_pos; \
97+
if( 0 == table->number_free ) { \
98+
(STORE) = table->size; \
99+
break; \
100+
} \
93101
GET_BIT_POS((START_IDX), __b_idx, __b_pos); \
94-
for (; table->free_bits[__b_idx] == 0xFFFFFFFFFFFFFFFFULL; __b_idx++); \
102+
for (; table->free_bits[__b_idx] == 0xFFFFFFFFFFFFFFFFu; __b_idx++); \
95103
assert(__b_idx < (uint32_t)table->size); \
96104
uint64_t __check_value = table->free_bits[__b_idx]; \
97105
__b_pos = 0; \
98106
\
99-
if( 0x00000000FFFFFFFFULL == (__check_value & 0x00000000FFFFFFFFULL) ) { \
107+
if( 0x00000000FFFFFFFFu == (__check_value & 0x00000000FFFFFFFFu) ) { \
100108
__check_value >>= 32; __b_pos += 32; \
101109
} \
102-
if( 0x000000000000FFFFULL == (__check_value & 0x000000000000FFFFULL) ) { \
110+
if( 0x000000000000FFFFu == (__check_value & 0x000000000000FFFFu) ) { \
103111
__check_value >>= 16; __b_pos += 16; \
104112
} \
105-
if( 0x00000000000000FFULL == (__check_value & 0x00000000000000FFULL) ) { \
113+
if( 0x00000000000000FFu == (__check_value & 0x00000000000000FFu) ) { \
106114
__check_value >>= 8; __b_pos += 8; \
107115
} \
108-
if( 0x000000000000000FULL == (__check_value & 0x000000000000000FULL) ) { \
116+
if( 0x000000000000000Fu == (__check_value & 0x000000000000000Fu) ) { \
109117
__check_value >>= 4; __b_pos += 4; \
110118
} \
111-
if( 0x0000000000000003ULL == (__check_value & 0x0000000000000003ULL) ) { \
119+
if( 0x0000000000000003u == (__check_value & 0x0000000000000003u) ) { \
112120
__check_value >>= 2; __b_pos += 2; \
113121
} \
114-
if( 0x0000000000000001ULL == (__check_value & 0x0000000000000001ULL) ) { \
122+
if( 0x0000000000000001u == (__check_value & 0x0000000000000001u) ) { \
115123
__b_pos += 1; \
116124
} \
117-
if( (SET) ) { \
118-
table->free_bits[__b_idx] |= (1ULL << __b_pos); \
119-
} \
120125
(STORE) = (__b_idx * 8 * sizeof(uint64_t)) + __b_pos; \
121126
} while(0)
122127

@@ -127,8 +132,8 @@ static void pmix_pointer_array_destruct(pmix_pointer_array_t *array)
127132
do { \
128133
uint32_t __b_idx, __b_pos; \
129134
GET_BIT_POS((IDX), __b_idx, __b_pos); \
130-
assert( 0 == (table->free_bits[__b_idx] & (1UL << __b_pos))); \
131-
table->free_bits[__b_idx] |= (1ULL << __b_pos); \
135+
assert( 0 == (table->free_bits[__b_idx] & (((uint64_t)1) << __b_pos))); \
136+
table->free_bits[__b_idx] |= (((uint64_t)1) << __b_pos); \
132137
} while(0)
133138

134139
/**
@@ -138,8 +143,8 @@ static void pmix_pointer_array_destruct(pmix_pointer_array_t *array)
138143
do { \
139144
uint32_t __b_idx, __b_pos; \
140145
GET_BIT_POS((IDX), __b_idx, __b_pos); \
141-
assert( (table->free_bits[__b_idx] & (1UL << __b_pos))); \
142-
table->free_bits[__b_idx] ^= (1ULL << __b_pos); \
146+
assert( (table->free_bits[__b_idx] & (((uint64_t)1) << __b_pos))); \
147+
table->free_bits[__b_idx] ^= (((uint64_t)1) << __b_pos); \
143148
} while(0)
144149

145150
#if 0
@@ -157,9 +162,9 @@ static void pmix_pointer_array_validate(pmix_pointer_array_t *array)
157162
GET_BIT_POS(i, b_idx, p_idx);
158163
if( NULL == array->addr[i] ) {
159164
cnt++;
160-
assert( 0 == (array->free_bits[b_idx] & (1ULL << p_idx)) );
165+
assert( 0 == (array->free_bits[b_idx] & (((uint64_t)1) << p_idx)) );
161166
} else {
162-
assert( 0 != (array->free_bits[b_idx] & (1ULL << p_idx)) );
167+
assert( 0 != (array->free_bits[b_idx] & (((uint64_t)1) << p_idx)) );
163168
}
164169
}
165170
assert(cnt == array->number_free);
@@ -236,7 +241,7 @@ int pmix_pointer_array_add(pmix_pointer_array_t *table, void *ptr)
236241
table->number_free--;
237242
SET_BIT(index);
238243
if (table->number_free > 0) {
239-
FIND_FIRST_ZERO(index, table->lowest_free, 0);
244+
FIND_FIRST_ZERO(index, table->lowest_free);
240245
} else {
241246
table->lowest_free = table->size;
242247
}
@@ -290,7 +295,7 @@ int pmix_pointer_array_set_item(pmix_pointer_array_t *table, int index,
290295
SET_BIT(index);
291296
/* Reset lowest_free if required */
292297
if ( index == table->lowest_free ) {
293-
FIND_FIRST_ZERO(index, table->lowest_free, 0);
298+
FIND_FIRST_ZERO(index, table->lowest_free);
294299
}
295300
} else {
296301
assert( index != table->lowest_free );
@@ -362,7 +367,7 @@ bool pmix_pointer_array_test_and_set_item (pmix_pointer_array_t *table,
362367
/* Reset lowest_free if required */
363368
if( table->number_free > 0 ) {
364369
if ( index == table->lowest_free ) {
365-
FIND_FIRST_ZERO(index, table->lowest_free, 0);
370+
FIND_FIRST_ZERO(index, table->lowest_free);
366371
}
367372
} else {
368373
table->lowest_free = table->size;

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* All rights reserved.
88
* Copyright (c) 2016 Mellanox Technologies, Inc.
99
* All rights reserved.
10-
* Copyright (c) 2016 IBM Corporation. All rights reserved.
10+
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
1111
* $COPYRIGHT$
1212
*
1313
* Additional copyrights may follow
@@ -568,6 +568,9 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
568568
pmix_output_verbose(2, pmix_globals.debug_output,
569569
"pmix:client finalize sync received");
570570
}
571+
else {
572+
pmix_mutex_unlock(&pmix_client_bootstrap_mutex);
573+
}
571574

572575
if (!pmix_globals.external_evbase) {
573576
/* stop the progress thread, but leave the event base

opal/mca/pmix/pmix2x/pmix/src/mca/ptl/base/ptl_base_frame.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,20 @@ PMIX_CLASS_INSTANCE(pmix_ptl_posted_recv_t,
167167

168168
static void srcon(pmix_ptl_sr_t *p)
169169
{
170+
p->peer = NULL;
170171
p->bfr = NULL;
171172
p->cbfunc = NULL;
172173
p->cbdata = NULL;
173174
}
175+
static void srdes(pmix_ptl_sr_t *p)
176+
{
177+
if (NULL != p->peer) {
178+
PMIX_RELEASE(p->peer);
179+
}
180+
}
174181
PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_ptl_sr_t,
175182
pmix_object_t,
176-
srcon, NULL);
183+
srcon, srdes);
177184

178185
static void pccon(pmix_pending_connection_t *p)
179186
{

opal/mca/pmix/pmix2x/pmix/src/mca/ptl/tcp/ptl_tcp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,15 @@ static pmix_status_t send_recv(struct pmix_peer_t *peer,
335335
void *cbdata)
336336
{
337337
pmix_ptl_sr_t *ms;
338+
pmix_peer_t *pr = (pmix_peer_t*)peer;
338339

339340
pmix_output_verbose(5, pmix_globals.debug_output,
340341
"[%s:%d] post send to server",
341342
__FILE__, __LINE__);
342343

343344
ms = PMIX_NEW(pmix_ptl_sr_t);
344-
ms->peer = peer;
345+
PMIX_RETAIN(pr);
346+
ms->peer = pr;
345347
ms->bfr = bfr;
346348
ms->cbfunc = cbfunc;
347349
ms->cbdata = cbdata;
@@ -363,7 +365,7 @@ static pmix_status_t send_oneway(struct pmix_peer_t *peer,
363365
* peer's send queue */
364366
q = PMIX_NEW(pmix_ptl_queue_t);
365367
PMIX_RETAIN(pr);
366-
q->peer = peer;
368+
q->peer = pr;
367369
q->buf = bfr;
368370
q->tag = tag;
369371
pmix_event_assign(&q->ev, pmix_globals.evbase, -1,

0 commit comments

Comments
 (0)