Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit ae525ec

Browse files
committed
Merge pull request #1000 from ggouaillardet/topic/v2.x/misc_warnings
Fix misc warnings and missing include files
2 parents 8e731eb + c025cb3 commit ae525ec

File tree

12 files changed

+46
-12
lines changed

12 files changed

+46
-12
lines changed

opal/datatype/opal_convertor.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,10 @@ int32_t opal_convertor_set_position_nocheck( opal_convertor_t* convertor,
474474
}
475475
#else
476476
#define OPAL_CONVERTOR_COMPUTE_REMOTE_SIZE(convertor, datatype, bdt_mask) \
477-
assert(0 == (bdt_mask))
477+
{ \
478+
assert(0 == (bdt_mask)); \
479+
(void)bdt_mask; /* silence compiler warning */ \
480+
}
478481
#endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT */
479482

480483
/**

opal/mca/event/external/external.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
44
* Copyright (c) 2015 Intel, Inc. All rights reserved.
5+
* Copyright (c) 2015 Research Organization for Information Science
6+
* and Technology (RIST). All rights reserved.
57
*
68
* $COPYRIGHT$
79
*
@@ -17,6 +19,8 @@
1719
#ifndef MCA_OPAL_EVENT_EXTERNAL_H
1820
#define MCA_OPAL_EVENT_EXTERNAL_H
1921

22+
#include "opal_config.h"
23+
2024
#include "event.h"
2125
#include "event2/event.h"
2226
#include "event2/thread.h"

opal/mca/hwloc/hwloc1112/hwloc/src/topology.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ hwloc_topology_dup(hwloc_topology_t *newp,
523523
return -1;
524524
}
525525

526-
hwloc_topology_init(&new);
526+
if (0 != hwloc_topology_init(&new)) {
527+
return -1;
528+
}
527529

528530
new->flags = old->flags;
529531
memcpy(new->ignored_types, old->ignored_types, sizeof(old->ignored_types));
@@ -3128,6 +3130,7 @@ hwloc__check_children(struct hwloc_obj *parent)
31283130
assert(prev_firstchild < firstchild);
31293131
prev_firstchild = firstchild;
31303132
}
3133+
(void)prev_firstchild; // silence compiler warning
31313134
}
31323135

31333136
/* checks for all children */

opal/runtime/opal_progress.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2006-2014 Los Alamos National Security, LLC. All rights
1414
* reserved.
15-
* Copyright (c) 2015 Research Organization for Information Science
15+
* Copyright (c) 2015-2016 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
*
1818
* $COPYRIGHT$
@@ -217,10 +217,14 @@ opal_progress_set_event_flag(int flag)
217217
void
218218
opal_progress_event_users_increment(void)
219219
{
220+
#if OPAL_ENABLE_DEBUG
220221
int32_t val;
221222
val = opal_atomic_add_32(&num_event_users, 1);
222223

223224
OPAL_OUTPUT((debug_output, "progress: event_users_increment setting count to %d", val));
225+
#else
226+
(void)opal_atomic_add_32(&num_event_users, 1);
227+
#endif
224228

225229
#if OPAL_PROGRESS_USE_TIMERS
226230
/* force an update next round (we'll be past the delta) */
@@ -235,10 +239,14 @@ opal_progress_event_users_increment(void)
235239
void
236240
opal_progress_event_users_decrement(void)
237241
{
242+
#if OPAL_ENABLE_DEBUG || ! OPAL_PROGRESS_USE_TIMERS
238243
int32_t val;
239244
val = opal_atomic_sub_32(&num_event_users, 1);
240245

241246
OPAL_OUTPUT((debug_output, "progress: event_users_decrement setting count to %d", val));
247+
#else
248+
(void)opal_atomic_sub_32(&num_event_users, 1);
249+
#endif
242250

243251
#if !OPAL_PROGRESS_USE_TIMERS
244252
/* start now in delaying if it's easy */

orte/mca/ess/lsf/ess_lsf_module.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* All rights reserved.
1212
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2013 Intel, Inc. All rights reserved.
14+
* Copyright (c) 2016 Research Organization for Information Science
15+
* and Technology (RIST). All rights reserved.
1416
* $COPYRIGHT$
1517
*
1618
* Additional copyrights may follow
@@ -31,6 +33,7 @@
3133
#include <lsf/lsbatch.h>
3234

3335
#include "opal/util/opal_environ.h"
36+
#include "opal/util/argv.h"
3437

3538
#include "orte/util/show_help.h"
3639
#include "orte/util/name_fns.h"

orte/mca/iof/base/iof_base_setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include "opal/util/opal_pty.h"
5959
#include "opal/util/opal_environ.h"
6060
#include "opal/util/output.h"
61+
#include "opal/util/argv.h"
6162

6263
#include "orte/mca/errmgr/errmgr.h"
6364
#include "orte/util/name_fns.h"

orte/mca/plm/slurm/configure.m4

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ AC_DEFUN([MCA_orte_plm_slurm_CONFIG],[
4040

4141
# check to see if this is a Cray nativized slurm env.
4242

43+
slurm_cray_env=0
4344
ORTE_CHECK_ALPS([plm_slurm_cray],
44-
[AC_DEFINE_UNQUOTED([SLURM_CRAY_ENV],[1],
45-
[defined to 1 if slurm cray env, 0 otherwise])])
45+
[slurm_cray_env=1])
4646

47+
AC_DEFINE_UNQUOTED([SLURM_CRAY_ENV],[$slurm_cray_env],
48+
[defined to 1 if slurm cray env, 0 otherwise])
4749
])dnl

orte/mca/ras/slurm/ras_slurm_module.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,16 @@ static void recv_data(int fd, short args, void *cbdata)
922922
OBJ_DESTRUCT(&ndtmp);
923923
if (NULL != dash_host) {
924924
tpn = opal_argv_join(dash_host, ',');
925-
orte_set_attribute(&app->attributes, ORTE_APP_DASH_HOST, ORTE_ATTR_LOCAL, (void*)tpn, OPAL_STRING);
925+
for (idx=0; idx < jdata->apps->size; idx++) {
926+
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, idx))) {
927+
orte_show_help("help-ras-slurm.txt", "slurm-dyn-alloc-failed", true, jtrk->cmd);
928+
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_ALLOC_FAILED);
929+
opal_argv_free(dash_host);
930+
free(tpn);
931+
return;
932+
}
933+
orte_set_attribute(&app->attributes, ORTE_APP_DASH_HOST, ORTE_ATTR_LOCAL, (void*)tpn, OPAL_STRING);
934+
}
926935
opal_argv_free(dash_host);
927936
free(tpn);
928937
}

orte/runtime/data_type_support/orte_dt_unpacking_fns.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "opal/dss/dss.h"
2929
#include "opal/dss/dss_internal.h"
3030
#include "opal/mca/hwloc/hwloc.h"
31+
#include "opal/util/argv.h"
3132

3233
#include "orte/mca/errmgr/errmgr.h"
3334
#include "orte/runtime/data_type_support/orte_dt_support.h"

orte/runtime/orte_data_server.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ void orte_data_server(int status, orte_process_name_t* sender,
378378

379379
/* unpack any info elements */
380380
count = 1;
381+
uid = UINT32_MAX;
381382
while (ORTE_SUCCESS == (rc = opal_dss.unpack(buffer, &iptr, &count, OPAL_VALUE))) {
382383
/* if this is the userid, separate it out */
383384
if (0 == strcmp(iptr->key, OPAL_PMIX_USERID)) {
@@ -389,7 +390,7 @@ void orte_data_server(int status, orte_process_name_t* sender,
389390
/* ignore anything else for now */
390391
OBJ_RELEASE(iptr);
391392
}
392-
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
393+
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc || UINT32_MAX == uid) {
393394
ORTE_ERROR_LOG(rc);
394395
opal_argv_free(keys);
395396
goto SEND_ERROR;
@@ -539,6 +540,7 @@ void orte_data_server(int status, orte_process_name_t* sender,
539540

540541
/* unpack any info elements */
541542
count = 1;
543+
uid = UINT32_MAX;
542544
while (ORTE_SUCCESS == (rc = opal_dss.unpack(buffer, &iptr, &count, OPAL_VALUE))) {
543545
/* if this is the userid, separate it out */
544546
if (0 == strcmp(iptr->key, OPAL_PMIX_USERID)) {
@@ -547,7 +549,7 @@ void orte_data_server(int status, orte_process_name_t* sender,
547549
/* ignore anything else for now */
548550
OBJ_RELEASE(iptr);
549551
}
550-
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
552+
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc || UINT32_MAX == uid) {
551553
ORTE_ERROR_LOG(rc);
552554
opal_argv_free(keys);
553555
goto SEND_ERROR;

orte/test/system/regex.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <stdio.h>
1111
#include <unistd.h>
1212

13+
#include "opal/util/argv.h"
14+
1315
#include "orte/util/proc_info.h"
1416
#include "orte/util/regex.h"
1517
#include "orte/mca/errmgr/errmgr.h"

orte/util/dash_host/dash_host.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,6 @@ int orte_util_add_dash_host_nodes(opal_list_t *nodes,
274274
if (ORTE_FLAG_TEST(nd, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
275275
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_SLOTS_GIVEN);
276276
}
277-
/* don't ignore a slots directive */
278-
if (slots_given) {
279-
node->slots = slots;
280-
}
281277
break;
282278
}
283279
}

0 commit comments

Comments
 (0)