Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions opal/mca/pmix/pmix2x/pmix/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ greek=
# command, or with the date (if "git describe" fails) in the form of
# "date<date>".

repo_rev=gitd5e4801
repo_rev=git707f8cf

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

# The date when this release was created

date="May 30, 2017"
date="Jun 06, 2017"

# The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library
Expand Down
45 changes: 25 additions & 20 deletions opal/mca/pmix/pmix2x/pmix/src/class/pmix_pointer_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,37 +86,42 @@ static void pmix_pointer_array_destruct(pmix_pointer_array_t *array)
* A classical find first zero bit (ffs) on a large array. It checks starting
* from the indicated position until it finds a zero bit. If SET is true,
* the bit is set. The position of the bit is returned in store.
*
* According to Section 6.4.4.1 of the C standard we don't need to prepend a type
* indicator to constants (the type is inferred by the compiler according to
* the number of bits necessary to represent it).
*/
#define FIND_FIRST_ZERO(START_IDX, STORE, SET) \
#define FIND_FIRST_ZERO(START_IDX, STORE) \
do { \
uint32_t __b_idx, __b_pos; \
if( 0 == table->number_free ) { \
(STORE) = table->size; \
break; \
} \
GET_BIT_POS((START_IDX), __b_idx, __b_pos); \
for (; table->free_bits[__b_idx] == 0xFFFFFFFFFFFFFFFFULL; __b_idx++); \
for (; table->free_bits[__b_idx] == 0xFFFFFFFFFFFFFFFFu; __b_idx++); \
assert(__b_idx < (uint32_t)table->size); \
uint64_t __check_value = table->free_bits[__b_idx]; \
__b_pos = 0; \
\
if( 0x00000000FFFFFFFFULL == (__check_value & 0x00000000FFFFFFFFULL) ) { \
if( 0x00000000FFFFFFFFu == (__check_value & 0x00000000FFFFFFFFu) ) { \
__check_value >>= 32; __b_pos += 32; \
} \
if( 0x000000000000FFFFULL == (__check_value & 0x000000000000FFFFULL) ) { \
if( 0x000000000000FFFFu == (__check_value & 0x000000000000FFFFu) ) { \
__check_value >>= 16; __b_pos += 16; \
} \
if( 0x00000000000000FFULL == (__check_value & 0x00000000000000FFULL) ) { \
if( 0x00000000000000FFu == (__check_value & 0x00000000000000FFu) ) { \
__check_value >>= 8; __b_pos += 8; \
} \
if( 0x000000000000000FULL == (__check_value & 0x000000000000000FULL) ) { \
if( 0x000000000000000Fu == (__check_value & 0x000000000000000Fu) ) { \
__check_value >>= 4; __b_pos += 4; \
} \
if( 0x0000000000000003ULL == (__check_value & 0x0000000000000003ULL) ) { \
if( 0x0000000000000003u == (__check_value & 0x0000000000000003u) ) { \
__check_value >>= 2; __b_pos += 2; \
} \
if( 0x0000000000000001ULL == (__check_value & 0x0000000000000001ULL) ) { \
if( 0x0000000000000001u == (__check_value & 0x0000000000000001u) ) { \
__b_pos += 1; \
} \
if( (SET) ) { \
table->free_bits[__b_idx] |= (1ULL << __b_pos); \
} \
(STORE) = (__b_idx * 8 * sizeof(uint64_t)) + __b_pos; \
} while(0)

Expand All @@ -127,8 +132,8 @@ static void pmix_pointer_array_destruct(pmix_pointer_array_t *array)
do { \
uint32_t __b_idx, __b_pos; \
GET_BIT_POS((IDX), __b_idx, __b_pos); \
assert( 0 == (table->free_bits[__b_idx] & (1UL << __b_pos))); \
table->free_bits[__b_idx] |= (1ULL << __b_pos); \
assert( 0 == (table->free_bits[__b_idx] & (((uint64_t)1) << __b_pos))); \
table->free_bits[__b_idx] |= (((uint64_t)1) << __b_pos); \
} while(0)

/**
Expand All @@ -138,8 +143,8 @@ static void pmix_pointer_array_destruct(pmix_pointer_array_t *array)
do { \
uint32_t __b_idx, __b_pos; \
GET_BIT_POS((IDX), __b_idx, __b_pos); \
assert( (table->free_bits[__b_idx] & (1UL << __b_pos))); \
table->free_bits[__b_idx] ^= (1ULL << __b_pos); \
assert( (table->free_bits[__b_idx] & (((uint64_t)1) << __b_pos))); \
table->free_bits[__b_idx] ^= (((uint64_t)1) << __b_pos); \
} while(0)

#if 0
Expand All @@ -157,9 +162,9 @@ static void pmix_pointer_array_validate(pmix_pointer_array_t *array)
GET_BIT_POS(i, b_idx, p_idx);
if( NULL == array->addr[i] ) {
cnt++;
assert( 0 == (array->free_bits[b_idx] & (1ULL << p_idx)) );
assert( 0 == (array->free_bits[b_idx] & (((uint64_t)1) << p_idx)) );
} else {
assert( 0 != (array->free_bits[b_idx] & (1ULL << p_idx)) );
assert( 0 != (array->free_bits[b_idx] & (((uint64_t)1) << p_idx)) );
}
}
assert(cnt == array->number_free);
Expand Down Expand Up @@ -236,7 +241,7 @@ int pmix_pointer_array_add(pmix_pointer_array_t *table, void *ptr)
table->number_free--;
SET_BIT(index);
if (table->number_free > 0) {
FIND_FIRST_ZERO(index, table->lowest_free, 0);
FIND_FIRST_ZERO(index, table->lowest_free);
} else {
table->lowest_free = table->size;
}
Expand Down Expand Up @@ -290,7 +295,7 @@ int pmix_pointer_array_set_item(pmix_pointer_array_t *table, int index,
SET_BIT(index);
/* Reset lowest_free if required */
if ( index == table->lowest_free ) {
FIND_FIRST_ZERO(index, table->lowest_free, 0);
FIND_FIRST_ZERO(index, table->lowest_free);
}
} else {
assert( index != table->lowest_free );
Expand Down Expand Up @@ -362,7 +367,7 @@ bool pmix_pointer_array_test_and_set_item (pmix_pointer_array_t *table,
/* Reset lowest_free if required */
if( table->number_free > 0 ) {
if ( index == table->lowest_free ) {
FIND_FIRST_ZERO(index, table->lowest_free, 0);
FIND_FIRST_ZERO(index, table->lowest_free);
}
} else {
table->lowest_free = table->size;
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/pmix/pmix2x/pmix/src/client/pmix_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -568,6 +568,9 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix:client finalize sync received");
}
else {
pmix_mutex_unlock(&pmix_client_bootstrap_mutex);
}

if (!pmix_globals.external_evbase) {
/* stop the progress thread, but leave the event base
Expand Down
9 changes: 8 additions & 1 deletion opal/mca/pmix/pmix2x/pmix/src/mca/ptl/base/ptl_base_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,20 @@ PMIX_CLASS_INSTANCE(pmix_ptl_posted_recv_t,

static void srcon(pmix_ptl_sr_t *p)
{
p->peer = NULL;
p->bfr = NULL;
p->cbfunc = NULL;
p->cbdata = NULL;
}
static void srdes(pmix_ptl_sr_t *p)
{
if (NULL != p->peer) {
PMIX_RELEASE(p->peer);
}
}
PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_ptl_sr_t,
pmix_object_t,
srcon, NULL);
srcon, srdes);

static void pccon(pmix_pending_connection_t *p)
{
Expand Down
6 changes: 4 additions & 2 deletions opal/mca/pmix/pmix2x/pmix/src/mca/ptl/tcp/ptl_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,15 @@ static pmix_status_t send_recv(struct pmix_peer_t *peer,
void *cbdata)
{
pmix_ptl_sr_t *ms;
pmix_peer_t *pr = (pmix_peer_t*)peer;

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

ms = PMIX_NEW(pmix_ptl_sr_t);
ms->peer = peer;
PMIX_RETAIN(pr);
ms->peer = pr;
ms->bfr = bfr;
ms->cbfunc = cbfunc;
ms->cbdata = cbdata;
Expand All @@ -363,7 +365,7 @@ static pmix_status_t send_oneway(struct pmix_peer_t *peer,
* peer's send queue */
q = PMIX_NEW(pmix_ptl_queue_t);
PMIX_RETAIN(pr);
q->peer = peer;
q->peer = pr;
q->buf = bfr;
q->tag = tag;
pmix_event_assign(&q->ev, pmix_globals.evbase, -1,
Expand Down