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

Fix misc warnings and missing include files #1000

Merged
merged 5 commits into from
Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion opal/datatype/opal_convertor.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ int32_t opal_convertor_set_position_nocheck( opal_convertor_t* convertor,
}
#else
#define OPAL_CONVERTOR_COMPUTE_REMOTE_SIZE(convertor, datatype, bdt_mask) \
assert(0 == (bdt_mask))
{ \
assert(0 == (bdt_mask)); \
(void)bdt_mask; /* silence compiler warning */ \
}
#endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT */

/**
Expand Down
4 changes: 4 additions & 0 deletions opal/mca/event/external/external.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* $COPYRIGHT$
*
Expand All @@ -17,6 +19,8 @@
#ifndef MCA_OPAL_EVENT_EXTERNAL_H
#define MCA_OPAL_EVENT_EXTERNAL_H

#include "opal_config.h"

#include "event.h"
#include "event2/event.h"
#include "event2/thread.h"
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/hwloc/hwloc1112/hwloc/src/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ hwloc_topology_dup(hwloc_topology_t *newp,
return -1;
}

hwloc_topology_init(&new);
if (0 != hwloc_topology_init(&new)) {
return -1;
}

new->flags = old->flags;
memcpy(new->ignored_types, old->ignored_types, sizeof(old->ignored_types));
Expand Down Expand Up @@ -3128,6 +3130,7 @@ hwloc__check_children(struct hwloc_obj *parent)
assert(prev_firstchild < firstchild);
prev_firstchild = firstchild;
}
(void)prev_firstchild; // silence compiler warning
}

/* checks for all children */
Expand Down
10 changes: 9 additions & 1 deletion opal/runtime/opal_progress.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2006-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* $COPYRIGHT$
Expand Down Expand Up @@ -217,10 +217,14 @@ opal_progress_set_event_flag(int flag)
void
opal_progress_event_users_increment(void)
{
#if OPAL_ENABLE_DEBUG
int32_t val;
val = opal_atomic_add_32(&num_event_users, 1);

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

#if OPAL_PROGRESS_USE_TIMERS
/* force an update next round (we'll be past the delta) */
Expand All @@ -235,10 +239,14 @@ opal_progress_event_users_increment(void)
void
opal_progress_event_users_decrement(void)
{
#if OPAL_ENABLE_DEBUG || ! OPAL_PROGRESS_USE_TIMERS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this second conditional (!OPAL_PROGRESS_USE_TIMERS) correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks correct to me, we only need val in order to print it (e.g. OPAL_ENABLE_DEBUG) or a few lines later if ! OPAL_PROGRESS_USE_TIMERS

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

int32_t val;
val = opal_atomic_sub_32(&num_event_users, 1);

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

#if !OPAL_PROGRESS_USE_TIMERS
/* start now in delaying if it's easy */
Expand Down
3 changes: 3 additions & 0 deletions orte/mca/ess/lsf/ess_lsf_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* All rights reserved.
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -31,6 +33,7 @@
#include <lsf/lsbatch.h>

#include "opal/util/opal_environ.h"
#include "opal/util/argv.h"

#include "orte/util/show_help.h"
#include "orte/util/name_fns.h"
Expand Down
1 change: 1 addition & 0 deletions orte/mca/iof/base/iof_base_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "opal/util/opal_pty.h"
#include "opal/util/opal_environ.h"
#include "opal/util/output.h"
#include "opal/util/argv.h"

#include "orte/mca/errmgr/errmgr.h"
#include "orte/util/name_fns.h"
Expand Down
6 changes: 4 additions & 2 deletions orte/mca/plm/slurm/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ AC_DEFUN([MCA_orte_plm_slurm_CONFIG],[

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

slurm_cray_env=0
ORTE_CHECK_ALPS([plm_slurm_cray],
[AC_DEFINE_UNQUOTED([SLURM_CRAY_ENV],[1],
[defined to 1 if slurm cray env, 0 otherwise])])
[slurm_cray_env=1])

AC_DEFINE_UNQUOTED([SLURM_CRAY_ENV],[$slurm_cray_env],
[defined to 1 if slurm cray env, 0 otherwise])
])dnl
11 changes: 10 additions & 1 deletion orte/mca/ras/slurm/ras_slurm_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,16 @@ static void recv_data(int fd, short args, void *cbdata)
OBJ_DESTRUCT(&ndtmp);
if (NULL != dash_host) {
tpn = opal_argv_join(dash_host, ',');
orte_set_attribute(&app->attributes, ORTE_APP_DASH_HOST, ORTE_ATTR_LOCAL, (void*)tpn, OPAL_STRING);
for (idx=0; idx < jdata->apps->size; idx++) {
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, idx))) {
orte_show_help("help-ras-slurm.txt", "slurm-dyn-alloc-failed", true, jtrk->cmd);
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_ALLOC_FAILED);
opal_argv_free(dash_host);
free(tpn);
return;
}
orte_set_attribute(&app->attributes, ORTE_APP_DASH_HOST, ORTE_ATTR_LOCAL, (void*)tpn, OPAL_STRING);
}
opal_argv_free(dash_host);
free(tpn);
}
Expand Down
1 change: 1 addition & 0 deletions orte/runtime/data_type_support/orte_dt_unpacking_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "opal/dss/dss.h"
#include "opal/dss/dss_internal.h"
#include "opal/mca/hwloc/hwloc.h"
#include "opal/util/argv.h"

#include "orte/mca/errmgr/errmgr.h"
#include "orte/runtime/data_type_support/orte_dt_support.h"
Expand Down
6 changes: 4 additions & 2 deletions orte/runtime/orte_data_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ void orte_data_server(int status, orte_process_name_t* sender,

/* unpack any info elements */
count = 1;
uid = UINT32_MAX;
while (ORTE_SUCCESS == (rc = opal_dss.unpack(buffer, &iptr, &count, OPAL_VALUE))) {
/* if this is the userid, separate it out */
if (0 == strcmp(iptr->key, OPAL_PMIX_USERID)) {
Expand All @@ -389,7 +390,7 @@ void orte_data_server(int status, orte_process_name_t* sender,
/* ignore anything else for now */
OBJ_RELEASE(iptr);
}
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc || UINT32_MAX == uid) {
ORTE_ERROR_LOG(rc);
opal_argv_free(keys);
goto SEND_ERROR;
Expand Down Expand Up @@ -539,6 +540,7 @@ void orte_data_server(int status, orte_process_name_t* sender,

/* unpack any info elements */
count = 1;
uid = UINT32_MAX;
while (ORTE_SUCCESS == (rc = opal_dss.unpack(buffer, &iptr, &count, OPAL_VALUE))) {
/* if this is the userid, separate it out */
if (0 == strcmp(iptr->key, OPAL_PMIX_USERID)) {
Expand All @@ -547,7 +549,7 @@ void orte_data_server(int status, orte_process_name_t* sender,
/* ignore anything else for now */
OBJ_RELEASE(iptr);
}
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
if (ORTE_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc || UINT32_MAX == uid) {
ORTE_ERROR_LOG(rc);
opal_argv_free(keys);
goto SEND_ERROR;
Expand Down
2 changes: 2 additions & 0 deletions orte/test/system/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <stdio.h>
#include <unistd.h>

#include "opal/util/argv.h"

#include "orte/util/proc_info.h"
#include "orte/util/regex.h"
#include "orte/mca/errmgr/errmgr.h"
Expand Down
4 changes: 0 additions & 4 deletions orte/util/dash_host/dash_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@ int orte_util_add_dash_host_nodes(opal_list_t *nodes,
if (ORTE_FLAG_TEST(nd, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_SLOTS_GIVEN);
}
/* don't ignore a slots directive */
if (slots_given) {
node->slots = slots;
}
break;
}
}
Expand Down