Commit 1190372a authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r4887] Warning stomp.

parent b881be83
......@@ -9,7 +9,7 @@
#include "hydra_base.h"
HYD_Status HYD_BSCD_fork_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_fork_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list);
#endif /* FORK_H_INCLUDED */
......@@ -9,7 +9,7 @@
#include "bscu.h"
#include "fork.h"
HYD_Status HYD_BSCD_fork_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_fork_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list)
{
struct HYD_Partition *partition;
......
......@@ -14,7 +14,7 @@ struct HYD_BSCI_info {
};
struct HYD_BSCI_fns {
HYD_Status(*launch_procs) (char **global_args, char *partition_id_str,
HYD_Status(*launch_procs) (char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list);
HYD_Status(*finalize) (void);
HYD_Status(*wait_for_completion) (struct HYD_Partition *partition_list);
......@@ -26,7 +26,7 @@ struct HYD_BSCI_fns {
extern struct HYD_BSCI_fns HYD_BSCI_fns;
HYD_Status HYD_BSCI_init(char *bootstrap, char *bootstrap_exec, int enablex, int debug);
HYD_Status HYD_BSCI_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCI_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list);
HYD_Status HYD_BSCI_finalize(void);
HYD_Status HYD_BSCI_wait_for_completion(struct HYD_Partition *partition_list);
......
......@@ -9,7 +9,7 @@
#include "hydra_base.h"
HYD_Status HYD_BSCD_rsh_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_rsh_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list);
#endif /* RSH_H_INCLUDED */
......@@ -15,7 +15,7 @@
* environment variables. We fork a worker process that sets the
* environment and execvp's this executable.
*/
HYD_Status HYD_BSCD_rsh_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_rsh_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list)
{
struct HYD_Partition *partition;
......@@ -40,12 +40,14 @@ HYD_Status HYD_BSCD_rsh_launch_procs(char **global_args, char *partition_id_str,
HYDU_ERR_POP(status, "error while searching for executable in user path\n");
if (test_path) {
tmp[0] = test_path;
tmp[1] = "rsh";
tmp[0] = HYDU_strdup(test_path);
tmp[1] = HYDU_strdup("rsh");
tmp[2] = NULL;
status = HYDU_str_alloc_and_join(tmp, &path);
HYDU_ERR_POP(status, "error joining strings\n");
HYDU_free_strlist(tmp);
}
else
path = HYDU_strdup("/usr/bin/rsh");
......
......@@ -9,7 +9,7 @@
#include "hydra_base.h"
HYD_Status HYD_BSCD_slurm_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_slurm_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list);
HYD_Status HYD_BSCD_slurm_query_partition_id(int *partition_id);
HYD_Status HYD_BSCD_slurm_query_node_list(int num_nodes,
......
......@@ -9,7 +9,7 @@
#include "bscu.h"
#include "slurm.h"
HYD_Status HYD_BSCD_slurm_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_slurm_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list)
{
struct HYD_Partition *partition;
......@@ -34,12 +34,14 @@ HYD_Status HYD_BSCD_slurm_launch_procs(char **global_args, char *partition_id_st
HYDU_ERR_POP(status, "error while searching for executable in user path\n");
if (test_path) {
tmp[0] = test_path;
tmp[1] = "srun";
tmp[0] = HYDU_strdup(test_path);
tmp[1] = HYDU_strdup("srun");
tmp[2] = NULL;
status = HYDU_str_alloc_and_join(tmp, &path);
HYDU_ERR_POP(status, "error joining strings\n");
HYDU_free_strlist(tmp);
}
else
path = HYDU_strdup("/usr/bin/srun");
......@@ -52,15 +54,17 @@ HYD_Status HYD_BSCD_slurm_launch_procs(char **global_args, char *partition_id_st
i = 0;
num_nodes = 0;
FORALL_ACTIVE_PARTITIONS(partition, partition_list) {
tmp[i++] = partition->base->name;
tmp[i++] = HYDU_strdup(partition->base->name);
if (partition->next && partition->next->base->active)
tmp[i++] = ",";
tmp[i++] = HYDU_strdup(",");
num_nodes++;
}
tmp[i++] = NULL;
status = HYDU_str_alloc_and_join(tmp, &client_arg[arg]);
HYDU_ERR_POP(status, "error joining strings\n");
HYDU_free_strlist(tmp);
arg++;
client_arg[arg++] = HYDU_strdup("-N");
......
......@@ -9,7 +9,7 @@
#include "bscu.h"
struct HYD_BSCI_fns HYD_BSCI_fns = { 0 };
char *HYD_BSCI_comp_array[] = { @hydra_bss_name_array@ };
const char *HYD_BSCI_comp_array[] = { @hydra_bss_name_array@ };
HYD_Status(*HYD_BSCI_comp_init[])(void) = { @hydra_bss_init_array@ };
struct HYD_BSCI_info HYD_BSCI_info = { 0 };
......
......@@ -7,7 +7,7 @@
#include "hydra_utils.h"
#include "bsci.h"
HYD_Status HYD_BSCI_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCI_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list)
{
HYD_Status status = HYD_SUCCESS;
......
......@@ -9,7 +9,7 @@
#include "hydra_base.h"
HYD_Status HYD_BSCD_ssh_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_ssh_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list);
#endif /* SSH_H_INCLUDED */
......@@ -15,7 +15,7 @@
* environment variables. We fork a worker process that sets the
* environment and execvp's this executable.
*/
HYD_Status HYD_BSCD_ssh_launch_procs(char **global_args, char *partition_id_str,
HYD_Status HYD_BSCD_ssh_launch_procs(char **global_args, const char *partition_id_str,
struct HYD_Partition *partition_list)
{
struct HYD_Partition *partition;
......@@ -40,12 +40,14 @@ HYD_Status HYD_BSCD_ssh_launch_procs(char **global_args, char *partition_id_str,
HYDU_ERR_POP(status, "error while searching for executable in user path\n");
if (test_path) {
tmp[0] = test_path;
tmp[1] = "ssh";
tmp[0] = HYDU_strdup(test_path);
tmp[1] = HYDU_strdup("ssh");
tmp[2] = NULL;
status = HYDU_str_alloc_and_join(tmp, &path);
HYDU_ERR_POP(status, "error joining strings\n");
HYDU_free_strlist(tmp);
}
else
path = HYDU_strdup("/usr/bin/ssh");
......
......@@ -13,13 +13,11 @@ PAC_SUBCONFIG_INIT()
AC_CONFIG_HEADER(include/hydra_config.h)
# Check for special types
AC_TYPE_SIZE_T
dnl Bug in autoconf adds -O2 and -g by default. Make sure we only get
dnl the flags we want.
save_cflags=$CFLAGS
AC_PROG_CC
AC_TYPE_SIZE_T
CFLAGS=$save_cflags
AM_PROG_MKDIR_P
......@@ -253,15 +251,14 @@ AC_SUBST(hydra_css)
dnl Debugging support
AC_ARG_ENABLE(g, [ --enable-g Enable Debugging],
[ DEBUG=$enableval ],
[ DEBUG=no ])
[ debug=$enableval ],
[ debug=no ])
AC_MSG_CHECKING(debugging support)
AC_MSG_RESULT($DEBUG)
if test "$DEBUG" = "yes"; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -g"
AC_MSG_RESULT($debug)
if test "$debug" = "yes"; then
CFLAGS="$CFLAGS -g"
AC_DEFINE(ENABLE_DEBUG,1,[Define if debugging support is enabled])
fi
AC_SUBST(EXTRA_CFLAGS)
dnl Warning messages
AC_ARG_ENABLE(warnings, [ --enable-warnings Enable warnings],
......
......@@ -9,7 +9,7 @@
struct HYD_CSSI_fns HYD_CSSI_fns = { 0 };
char *HYD_CSSI_comp_array[] = { @hydra_css_name_array@ };
const char *HYD_CSSI_comp_array[] = { @hydra_css_name_array@ };
HYD_Status(*HYD_CSSI_comp_init[])(void) = { @hydra_css_init_array@ };
HYD_Status HYD_CSSI_init(char *css)
......
......@@ -98,7 +98,7 @@ HYD_Status HYD_DMX_deregister_fd(int fd)
}
HYD_Status HYD_DMX_wait_for_event(int time)
HYD_Status HYD_DMX_wait_for_event(int wtime)
{
int total_fds, i, j, events, ret;
HYD_DMXI_callback_t *run;
......@@ -131,7 +131,7 @@ HYD_Status HYD_DMX_wait_for_event(int time)
total_fds = i;
while (1) {
ret = poll(pollfds, total_fds, time);
ret = poll(pollfds, total_fds, wtime);
if (ret < 0) {
if (errno == EINTR) {
/* We were interrupted by a system call; this is not
......
......@@ -136,8 +136,8 @@ int HYDU_Error_printf_simple(const char *str, ...);
/* args */
HYD_Status HYDU_find_in_path(char *execname, char **path);
HYD_Status HYDU_get_base_path(char *execname, char *wdir, char **path);
HYD_Status HYDU_find_in_path(const char *execname, char **path);
HYD_Status HYDU_get_base_path(const char *execname, char *wdir, char **path);
/* bind */
......@@ -153,7 +153,7 @@ HYD_Env_t *HYDU_str_to_env(char *str);
HYD_Status HYDU_list_append_env_to_str(HYD_Env_t * env_list, char **str_list);
HYD_Status HYDU_list_inherited_env(HYD_Env_t ** env_list);
HYD_Env_t *HYDU_env_list_dup(HYD_Env_t * env);
HYD_Status HYDU_env_create(HYD_Env_t ** env, char *env_name, char *env_value);
HYD_Status HYDU_env_create(HYD_Env_t ** env, const char *env_name, char *env_value);
HYD_Status HYDU_env_free(HYD_Env_t * env);
HYD_Status HYDU_env_free_list(HYD_Env_t * env);
HYD_Env_t *HYDU_env_lookup(HYD_Env_t env, HYD_Env_t * env_list);
......@@ -222,11 +222,11 @@ HYD_Status HYDU_sock_listen(int *listen_fd, char *port_range, uint16_t * port);
HYD_Status HYDU_sock_connect(const char *host, uint16_t port, int *fd);
HYD_Status HYDU_sock_accept(int listen_fd, int *fd);
HYD_Status HYDU_sock_readline(int fd, char *buf, int maxlen, int *linelen);
HYD_Status HYDU_sock_writeline(int fd, char *buf, int maxsize);
HYD_Status HYDU_sock_writeline(int fd, const char *buf, int maxsize);
HYD_Status HYDU_sock_read(int fd, void *buf, int maxlen, int *count,
enum HYDU_sock_comm_flag flag);
HYD_Status HYDU_sock_write(int fd, void *buf, int maxsize);
HYD_Status HYDU_sock_trywrite(int fd, void *buf, int maxsize);
HYD_Status HYDU_sock_write(int fd, const void *buf, int maxsize);
HYD_Status HYDU_sock_trywrite(int fd, const void *buf, int maxsize);
HYD_Status HYDU_sock_set_nonblock(int fd);
HYD_Status HYDU_sock_set_cloexec(int fd);
HYD_Status HYDU_sock_stdout_cb(int fd, HYD_Event_t events, int stdout_fd, int *closed);
......
......@@ -157,7 +157,7 @@ static struct HYD_PMCD_pmi_node *allocate_node(HYD_PMCD_pmi_pg_t * pg, int node_
}
HYD_Status HYD_PMCD_pmi_add_kvs(char *key, char *val, HYD_PMCD_pmi_kvs_t * kvs,
HYD_Status HYD_PMCD_pmi_add_kvs(const char *key, char *val, HYD_PMCD_pmi_kvs_t * kvs,
char **key_pair_str, int *ret)
{
HYD_PMCD_pmi_kvs_pair_t *key_pair, *run;
......
......@@ -75,7 +75,7 @@ enum HYD_PMCD_pmi_process_mapping_type {
HYD_Status HYD_PMCD_pmi_add_process_to_pg(HYD_PMCD_pmi_pg_t * pg, int fd, int rank);
HYD_Status HYD_PMCD_pmi_id_to_rank(int id, int *rank);
HYD_PMCD_pmi_process_t *HYD_PMCD_pmi_find_process(int fd);
HYD_Status HYD_PMCD_pmi_add_kvs(char *key, char *val, HYD_PMCD_pmi_kvs_t * kvs,
HYD_Status HYD_PMCD_pmi_add_kvs(const char *key, char *val, HYD_PMCD_pmi_kvs_t * kvs,
char **key_pair_str, int *ret);
HYD_Status HYD_PMCD_pmi_process_mapping(HYD_PMCD_pmi_process_t * process,
enum HYD_PMCD_pmi_process_mapping_type type,
......@@ -86,7 +86,7 @@ HYD_Status HYD_PMCD_pmi_finalize(void);
extern HYD_PMCD_pmi_pg_t *HYD_pg_list;
struct HYD_PMCD_pmi_handle_fns {
char *cmd;
const char *cmd;
HYD_Status(*handler) (int fd, char *args[]);
};
......
......@@ -13,7 +13,7 @@
HYD_Status HYD_PMCD_pmi_handle_init(int fd, char *args[])
{
int pmi_version, pmi_subversion;
char *tmp;
const char *tmp;
HYD_Status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......
......@@ -57,9 +57,7 @@ HYD_Status HYD_PMCD_pmi_handle_v1_initack(int fd, char *args[])
status = HYDU_str_alloc_and_join(tmp, &cmd);
HYDU_ERR_POP(status, "error while joining strings\n");
for (i = 0; tmp[i]; i++)
HYDU_FREE(tmp[i]);
HYDU_free_strlist(tmp);
status = HYDU_sock_writeline(fd, cmd, strlen(cmd));
HYDU_ERR_POP(status, "error writing PMI line\n");
......@@ -103,9 +101,7 @@ HYD_Status HYD_PMCD_pmi_handle_v1_get_maxes(int fd, char *args[])
status = HYDU_str_alloc_and_join(tmp, &cmd);
HYDU_ERR_POP(status, "unable to join strings\n");
for (i = 0; tmp[i]; i++)
HYDU_FREE(tmp[i]);
HYDU_free_strlist(tmp);
status = HYDU_sock_writeline(fd, cmd, strlen(cmd));
HYDU_ERR_POP(status, "error writing PMI line\n");
......@@ -142,9 +138,7 @@ HYD_Status HYD_PMCD_pmi_handle_v1_get_appnum(int fd, char *args[])
status = HYDU_str_alloc_and_join(tmp, &cmd);
HYDU_ERR_POP(status, "unable to join strings\n");
for (i = 0; tmp[i]; i++)
HYDU_FREE(tmp[i]);
HYDU_free_strlist(tmp);
status = HYDU_sock_writeline(fd, cmd, strlen(cmd));
HYDU_ERR_POP(status, "error writing PMI line\n");
......@@ -175,13 +169,14 @@ HYD_Status HYD_PMCD_pmi_handle_v1_get_my_kvsname(int fd, char *args[])
"unable to find process structure for fd %d\n", fd);
i = 0;
tmp[i++] = "cmd=my_kvsname kvsname=";
tmp[i++] = process->node->pg->kvs->kvs_name;
tmp[i++] = "\n";
tmp[i++] = HYDU_strdup("cmd=my_kvsname kvsname=");
tmp[i++] = HYDU_strdup(process->node->pg->kvs->kvs_name);
tmp[i++] = HYDU_strdup("\n");
tmp[i++] = NULL;
status = HYDU_str_alloc_and_join(tmp, &cmd);
HYDU_ERR_POP(status, "unable to join strings\n");
HYDU_free_strlist(tmp);
status = HYDU_sock_writeline(fd, cmd, strlen(cmd));
HYDU_ERR_POP(status, "error writing PMI line\n");
......@@ -200,7 +195,7 @@ HYD_Status HYD_PMCD_pmi_handle_v1_barrier_in(int fd, char *args[])
{
HYD_PMCD_pmi_process_t *process, *prun;
HYD_PMCD_pmi_node_t *node;
char *cmd;
const char *cmd;
HYD_Status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......@@ -271,30 +266,31 @@ HYD_Status HYD_PMCD_pmi_handle_v1_put(int fd, char *args[])
key_pair->next = NULL;
i = 0;
tmp[i++] = "cmd=put_result rc=";
tmp[i++] = HYDU_strdup("cmd=put_result rc=");
if (process->node->pg->kvs->key_pair == NULL) {
process->node->pg->kvs->key_pair = key_pair;
tmp[i++] = "0 msg=success";
tmp[i++] = HYDU_strdup("0 msg=success");
}
else {
run = process->node->pg->kvs->key_pair;
while (run->next) {
if (!strcmp(run->key, key_pair->key)) {
tmp[i++] = "-1 msg=duplicate_key";
tmp[i++] = HYDU_strdup("-1 msg=duplicate_key");
key_pair_str = HYDU_strdup(key_pair->key);
tmp[i++] = key_pair_str;
tmp[i++] = HYDU_strdup(key_pair_str);
break;
}
run = run->next;
}
run->next = key_pair;
tmp[i++] = "0 msg=success";
tmp[i++] = HYDU_strdup("0 msg=success");
}
tmp[i++] = "\n";
tmp[i++] = HYDU_strdup("\n");
tmp[i++] = NULL;
status = HYDU_str_alloc_and_join(tmp, &cmd);
HYDU_ERR_POP(status, "unable to join strings\n");
HYDU_free_strlist(tmp);
status = HYDU_sock_writeline(fd, cmd, strlen(cmd));
HYDU_ERR_POP(status, "error writing PMI line\n");
......@@ -338,17 +334,17 @@ HYD_Status HYD_PMCD_pmi_handle_v1_get(int fd, char *args[])
kvsname, process->node->pg->kvs->kvs_name);
i = 0;
tmp[i++] = "cmd=get_result rc=";
tmp[i++] = HYDU_strdup("cmd=get_result rc=");
if (process->node->pg->kvs->key_pair == NULL) {
tmp[i++] = "-1 msg=key_";
tmp[i++] = key;
tmp[i++] = "_not_found value=unknown";
tmp[i++] = HYDU_strdup("-1 msg=key_");
tmp[i++] = HYDU_strdup(key);
tmp[i++] = HYDU_strdup("_not_found value=unknown");
}
else {
run = process->node->pg->kvs->key_pair;
while (run) {
if (!strcmp(run->key, key)) {
tmp[i++] = "0 msg=success value=";
tmp[i++] = HYDU_strdup("0 msg=success value=");
key_val_str = HYDU_strdup(run->val);
tmp[i++] = key_val_str;
break;
......@@ -356,21 +352,21 @@ HYD_Status HYD_PMCD_pmi_handle_v1_get(int fd, char *args[])
run = run->next;
}
if (run == NULL) {
tmp[i++] = "-1 msg=key_";
tmp[i++] = key;
tmp[i++] = "_not_found value=unknown";
tmp[i++] = HYDU_strdup("-1 msg=key_");
tmp[i++] = HYDU_strdup(key);
tmp[i++] = HYDU_strdup("_not_found value=unknown");
}
}
tmp[i++] = "\n";
tmp[i++] = HYDU_strdup("\n");
tmp[i++] = NULL;
status = HYDU_str_alloc_and_join(tmp, &cmd);
HYDU_ERR_POP(status, "unable to join strings\n");
HYDU_free_strlist(tmp);
status = HYDU_sock_writeline(fd, cmd, strlen(cmd));
HYDU_ERR_POP(status, "error writing PMI line\n");
HYDU_FREE(cmd);
HYDU_FREE(key_val_str);
fn_exit:
HYDU_FUNC_EXIT();
......@@ -383,7 +379,7 @@ HYD_Status HYD_PMCD_pmi_handle_v1_get(int fd, char *args[])
HYD_Status HYD_PMCD_pmi_handle_v1_finalize(int fd, char *args[])
{
char *cmd;
const char *cmd;
HYD_Status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......@@ -419,13 +415,14 @@ HYD_Status HYD_PMCD_pmi_handle_v1_get_usize(int fd, char *args[])
HYDU_ERR_POP(status, "unable to get bootstrap universe size\n");
i = 0;
tmp[i++] = "cmd=universe_size size=";
tmp[i++] = HYDU_strdup("cmd=universe_size size=");
tmp[i++] = HYDU_int_to_str(usize);
tmp[i++] = "\n";
tmp[i++] = HYDU_strdup("\n");
tmp[i++] = NULL;
status = HYDU_str_alloc_and_join(tmp, &cmd);
HYDU_ERR_POP(status, "unable to join strings\n");
HYDU_free_strlist(tmp);
status = HYDU_sock_writeline(fd, cmd, strlen(cmd));
HYDU_ERR_POP(status, "error writing PMI line\n");
......
......@@ -55,8 +55,9 @@ static void print_attr_reqs(void)
dprintf("%d:%d(", areq->fd, areq->type);
for (i = 0; areq->req[i]; i++) {
dprintf("%s", areq->req[i]);
if (areq->req[i + 1])
if (areq->req[i + 1]) {
dprintf(",");
}
}
dprintf(") ");
}
......@@ -196,7 +197,7 @@ static HYD_Status poke_progress(void)
}
static char *find_token_keyval(struct token *tokens, int count, char *key)
static char *find_token_keyval(struct token *tokens, int count, const char *key)
{
int i;
......@@ -394,7 +395,7 @@ HYD_Status HYD_PMCD_pmi_handle_v2_info_getnodeattr(int fd, char *args[])
int i, found;
HYD_PMCD_pmi_process_t *process;
HYD_PMCD_pmi_kvs_pair_t *run;
char *key, *wait, *thrid;
char *key, *waitval, *thrid;
char *tmp[HYD_NUM_TMP_STRINGS] = { 0 }, *cmd;
struct token *tokens;
int token_count;
......@@ -408,7 +409,7 @@ HYD_Status HYD_PMCD_pmi_handle_v2_info_getnodeattr(int fd, char *args[])
key = find_token_keyval(tokens, token_count, "key");
HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR, "unable to find key token\n");
wait = find_token_keyval(tokens, token_count, "wait");
waitval = find_token_keyval(tokens, token_count, "wait");
thrid = find_token_keyval(tokens, token_count, "thrid");
/* Find the group id corresponding to this fd */
......@@ -430,7 +431,7 @@ HYD_Status HYD_PMCD_pmi_handle_v2_info_getnodeattr(int fd, char *args[])
if (progress_nest_count)
goto fn_exit;
if (wait && !strcmp(wait, "TRUE")) {
if (waitval && !strcmp(waitval, "TRUE")) {
/* queue up */
status = queue_outstanding_req(fd, GET_NODE_ATTR, args);
HYDU_ERR_POP(status, "unable to queue outstanding request\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment