Skip to content

Commit 7d32da4

Browse files
committed
Fix some misc gcc warnings.
Signed-off-by: Austen Lauria <awlauria@us.ibm.com>
1 parent 0058f19 commit 7d32da4

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

ompi/datatype/ompi_datatype_module.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,9 @@ int32_t ompi_datatype_init( void )
544544
#define MOOG(name, index) \
545545
do { \
546546
int rc; \
547+
/* Silence 'unused' compiler warning in optimized builds, \
548+
where assert() is removed. */ \
549+
(void) rc; \
547550
ompi_mpi_##name.dt.d_f_to_c_index = index; \
548551
rc = opal_pointer_array_set_item(&ompi_datatype_f_to_c_table, \
549552
index, &ompi_mpi_##name); \

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,6 @@ static int ompi_osc_rdma_query_alternate_btls (ompi_communicator_t *comm, ompi_o
916916
mca_btl_base_selected_module_t *item;
917917
char **btls_to_use = opal_argv_split (ompi_osc_rdma_btl_alternate_names, ',');
918918
int btls_found = 0;
919-
void *tmp;
920919

921920
btls_to_use = opal_argv_split (ompi_osc_rdma_btl_alternate_names, ',');
922921
if (NULL == btls_to_use) {

ompi/mca/osc/rdma/osc_rdma_peer.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ int ompi_osc_rdma_new_peer (struct ompi_osc_rdma_module_t *module, int peer_id,
7979
struct mca_btl_base_endpoint_t *endpoint;
8080
ompi_osc_rdma_peer_t *peer;
8181
uint8_t module_btl_index = UINT8_MAX;
82-
mca_btl_base_module_t *btl = NULL;
8382

8483
*peer_out = NULL;
8584

@@ -90,10 +89,6 @@ int ompi_osc_rdma_new_peer (struct ompi_osc_rdma_module_t *module, int peer_id,
9089
return ret;
9190
}
9291

93-
if (endpoint) {
94-
btl = ompi_osc_rdma_selected_btl (module, module_btl_index);
95-
}
96-
9792
if (MPI_WIN_FLAVOR_DYNAMIC == module->flavor) {
9893
peer = (ompi_osc_rdma_peer_t *) OBJ_NEW(ompi_osc_rdma_peer_dynamic_t);
9994
} else if (module->same_size && module->same_disp_unit) {
@@ -127,7 +122,6 @@ static int ompi_osc_rdma_peer_setup (ompi_osc_rdma_module_t *module, ompi_osc_rd
127122
ompi_osc_rdma_peer_extended_t *ex_peer = (ompi_osc_rdma_peer_extended_t *) peer;
128123
uint64_t peer_data_size;
129124
uint64_t peer_data_offset, array_pointer;
130-
mca_btl_base_module_t *array_btl;
131125
struct mca_btl_base_endpoint_t *array_endpoint;
132126
ompi_osc_rdma_region_t *array_peer_data, *node_peer_data;
133127
ompi_osc_rdma_rank_data_t rank_data;

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,6 @@ static void mca_btl_base_am_descriptor_complete(mca_btl_base_module_t *btl,
421421
struct mca_btl_base_endpoint_t *endpoint,
422422
mca_btl_base_descriptor_t *descriptor, int status)
423423
{
424-
mca_btl_base_rdma_context_t *context = (mca_btl_base_rdma_context_t *) descriptor->des_context;
425-
426424
(void) mca_btl_base_am_rdma_advance(btl, endpoint,
427425
(mca_btl_base_rdma_context_t *) descriptor->des_context,
428426
/*send_descriptor=*/false);
@@ -454,39 +452,37 @@ mca_btl_base_rdma_start(mca_btl_base_module_t *btl, struct mca_btl_base_endpoint
454452
context->local_handle = local_handle;
455453
context->total_size = size;
456454

457-
size_t send_size = 0;
458-
size_t recv_size = 0;
459455
bool use_rdma = false;
460456

461457
if (MCA_BTL_BASE_AM_PUT == type) {
462458
if (sizeof(*hdr) + size <= btl->btl_eager_limit) {
463459
/* just go ahead and send the data */
464-
send_size = size;
460+
packet_size += size;
465461
} else if (!mca_btl_base_rdma_use_rdma_get(btl)) {
466-
send_size = size_t_min(size, btl->btl_max_send_size - sizeof(*hdr));
462+
packet_size += size;
463+
} else if (!mca_btl_base_rdma_use_rdma_get (btl)) {
464+
packet_size += size_t_min (size, btl->btl_max_send_size - sizeof (*hdr));
467465
} else {
468466
use_rdma = true;
469467
}
470468
} else if (MCA_BTL_BASE_AM_GET == type) {
471469
if (sizeof(mca_btl_base_rdma_response_hdr_t) + size <= btl->btl_eager_limit) {
472-
recv_size = size;
470+
packet_size += size;
473471
} else if (!mca_btl_base_rdma_use_rdma_put(btl)) {
474-
recv_size = size_t_min(size, btl->btl_max_send_size
472+
packet_size += size_t_min(size, btl->btl_max_send_size
475473
- sizeof(mca_btl_base_rdma_response_hdr_t));
476474
} else {
477475
use_rdma = true;
478476
}
479477
} else {
480478
/* fetching atomic. always recv result via active message */
481-
recv_size = size;
479+
packet_size += size;
482480
}
483481

484482
if (use_rdma && btl->btl_register_mem) {
485483
packet_size += 2 * btl->btl_registration_handle_size;
486484
}
487485

488-
packet_size += send_size;
489-
490486
BTL_VERBOSE(("Initiating RDMA operation. context=%p, size=%" PRIsize_t
491487
", packet_size=%" PRIsize_t,
492488
context, size, packet_size));
@@ -727,9 +723,8 @@ static int mca_btl_base_am_rdma_target_put(mca_btl_base_module_t *btl,
727723

728724
static void mca_btl_base_rdma_retry_operation(mca_btl_base_rdma_operation_t *operation)
729725
{
730-
mca_btl_base_module_t *btl = operation->btl;
731726
void *target_address = (void *) (intptr_t) operation->hdr.target_address;
732-
int ret;
727+
int ret = OPAL_SUCCESS;
733728

734729
if (!operation->descriptor && !operation->is_completed) {
735730
switch (operation->hdr.type) {
@@ -797,6 +792,8 @@ static int mca_btl_base_am_rdma_progress(void)
797792
}
798793
}
799794
}));
795+
796+
return 0;
800797
}
801798

802799
static int mca_btl_base_am_atomic_64(int64_t *operand, opal_atomic_int64_t *addr,
@@ -958,7 +955,6 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
958955

959956
const mca_btl_base_rdma_hdr_t *hdr = (mca_btl_base_rdma_hdr_t *) desc->des_segments[0]
960957
.seg_addr.pval;
961-
void *target_address = (void *) (intptr_t) hdr->target_address;
962958
uint64_t atomic_response = hdr->data.atomic.operand[0];
963959

964960
if (4 != hdr->data.atomic.size && 8 != hdr->data.atomic.size) {
@@ -969,7 +965,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
969965
BTL_VERBOSE(("got active-message atomic request. hdr->context=0x%" PRIx64
970966
", target_address=%p, "
971967
"segment 0 size=%" PRIu64,
972-
hdr->context, target_address, desc->des_segments[0].seg_len));
968+
hdr->context, (void *)(intptr_t)hdr->target_address, desc->des_segments[0].seg_len));
973969

974970
switch (hdr->type) {
975971
case MCA_BTL_BASE_AM_ATOMIC:

0 commit comments

Comments
 (0)