Skip to content

Commit c50bc74

Browse files
committed
Fix unused variable warnings
Both warnings in FT code were due to variables only being used in debug situations. The datatype change was just never used. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent d45c0d5 commit c50bc74

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

ompi/communicator/ft/comm_ft.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
121121
ompi_group_t *failed_group = NULL, *comm_group = NULL, *alive_group = NULL, *alive_rgroup = NULL;
122122
ompi_communicator_t *newcomp = NULL;
123123
int mode;
124+
#if OPAL_ENABLE_DEBUG
124125
double start, stop;
126+
#endif
125127

126128
*newcomm = MPI_COMM_NULL;
127129

@@ -132,15 +134,21 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
132134
OPAL_OUTPUT_VERBOSE((5, ompi_ftmpi_output_handle,
133135
"%s ompi: comm_shrink: Agreement on failed processes",
134136
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME) ));
137+
#if OPAL_ENABLE_DEBUG
135138
start = PMPI_Wtime();
139+
#endif
136140
opal_mutex_lock(&ompi_group_afp_mutex);
137141
ompi_group_intersection(comm->c_remote_group, ompi_group_all_failed_procs, &failed_group);
138142
opal_mutex_unlock(&ompi_group_afp_mutex);
143+
#if OPAL_ENABLE_DEBUG
139144
stop = PMPI_Wtime();
145+
#endif
140146
OPAL_OUTPUT_VERBOSE((10, ompi_ftmpi_output_handle,
141147
"%s ompi: comm_shrink: group_inter: %g seconds",
142148
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), stop-start));
149+
#if OPAL_ENABLE_DEBUG
143150
start = PMPI_Wtime();
151+
#endif
144152
do {
145153
/* We need to create the list of alive processes. Thus, we don't care about
146154
* the value of flag, instead we are only using the globally consistent
@@ -154,7 +162,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
154162
comm,
155163
comm->c_coll->coll_agree_module);
156164
} while( MPI_ERR_PROC_FAILED == ret );
165+
#if OPAL_ENABLE_DEBUG
157166
stop = PMPI_Wtime();
167+
#endif
158168
OPAL_OUTPUT_VERBOSE((10, ompi_ftmpi_output_handle,
159169
"%s ompi: comm_shrink: AGREE: %g seconds",
160170
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), stop-start));
@@ -171,7 +181,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
171181
OPAL_OUTPUT_VERBOSE((5, ompi_ftmpi_output_handle,
172182
"%s ompi: comm_shrink: Determine ranking for new communicator intra %d",
173183
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), OMPI_COMM_IS_INTRA(comm)));
184+
#if OPAL_ENABLE_DEBUG
174185
start = PMPI_Wtime();
186+
#endif
175187

176188
/* Create 'alive' groups */
177189
mode = OMPI_COMM_CID_INTRA_FT;
@@ -210,7 +222,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
210222
exit_status = MPI_ERR_INTERN;
211223
goto cleanup;
212224
}
225+
#if OPAL_ENABLE_DEBUG
213226
stop = PMPI_Wtime();
227+
#endif
214228
OPAL_OUTPUT_VERBOSE((10, ompi_ftmpi_output_handle,
215229
"%s ompi: comm_shrink: GRP COMPUTATION: %g seconds\n",
216230
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), stop-start));
@@ -221,7 +235,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
221235
OPAL_OUTPUT_VERBOSE((5, ompi_ftmpi_output_handle,
222236
"%s ompi: comm_shrink: Determine context id",
223237
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME) ));
238+
#if OPAL_ENABLE_DEBUG
224239
start = PMPI_Wtime();
240+
#endif
225241
ret = ompi_comm_nextcid( newcomp, /* new communicator */
226242
comm, /* old comm */
227243
NULL, /* bridge comm */
@@ -236,7 +252,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
236252
exit_status = ret;
237253
goto cleanup;
238254
}
255+
#if OPAL_ENABLE_DEBUG
239256
stop = PMPI_Wtime();
257+
#endif
240258
OPAL_OUTPUT_VERBOSE((10, ompi_ftmpi_output_handle,
241259
"%s ompi: comm_shrink: NEXT CID: %g seconds\n",
242260
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), stop-start));
@@ -248,7 +266,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
248266
snprintf(newcomp->c_name, MPI_MAX_OBJECT_NAME, "MPI COMMUNICATOR %d SHRUNK FROM %d",
249267
ompi_comm_get_local_cid(newcomp),
250268
ompi_comm_get_local_cid(comm));
269+
#if OPAL_ENABLE_DEBUG
251270
start = PMPI_Wtime();
271+
#endif
252272
/* activate communicator and init coll-module */
253273
ret = ompi_comm_activate( &newcomp, /* new communicator */
254274
comm,
@@ -261,7 +281,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
261281
exit_status = ret;
262282
goto cleanup;
263283
}
284+
#if OPAL_ENABLE_DEBUG
264285
stop = PMPI_Wtime();
286+
#endif
265287
OPAL_OUTPUT_VERBOSE((10, ompi_ftmpi_output_handle,
266288
"%s ompi: comm_shrink: COLL SELECT: %g seconds\n",
267289
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), stop-start));

ompi/communicator/ft/comm_ft_reliable_bcast.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ static void ompi_comm_rbcast_bml_recv_cb(
161161
const mca_btl_base_receive_descriptor_t* descriptor)
162162
{
163163
ompi_comm_rbcast_message_t* msg;
164-
mca_btl_base_tag_t tag = descriptor->tag;
165164
ompi_communicator_t* comm;
166165

167166
/* Parse the rbcast fragment */
168-
assert( MCA_BTL_TAG_FT_RBCAST == tag );
167+
assert( MCA_BTL_TAG_FT_RBCAST == descriptor->tag );
169168
assert( 1 == descriptor->des_segment_count );
170169
assert( sizeof(ompi_comm_rbcast_message_t) <= descriptor->des_segments->seg_len );
171170
msg = (ompi_comm_rbcast_message_t*) descriptor->des_segments->seg_addr.pval;

ompi/datatype/ompi_datatype_module.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,6 @@ int32_t ompi_datatype_init( void )
693693

694694
static int ompi_datatype_finalize (void)
695695
{
696-
int ret = OMPI_SUCCESS;
697-
698696
/* As the synonyms are just copies of the internal data we should not free them.
699697
* Anyway they are over the limit of OMPI_DATATYPE_MPI_MAX_PREDEFINED so they will never get freed.
700698
*/

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ component_query(struct ompi_win_t *win, void **base, size_t size, int disp_unit,
171171
struct ompi_communicator_t *comm, struct opal_info_t *info,
172172
int flavor)
173173
{
174-
int ret;
175-
176174
/* component only supports shared or allocate flavors */
177175
if (! (MPI_WIN_FLAVOR_SHARED == flavor ||
178176
MPI_WIN_FLAVOR_ALLOCATE == flavor)) {

0 commit comments

Comments
 (0)