Skip to content

Commit 2db3879

Browse files
author
Sergey Oblomov
committed
SPML/UCX: fixed compilation warnings
- fixed compilation warnings produced by GCC 4.8 Signed-off-by: Sergey Oblomov <sergeyo@nvidia.com>
1 parent 52d1096 commit 2db3879

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

opal/mca/common/ucx/common_ucx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ BEGIN_C_DECLS
6161
#define MCA_COMMON_UCX_PROGRESS_LOOP(_worker) \
6262
for (unsigned iter = 0;; (++iter % opal_common_ucx.progress_iterations) \
6363
? (void) ucp_worker_progress(_worker) \
64-
: opal_progress())
64+
: (void) opal_progress())
6565

6666
#define MCA_COMMON_UCX_WAIT_LOOP(_request, _worker, _msg, _completed) \
6767
do { \

oshmem/mca/memheap/base/base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static inline int memheap_find_segnum(void *va, int pe)
199199
if (mkeys_cache) {
200200
if (mkeys_cache[pe]) {
201201
if ((va >= mkeys_cache[pe]->va_base) &&
202-
(va < mkeys_cache[pe]->va_base + mkeys_cache[pe]->len)) {
202+
((char*)va < (char*)mkeys_cache[pe]->va_base + mkeys_cache[pe]->len)) {
203203
return i;
204204
}
205205
}

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void mca_spml_ucx_peer_mkey_cache_init(mca_spml_ucx_ctx_t *ucx_ctx, int pe)
118118
int mca_spml_ucx_peer_mkey_cache_add(ucp_peer_t *ucp_peer, int index)
119119
{
120120
/* Allocate an array to hold the pointers to the ucx_cached_mkey */
121-
if (index >= ucp_peer->mkeys_cnt){
121+
if (index >= (int)ucp_peer->mkeys_cnt){
122122
int old_size = ucp_peer->mkeys_cnt;
123123
if (MCA_MEMHEAP_MAX_SEGMENTS <= (index + 1)) {
124124
SPML_UCX_ERROR("Failed to get new mkey for segment: max number (%d) of segment descriptor is exhausted",
@@ -153,7 +153,7 @@ int mca_spml_ucx_peer_mkey_cache_add(ucp_peer_t *ucp_peer, int index)
153153
/* Release individual mkeys */
154154
int mca_spml_ucx_peer_mkey_cache_del(ucp_peer_t *ucp_peer, int segno)
155155
{
156-
if ((ucp_peer->mkeys_cnt <= segno) || (segno < 0)) {
156+
if (((int)ucp_peer->mkeys_cnt <= segno) || (segno < 0)) {
157157
return OSHMEM_ERR_NOT_AVAILABLE;
158158
}
159159
if (NULL != ucp_peer->mkeys[segno]) {
@@ -166,7 +166,7 @@ int mca_spml_ucx_peer_mkey_cache_del(ucp_peer_t *ucp_peer, int segno)
166166
/* Release the memkey map from a ucp_peer if it has any element in memkey */
167167
void mca_spml_ucx_peer_mkey_cache_release(ucp_peer_t *ucp_peer)
168168
{
169-
int i;
169+
size_t i;
170170
if (ucp_peer->mkeys_cnt) {
171171
for(i = 0; i < ucp_peer->mkeys_cnt; i++) {
172172
assert(NULL == ucp_peer->mkeys[i]);
@@ -239,7 +239,6 @@ int mca_spml_ucx_ctx_mkey_add(mca_spml_ucx_ctx_t *ucx_ctx, int pe, uint32_t segn
239239
int mca_spml_ucx_ctx_mkey_del(mca_spml_ucx_ctx_t *ucx_ctx, int pe, uint32_t segno, spml_ucx_mkey_t *ucx_mkey)
240240
{
241241
ucp_peer_t *ucp_peer;
242-
spml_ucx_cached_mkey_t *ucx_cached_mkey;
243242
int rc;
244243
ucp_peer = &(ucx_ctx->ucp_peers[pe]);
245244
ucp_rkey_destroy(ucx_mkey->rkey);
@@ -398,8 +397,6 @@ static int oshmem_shmem_xchng(
398397
}
399398

400399

401-
static char spml_ucx_transport_ids[1] = { 0 };
402-
403400
int mca_spml_ucx_init_put_op_mask(mca_spml_ucx_ctx_t *ctx, size_t nprocs)
404401
{
405402
int res;
@@ -442,7 +439,7 @@ int mca_spml_ucx_add_procs(oshmem_group_t* group, size_t nprocs)
442439
unsigned int *wk_roffs = NULL;
443440
unsigned int *wk_rsizes = NULL;
444441
char *wk_raddrs = NULL;
445-
size_t i, j, w, n;
442+
size_t i, w, n;
446443
ucs_status_t err;
447444
ucp_address_t **wk_local_addr;
448445
unsigned int *wk_addr_len;
@@ -979,7 +976,7 @@ void mca_spml_ucx_ctx_destroy(shmem_ctx_t ctx)
979976

980977
int mca_spml_ucx_get(shmem_ctx_t ctx, void *src_addr, size_t size, void *dst_addr, int src)
981978
{
982-
void *rva;
979+
void *rva = NULL;
983980
spml_ucx_mkey_t *ucx_mkey = mca_spml_ucx_ctx_mkey_by_va(ctx, src, src_addr, &rva, &mca_spml_ucx);
984981
assert(NULL != ucx_mkey);
985982
mca_spml_ucx_ctx_t *ucx_ctx = (mca_spml_ucx_ctx_t *)ctx;
@@ -1006,7 +1003,7 @@ int mca_spml_ucx_get(shmem_ctx_t ctx, void *src_addr, size_t size, void *dst_add
10061003

10071004
int mca_spml_ucx_get_nb(shmem_ctx_t ctx, void *src_addr, size_t size, void *dst_addr, int src, void **handle)
10081005
{
1009-
void *rva;
1006+
void *rva = NULL;
10101007
ucs_status_t status;
10111008
spml_ucx_mkey_t *ucx_mkey = mca_spml_ucx_ctx_mkey_by_va(ctx, src, src_addr, &rva, &mca_spml_ucx);
10121009
assert(NULL != ucx_mkey);
@@ -1034,7 +1031,7 @@ int mca_spml_ucx_get_nb(shmem_ctx_t ctx, void *src_addr, size_t size, void *dst_
10341031
int mca_spml_ucx_get_nb_wprogress(shmem_ctx_t ctx, void *src_addr, size_t size, void *dst_addr, int src, void **handle)
10351032
{
10361033
unsigned int i;
1037-
void *rva;
1034+
void *rva = NULL;
10381035
ucs_status_t status;
10391036
spml_ucx_mkey_t *ucx_mkey = mca_spml_ucx_ctx_mkey_by_va(ctx, src, src_addr, &rva, &mca_spml_ucx);
10401037
assert(NULL != ucx_mkey);
@@ -1072,7 +1069,7 @@ int mca_spml_ucx_get_nb_wprogress(shmem_ctx_t ctx, void *src_addr, size_t size,
10721069

10731070
int mca_spml_ucx_put(shmem_ctx_t ctx, void* dst_addr, size_t size, void* src_addr, int dst)
10741071
{
1075-
void *rva;
1072+
void *rva = NULL;
10761073
spml_ucx_mkey_t *ucx_mkey = mca_spml_ucx_ctx_mkey_by_va(ctx, dst, dst_addr, &rva, &mca_spml_ucx);
10771074
assert(NULL != ucx_mkey);
10781075
mca_spml_ucx_ctx_t *ucx_ctx = (mca_spml_ucx_ctx_t *)ctx;
@@ -1106,7 +1103,7 @@ int mca_spml_ucx_put(shmem_ctx_t ctx, void* dst_addr, size_t size, void* src_add
11061103

11071104
int mca_spml_ucx_put_nb(shmem_ctx_t ctx, void* dst_addr, size_t size, void* src_addr, int dst, void **handle)
11081105
{
1109-
void *rva;
1106+
void *rva = NULL;
11101107
spml_ucx_mkey_t *ucx_mkey = mca_spml_ucx_ctx_mkey_by_va(ctx, dst, dst_addr, &rva, &mca_spml_ucx);
11111108
assert(NULL != ucx_mkey);
11121109
mca_spml_ucx_ctx_t *ucx_ctx = (mca_spml_ucx_ctx_t *)ctx;
@@ -1139,7 +1136,7 @@ int mca_spml_ucx_put_nb(shmem_ctx_t ctx, void* dst_addr, size_t size, void* src_
11391136
int mca_spml_ucx_put_nb_wprogress(shmem_ctx_t ctx, void* dst_addr, size_t size, void* src_addr, int dst, void **handle)
11401137
{
11411138
unsigned int i;
1142-
void *rva;
1139+
void *rva = NULL;
11431140
ucs_status_t status;
11441141
spml_ucx_mkey_t *ucx_mkey = mca_spml_ucx_ctx_mkey_by_va(ctx, dst, dst_addr, &rva, &mca_spml_ucx);
11451142
assert(NULL != ucx_mkey);

oshmem/mca/spml/ucx/spml_ucx.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ static inline int
213213
mca_spml_ucx_peer_mkey_get(ucp_peer_t *ucp_peer, int index, spml_ucx_cached_mkey_t **out_rmkey)
214214
{
215215
*out_rmkey = NULL;
216-
if (OPAL_UNLIKELY((index >= ucp_peer->mkeys_cnt) || (MCA_MEMHEAP_MAX_SEGMENTS <= index) || (0 > index))) {
217-
SPML_UCX_ERROR("Failed to get mkey for segment: bad index = %d, MAX = %d, cached mkeys count: %d",
216+
if (OPAL_UNLIKELY((index >= (int)ucp_peer->mkeys_cnt) ||
217+
(MCA_MEMHEAP_MAX_SEGMENTS <= index) || (0 > index))) {
218+
SPML_UCX_ERROR("Failed to get mkey for segment: bad index = %d, MAX = %d, cached mkeys count: %zu",
218219
index, MCA_MEMHEAP_MAX_SEGMENTS, ucp_peer->mkeys_cnt);
219220
return OSHMEM_ERR_BAD_PARAM;
220221
}

0 commit comments

Comments
 (0)