Skip to content

Commit 3557a67

Browse files
authored
Merge pull request #10019 from bwbarrett/cleanup/more-warning-fixes
More warning fixes
2 parents b5a855f + aec5097 commit 3557a67

File tree

7 files changed

+43
-10
lines changed

7 files changed

+43
-10
lines changed

ompi/communicator/comm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ int ompi_intercomm_create_from_groups (ompi_group_t *local_group, int local_lead
14701470
*newintercomm = MPI_COMM_NULL;
14711471

14721472
/* create a local communicator first. create a unique tag for this communicator */
1473-
asprintf (&sub_tag, "%s-OMPIi-%s", tag, OPAL_NAME_PRINT(ompi_group_get_proc_name (local_group, local_leader)));
1473+
opal_asprintf (&sub_tag, "%s-OMPIi-%s", tag, OPAL_NAME_PRINT(ompi_group_get_proc_name (local_group, local_leader)));
14741474
if (OPAL_UNLIKELY(NULL == sub_tag)) {
14751475
return OMPI_ERR_OUT_OF_RESOURCE;
14761476
}
@@ -1507,7 +1507,7 @@ int ompi_intercomm_create_from_groups (ompi_group_t *local_group, int local_lead
15071507
/* create a unique tag for allocating the leader communicator. we can eliminate this step
15081508
* if we take a CID from the newly allocated block belonging to local_comm. this is
15091509
* a note to make this change at a later time. */
1510-
asprintf (&sub_tag, "%s-OMPIi-LC", tag);
1510+
opal_asprintf (&sub_tag, "%s-OMPIi-LC", tag);
15111511
if (OPAL_UNLIKELY(NULL == sub_tag)) {
15121512
ompi_comm_free (&local_comm);
15131513
free(leader_procs);

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/instance/instance.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,11 @@ static void ompi_instance_get_num_psets_complete (pmix_status_t status,
950950
&info[n].value,
951951
(void **)&num_pmix_psets,
952952
&sz);
953+
if (rc != PMIX_SUCCESS) {
954+
opal_argv_free (ompi_mpi_instance_pmix_psets);
955+
ompi_mpi_instance_pmix_psets = NULL;
956+
goto done;
957+
}
953958
if (num_pmix_psets != ompi_mpi_instance_num_pmix_psets) {
954959
opal_argv_free (ompi_mpi_instance_pmix_psets);
955960
ompi_mpi_instance_pmix_psets = NULL;
@@ -963,12 +968,18 @@ static void ompi_instance_get_num_psets_complete (pmix_status_t status,
963968
&info[n].value,
964969
(void **)&pset_names,
965970
&sz);
971+
if (rc != PMIX_SUCCESS) {
972+
opal_argv_free (ompi_mpi_instance_pmix_psets);
973+
ompi_mpi_instance_pmix_psets = NULL;
974+
goto done;
975+
}
966976
ompi_mpi_instance_pmix_psets = opal_argv_split (pset_names, ',');
967977
ompi_mpi_instance_num_pmix_psets = opal_argv_count (ompi_mpi_instance_pmix_psets);
968978
free(pset_names);
969979
}
970980
}
971981

982+
done:
972983
if (NULL != release_fn) {
973984
release_fn(release_cbdata);
974985
}
@@ -1259,7 +1270,10 @@ static int ompi_instance_get_pmix_pset_size (ompi_instance_t *instance, const ch
12591270

12601271
int ompi_group_from_pset (ompi_instance_t *instance, const char *pset_name, ompi_group_t **group_out)
12611272
{
1262-
if (group_out == MPI_GROUP_NULL) {
1273+
if (NULL == group_out) {
1274+
return OMPI_ERR_BAD_PARAM;
1275+
}
1276+
if (*group_out == MPI_GROUP_NULL) {
12631277
return OMPI_ERR_BAD_PARAM;
12641278
}
12651279

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)) {

ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_seek.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "ompi/mca/sharedfp/sharedfp.h"
2929
#include "ompi/mca/sharedfp/base/base.h"
3030

31+
#include "opal/util/fd.h"
32+
3133
/*Use fcntl to lock the file which stores the current position*/
3234
#include <fcntl.h>
3335

@@ -119,7 +121,7 @@ mca_sharedfp_lockedfile_seek (ompio_file_t *fh,
119121
*--------------------
120122
*/
121123
lseek ( fd_lockedfilehandle, 0, SEEK_SET);
122-
write ( fd_lockedfilehandle, &offset, sizeof(OMPI_MPI_OFFSET_TYPE));
124+
opal_fd_write ( fd_lockedfilehandle, sizeof(OMPI_MPI_OFFSET_TYPE), &offset);
123125

124126
/*-------------------
125127
* unlock the file

0 commit comments

Comments
 (0)