[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-225-gc655784
mysql vizuser
noreply at mpich.org
Sat May 18 20:26:03 CDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via c655784c9703992d037562fac82ad0536b3e9fe1 (commit)
via 6a39ab8721cbd4daca1803c186f8d41e97935f17 (commit)
from c532aacc14f77a04ffca0c212731700a5d3d9a01 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/c655784c9703992d037562fac82ad0536b3e9fe1
commit c655784c9703992d037562fac82ad0536b3e9fe1
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Sat May 18 20:23:51 2013 -0500
White space cleanup.
No reviewer.
diff --git a/src/pm/hydra/include/hydra.h b/src/pm/hydra/include/hydra.h
index 31dd1e1..ce27f26 100644
--- a/src/pm/hydra/include/hydra.h
+++ b/src/pm/hydra/include/hydra.h
@@ -552,8 +552,7 @@ HYD_status HYDU_create_process(char **client_arg, struct HYD_env *env_list,
/* others */
int HYDU_dceil(int x, int y);
-HYD_status HYDU_add_to_node_list(const char *hostname, int num_procs,
- struct HYD_node **node_list);
+HYD_status HYDU_add_to_node_list(const char *hostname, int num_procs, struct HYD_node **node_list);
HYD_status HYDU_gethostname(char *hostname);
void HYDU_delay(unsigned long delay);
diff --git a/src/pm/hydra/pm/pmiserv/common.c b/src/pm/hydra/pm/pmiserv/common.c
index d8f70ac..6cb3a20 100644
--- a/src/pm/hydra/pm/pmiserv/common.c
+++ b/src/pm/hydra/pm/pmiserv/common.c
@@ -20,8 +20,7 @@ void HYD_pmcd_init_header(struct HYD_pmcd_hdr *hdr)
hdr->signum = -1;
}
-HYD_status HYD_pmcd_pmi_parse_pmi_cmd(char *obuf, int pmi_version, char **pmi_cmd,
- char *args[])
+HYD_status HYD_pmcd_pmi_parse_pmi_cmd(char *obuf, int pmi_version, char **pmi_cmd, char *args[])
{
char *str1 = NULL, *cmd, *buf;
const char *delim;
@@ -68,8 +67,7 @@ HYD_status HYD_pmcd_pmi_parse_pmi_cmd(char *obuf, int pmi_version, char **pmi_cm
goto fn_exit;
}
-HYD_status HYD_pmcd_pmi_args_to_tokens(char *args[], struct HYD_pmcd_token **tokens,
- int *count)
+HYD_status HYD_pmcd_pmi_args_to_tokens(char *args[], struct HYD_pmcd_token **tokens, int *count)
{
int i, j;
char *arg;
@@ -77,8 +75,7 @@ HYD_status HYD_pmcd_pmi_args_to_tokens(char *args[], struct HYD_pmcd_token **tok
for (i = 0; args[i]; i++);
*count = i;
- HYDU_MALLOC(*tokens, struct HYD_pmcd_token *, *count * sizeof(struct HYD_pmcd_token),
- status);
+ HYDU_MALLOC(*tokens, struct HYD_pmcd_token *, *count * sizeof(struct HYD_pmcd_token), status);
for (i = 0; args[i]; i++) {
arg = HYDU_strdup(args[i]);
@@ -156,8 +153,7 @@ void HYD_pmcd_free_pmi_kvs_list(struct HYD_pmcd_pmi_kvs *kvs_list)
HYDU_FUNC_EXIT();
}
-HYD_status HYD_pmcd_pmi_add_kvs(const char *key, char *val, struct HYD_pmcd_pmi_kvs *kvs,
- int *ret)
+HYD_status HYD_pmcd_pmi_add_kvs(const char *key, char *val, struct HYD_pmcd_pmi_kvs *kvs, int *ret)
{
struct HYD_pmcd_pmi_kvs_pair *key_pair, *run;
HYD_status status = HYD_SUCCESS;
diff --git a/src/pm/hydra/pm/pmiserv/common.h b/src/pm/hydra/pm/pmiserv/common.h
index 53e4eb8..0fa38a5 100644
--- a/src/pm/hydra/pm/pmiserv/common.h
+++ b/src/pm/hydra/pm/pmiserv/common.h
@@ -14,8 +14,8 @@
#define PMI_MAXVALLEN (1024) /* max length of value in keyval space */
#define PMI_MAXKVSLEN (256) /* max length of various names */
-#define MAX_PMI_ARGS (1024) /* number of arguments in a PMI command */
-#define MAX_PMI_INTERNAL_ARGS (65536) /* number of arguments in internal communication */
+#define MAX_PMI_ARGS (1024) /* number of arguments in a PMI command */
+#define MAX_PMI_INTERNAL_ARGS (65536) /* number of arguments in internal communication */
struct HYD_pmcd_pmi_kvs_pair {
char key[PMI_MAXKEYLEN];
@@ -24,7 +24,7 @@ struct HYD_pmcd_pmi_kvs_pair {
};
struct HYD_pmcd_pmi_kvs {
- char kvsname[PMI_MAXKVSLEN]; /* Name of this kvs */
+ char kvsname[PMI_MAXKVSLEN]; /* Name of this kvs */
struct HYD_pmcd_pmi_kvs_pair *key_pair;
};
@@ -71,16 +71,12 @@ struct HYD_pmcd_token {
};
void HYD_pmcd_init_header(struct HYD_pmcd_hdr *hdr);
-HYD_status HYD_pmcd_pmi_parse_pmi_cmd(char *buf, int pmi_version, char **pmi_cmd,
- char *args[]);
-HYD_status HYD_pmcd_pmi_args_to_tokens(char *args[], struct HYD_pmcd_token **tokens,
- int *count);
+HYD_status HYD_pmcd_pmi_parse_pmi_cmd(char *buf, int pmi_version, char **pmi_cmd, char *args[]);
+HYD_status HYD_pmcd_pmi_args_to_tokens(char *args[], struct HYD_pmcd_token **tokens, int *count);
void HYD_pmcd_pmi_free_tokens(struct HYD_pmcd_token *tokens, int token_count);
-char *HYD_pmcd_pmi_find_token_keyval(struct HYD_pmcd_token *tokens, int count,
- const char *key);
+char *HYD_pmcd_pmi_find_token_keyval(struct HYD_pmcd_token *tokens, int count, const char *key);
HYD_status HYD_pmcd_pmi_allocate_kvs(struct HYD_pmcd_pmi_kvs **kvs, int pgid);
void HYD_pmcd_free_pmi_kvs_list(struct HYD_pmcd_pmi_kvs *kvs_list);
-HYD_status HYD_pmcd_pmi_add_kvs(const char *key, char *val, struct HYD_pmcd_pmi_kvs *kvs,
- int *ret);
+HYD_status HYD_pmcd_pmi_add_kvs(const char *key, char *val, struct HYD_pmcd_pmi_kvs *kvs, int *ret);
#endif /* COMMON_H_INCLUDED */
diff --git a/src/pm/hydra/pm/pmiserv/pmi_v2_common.c b/src/pm/hydra/pm/pmiserv/pmi_v2_common.c
index 0511e76..9aebe8d 100644
--- a/src/pm/hydra/pm/pmiserv/pmi_v2_common.c
+++ b/src/pm/hydra/pm/pmiserv/pmi_v2_common.c
@@ -15,8 +15,7 @@ HYD_status HYD_pmcd_pmi_v2_queue_req(int fd, int pid, int pgid, char *args[], ch
struct HYD_pmcd_pmi_v2_reqs *req, *tmp;
HYD_status status = HYD_SUCCESS;
- HYDU_MALLOC(req, struct HYD_pmcd_pmi_v2_reqs *, sizeof(struct HYD_pmcd_pmi_v2_reqs),
- status);
+ HYDU_MALLOC(req, struct HYD_pmcd_pmi_v2_reqs *, sizeof(struct HYD_pmcd_pmi_v2_reqs), status);
req->fd = fd;
req->pid = pid;
req->pgid = pgid;
diff --git a/src/pm/hydra/pm/pmiserv/pmip_cb.c b/src/pm/hydra/pm/pmiserv/pmip_cb.c
index e268293..d8681eb 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_cb.c
@@ -143,11 +143,9 @@ static HYD_status check_pmi_cmd(char **buf, int *pmi_version, int *repeat)
}
}
else { /* multi commands */
- for (bufptr = sptr; bufptr < sptr + pmi_storage_len - strlen("endcmd\n") + 1;
- bufptr++) {
+ for (bufptr = sptr; bufptr < sptr + pmi_storage_len - strlen("endcmd\n") + 1; bufptr++) {
if (bufptr[0] == 'e' && bufptr[1] == 'n' && bufptr[2] == 'd' &&
- bufptr[3] == 'c' && bufptr[4] == 'm' && bufptr[5] == 'd' &&
- bufptr[6] == '\n') {
+ bufptr[3] == 'c' && bufptr[4] == 'm' && bufptr[5] == 'd' && bufptr[6] == '\n') {
full_command = 1;
bufptr += strlen("endcmd\n") - 1;
break;
@@ -397,8 +395,7 @@ static HYD_status handle_pmi_response(int fd, struct HYD_pmcd_hdr hdr)
}
if (HYD_pmcd_pmip.user_global.debug) {
- HYDU_dump(stdout, "we don't understand the response %s; forwarding downstream\n",
- pmi_cmd);
+ HYDU_dump(stdout, "we don't understand the response %s; forwarding downstream\n", pmi_cmd);
}
status = HYDU_sock_write(hdr.pid, buf, hdr.buflen, &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
@@ -515,8 +512,7 @@ static HYD_status launch_procs(void)
status = HYDT_topo_init(HYD_pmcd_pmip.user_global.topolib,
HYD_pmcd_pmip.user_global.binding,
- HYD_pmcd_pmip.user_global.mapping,
- HYD_pmcd_pmip.user_global.membind);
+ HYD_pmcd_pmip.user_global.mapping, HYD_pmcd_pmip.user_global.membind);
HYDU_ERR_POP(status, "unable to initialize process topology\n");
status = HYDT_ckpoint_init(HYD_pmcd_pmip.user_global.ckpointlib,
@@ -526,8 +522,7 @@ static HYD_status launch_procs(void)
if (HYD_pmcd_pmip.user_global.ckpoint_prefix) {
using_pmi_port = 1;
status = HYDU_sock_create_and_listen_portstr(HYD_pmcd_pmip.user_global.iface,
- NULL, NULL, &pmi_port, pmi_listen_cb,
- NULL);
+ NULL, NULL, &pmi_port, pmi_listen_cb, NULL);
HYDU_ERR_POP(status, "unable to create PMI port\n");
}
@@ -587,15 +582,13 @@ static HYD_status launch_procs(void)
if (exec->env_prop)
list = HYDU_strdup(exec->env_prop + strlen("list:"));
else
- list = HYDU_strdup(HYD_pmcd_pmip.user_global.global_env.prop +
- strlen("list:"));
+ list = HYDU_strdup(HYD_pmcd_pmip.user_global.global_env.prop + strlen("list:"));
envstr = strtok(list, ",");
while (envstr) {
env = HYDU_env_lookup(envstr, HYD_pmcd_pmip.user_global.global_env.inherited);
if (env) {
- status = HYDU_append_env_to_list(env->env_name, env->env_value,
- &force_env);
+ status = HYDU_append_env_to_list(env->env_name, env->env_value, &force_env);
HYDU_ERR_POP(status, "unable to add env to list\n");
}
envstr = strtok(NULL, ",");
@@ -700,8 +693,7 @@ static HYD_status launch_procs(void)
&HYD_pmcd_pmip.downstream.in,
&HYD_pmcd_pmip.downstream.out[process_id],
&HYD_pmcd_pmip.downstream.err[process_id],
- &HYD_pmcd_pmip.downstream.pid[process_id],
- process_id);
+ &HYD_pmcd_pmip.downstream.pid[process_id], process_id);
HYDU_ERR_POP(status, "create process returned error\n");
if (HYD_pmcd_pmip.downstream.in != HYD_FD_UNSET) {
@@ -829,23 +821,20 @@ static HYD_status procinfo(int fd)
/* Read information about the application to launch into a string
* array and call parse_exec_params() to interpret it and load it into
* the proxy handle. */
- status = HYDU_sock_read(fd, &num_strings, sizeof(int), &recvd, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &num_strings, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data from upstream\n");
HYDU_ASSERT(!closed, status);
HYDU_MALLOC(arglist, char **, (num_strings + 1) * sizeof(char *), status);
for (i = 0; i < num_strings; i++) {
- status = HYDU_sock_read(fd, &str_len, sizeof(int), &recvd, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &str_len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data from upstream\n");
HYDU_ASSERT(!closed, status);
HYDU_MALLOC(arglist[i], char *, str_len, status);
- status = HYDU_sock_read(fd, arglist[i], str_len, &recvd, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, arglist[i], str_len, &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data from upstream\n");
HYDU_ASSERT(!closed, status);
}
@@ -921,8 +910,7 @@ HYD_status HYD_pmcd_pmip_control_cmd_cb(int fd, HYD_event_t events, void *userp)
HYDU_MALLOC(buf, char *, hdr.buflen, status);
HYDU_ERR_POP(status, "unable to allocate memory\n");
- status = HYDU_sock_read(fd, buf, hdr.buflen, &count, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, buf, hdr.buflen, &count, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "unable to read from control socket\n");
HYDU_ASSERT(!closed, status);
diff --git a/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c b/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
index 7269176..b23ff65 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
@@ -195,8 +195,7 @@ static HYD_status fn_initack(int fd, char *args[])
HYDU_ERR_POP(status, "unable to convert args to tokens\n");
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "pmiid");
- HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
- "unable to find pmiid token\n");
+ HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR, "unable to find pmiid token\n");
id = atoi(val);
/* Store the PMI_ID to fd mapping */
@@ -385,8 +384,7 @@ static HYD_status fn_get(int fd, char *args[])
HYDU_ERR_POP(status, "unable to convert args to tokens\n");
key = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "key");
- HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR,
- "unable to find token: key\n");
+ HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR, "unable to find token: key\n");
if (!strcmp(key, "PMI_process_mapping")) {
HYD_STRING_STASH_INIT(stash);
@@ -454,8 +452,7 @@ static HYD_status fn_put(int fd, char *args[])
HYDU_ERR_POP(status, "unable to convert args to tokens\n");
key = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "key");
- HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR,
- "unable to find token: key\n");
+ HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR, "unable to find token: key\n");
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "value");
if (val == NULL)
@@ -500,8 +497,10 @@ static HYD_status fn_keyval_cache(int fd, char *args[])
/* allocate a larger space for the cached keyvals, copy over the
* older keyvals and add the new ones in */
- HYDU_REALLOC(cache_get.key, char **, (cache_get.keyval_len + token_count) * sizeof(char *), status);
- HYDU_REALLOC(cache_get.val, char **, (cache_get.keyval_len + token_count) * sizeof(char *), status);
+ HYDU_REALLOC(cache_get.key, char **, (cache_get.keyval_len + token_count) * sizeof(char *),
+ status);
+ HYDU_REALLOC(cache_get.val, char **, (cache_get.keyval_len + token_count) * sizeof(char *),
+ status);
for (i = 0; i < token_count; i++) {
cache_get.key[cache_get.keyval_len + i] = HYDU_strdup(tokens[i].key);
diff --git a/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c b/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
index 8d2c66d..d2958c7 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
@@ -269,8 +269,7 @@ static HYD_status fn_info_putnodeattr(int fd, char *args[])
HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR, "unable to find key token\n");
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "value");
- HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
- "unable to find value token\n");
+ HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR, "unable to find value token\n");
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
@@ -406,8 +405,7 @@ static HYD_status fn_info_getjobattr(int fd, char *args[])
HYDU_ERR_POP(status, "unable to convert args to tokens\n");
key = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "key");
- HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR,
- "unable to find token: key\n");
+ HYDU_ERR_CHKANDJUMP(status, key == NULL, HYD_INTERNAL_ERROR, "unable to find token: key\n");
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
diff --git a/src/pm/hydra/pm/pmiserv/pmip_utils.c b/src/pm/hydra/pm/pmiserv/pmip_utils.c
index 876c412..d612416 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_utils.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_utils.c
@@ -436,8 +436,7 @@ static HYD_status global_process_count_fn(char *arg, char ***argv)
{
HYD_status status = HYD_SUCCESS;
- status = HYDU_set_int(arg, &HYD_pmcd_pmip.system_global.global_process_count,
- atoi(**argv));
+ status = HYDU_set_int(arg, &HYD_pmcd_pmip.system_global.global_process_count, atoi(**argv));
(*argv)++;
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_cb.c b/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
index 0328f28..473ee0d 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
@@ -100,8 +100,7 @@ static HYD_status cleanup_proxy(struct HYD_proxy *proxy)
goto fn_exit;
/* If the PMI listen fd has been initialized, deregister it */
- if (pg_scratch->pmi_listen_fd != HYD_FD_UNSET &&
- pg_scratch->pmi_listen_fd != HYD_FD_CLOSED) {
+ if (pg_scratch->pmi_listen_fd != HYD_FD_UNSET && pg_scratch->pmi_listen_fd != HYD_FD_CLOSED) {
status = HYDT_dmx_deregister_fd(pg_scratch->pmi_listen_fd);
HYDU_ERR_POP(status, "unable to deregister PMI listen fd\n");
close(pg_scratch->pmi_listen_fd);
@@ -196,8 +195,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
hdr.cmd = STDIN;
}
else {
- status =
- HYDU_sock_read(fd, &hdr, sizeof(hdr), &count, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &hdr, sizeof(hdr), &count, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "unable to read command from proxy\n");
HYDU_ASSERT(!closed, status);
}
@@ -226,8 +224,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
HYDU_ERR_POP(status, "debugger setup failed\n");
}
else if (hdr.cmd == EXIT_STATUS) {
- HYDU_MALLOC(proxy->exit_status, int *, proxy->proxy_process_count * sizeof(int),
- status);
+ HYDU_MALLOC(proxy->exit_status, int *, proxy->proxy_process_count * sizeof(int), status);
status =
HYDU_sock_read(fd, (void *) proxy->exit_status,
proxy->proxy_process_count * sizeof(int), &count, &closed,
@@ -256,8 +253,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
(stdout, "= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES\n");
HYDU_dump_noprefix(stdout, "= EXIT CODE: %d\n", code);
HYDU_dump_noprefix(stdout, "= CLEANING UP REMAINING PROCESSES\n");
- HYDU_dump_noprefix(stdout,
- "= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES\n");
+ HYDU_dump_noprefix(stdout, "= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES\n");
HYDU_dump_noprefix(stdout,
"==================================================");
HYDU_dump_noprefix(stdout, "=================================\n");
@@ -291,11 +287,9 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
HYDU_ASSERT(!closed, status);
if (hdr.cmd == STDOUT)
- status =
- HYD_server_info.stdout_cb(hdr.pgid, hdr.proxy_id, hdr.rank, buf, hdr.buflen);
+ status = HYD_server_info.stdout_cb(hdr.pgid, hdr.proxy_id, hdr.rank, buf, hdr.buflen);
else
- status =
- HYD_server_info.stderr_cb(hdr.pgid, hdr.proxy_id, hdr.rank, buf, hdr.buflen);
+ status = HYD_server_info.stderr_cb(hdr.pgid, hdr.proxy_id, hdr.rank, buf, hdr.buflen);
HYDU_ERR_POP(status, "error in the UI defined callback\n");
HYDU_FREE(buf);
@@ -304,8 +298,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
HYDU_MALLOC(buf, char *, HYD_TMPBUF_SIZE, status);
HYDU_ERR_POP(status, "unable to allocate memory\n");
- HYDU_sock_read(STDIN_FILENO, buf, HYD_TMPBUF_SIZE, &count, &closed,
- HYDU_SOCK_COMM_NONE);
+ HYDU_sock_read(STDIN_FILENO, buf, HYD_TMPBUF_SIZE, &count, &closed, HYDU_SOCK_COMM_NONE);
HYDU_ERR_POP(status, "error reading from stdin\n");
hdr.buflen = count;
@@ -403,8 +396,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
list = e;
}
else {
- for (tmp = list; tmp->next && tmp->next->start < hdr.pid;
- tmp = tmp->next);
+ for (tmp = list; tmp->next && tmp->next->start < hdr.pid; tmp = tmp->next);
e->next = tmp->next;
tmp->next = e;
}
@@ -428,8 +420,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
if (e->start == e->end)
HYDU_snprintf(run, PMI_MAXVALLEN, "%s,%d", str, e->start);
else
- HYDU_snprintf(run, PMI_MAXVALLEN, "%s,%d-%d", str, e->start,
- e->end);
+ HYDU_snprintf(run, PMI_MAXVALLEN, "%s,%d-%d", str, e->start, e->end);
}
else {
if (e->start == e->end)
@@ -446,12 +437,10 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
for (pg = &HYD_server_info.pg_list; pg; pg = pg->next) {
for (tproxy = pg->proxy_list; tproxy; tproxy = tproxy->next) {
- if (tproxy->control_fd == HYD_FD_UNSET ||
- tproxy->control_fd == HYD_FD_CLOSED)
+ if (tproxy->control_fd == HYD_FD_UNSET || tproxy->control_fd == HYD_FD_CLOSED)
continue;
- if (tproxy->pg->pgid == proxy->pg->pgid &&
- tproxy->proxy_id == proxy->proxy_id)
+ if (tproxy->pg->pgid == proxy->pg->pgid && tproxy->proxy_id == proxy->proxy_id)
continue;
status = HYD_pmcd_pmiserv_send_signal(tproxy, SIGUSR1);
@@ -511,8 +500,7 @@ HYD_status HYD_pmcd_pmiserv_proxy_init_cb(int fd, HYD_event_t events, void *user
pgid = ((int) (size_t) userp);
/* Read the proxy ID */
- status = HYDU_sock_read(fd, &proxy_id, sizeof(int), &count, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &proxy_id, sizeof(int), &count, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "sock read returned error\n");
HYDU_ASSERT(!closed, status);
@@ -521,8 +509,7 @@ HYD_status HYD_pmcd_pmiserv_proxy_init_cb(int fd, HYD_event_t events, void *user
if (pg->pgid == pgid)
break;
if (!pg)
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n",
- pgid);
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n", pgid);
/* Find the proxy */
for (proxy = pg->proxy_list; proxy; proxy = proxy->next) {
@@ -592,8 +579,7 @@ HYD_status HYD_pmcd_pmiserv_control_listen_cb(int fd, HYD_event_t events, void *
if (pg->pgid == pgid)
break;
if (!pg)
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n",
- pgid);
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n", pgid);
pg_scratch = (struct HYD_pmcd_pmi_pg_scratch *) pg->pg_scratch;
pg_scratch->control_listen_fd = fd;
@@ -602,8 +588,7 @@ HYD_status HYD_pmcd_pmiserv_control_listen_cb(int fd, HYD_event_t events, void *
status = HYDU_sock_accept(fd, &accept_fd);
HYDU_ERR_POP(status, "accept error\n");
- status = HYDT_dmx_register_fd(1, &accept_fd, HYD_POLLIN, userp,
- HYD_pmcd_pmiserv_proxy_init_cb);
+ status = HYDT_dmx_register_fd(1, &accept_fd, HYD_POLLIN, userp, HYD_pmcd_pmiserv_proxy_init_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
fn_exit:
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c
index ff96bd0..87e015c 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c
@@ -125,8 +125,7 @@ HYD_status HYD_pmcd_pmi_publish(char *name, char *port, int *success)
HYDU_ERR_POP(status, "error sending string list\n");
HYD_STRING_STASH_FREE(stash);
- status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading from nameserver\n");
HYDU_ASSERT(!closed, status);
@@ -222,8 +221,7 @@ HYD_status HYD_pmcd_pmi_unpublish(char *name, int *success)
HYDU_ERR_POP(status, "error sending string list\n");
HYD_STRING_STASH_FREE(stash);
- status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading from nameserver\n");
HYDU_ASSERT(!closed, status);
@@ -296,8 +294,7 @@ HYD_status HYD_pmcd_pmi_lookup(char *name, char **value)
HYDU_ERR_POP(status, "error sending string list\n");
HYD_STRING_STASH_FREE(stash);
- status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading from nameserver\n");
HYDU_ASSERT(!closed, status);
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi.h b/src/pm/hydra/pm/pmiserv/pmiserv_pmi.h
index 3f91267..1a3d6ae 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi.h
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi.h
@@ -37,7 +37,7 @@ struct HYD_pmcd_pmi_pg_scratch {
int dead_process_count;
struct HYD_pmcd_pmi_kvs *kvs;
- int keyval_dist_count; /* Number of keyvals distributed */
+ int keyval_dist_count; /* Number of keyvals distributed */
};
struct HYD_pmcd_pmi_publish {
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
index 3e2f51b..b079b7d 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
@@ -488,8 +488,7 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
*/
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "ncmds");
- HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
- "unable to find token: ncmds\n");
+ HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR, "unable to find token: ncmds\n");
ncmds = atoi(val);
HYDU_MALLOC(segment_list, struct HYD_pmcd_token_segment *,
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_utils.c b/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
index 7823905..98a9383 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
@@ -411,8 +411,7 @@ HYD_status HYD_pmcd_pmi_fill_in_exec_launch_info(struct HYD_pg *pg)
}
HYD_STRING_STASH(exec_stash, HYDU_strdup("--global-user-env"), status);
- for (i = 0, env = HYD_server_info.user_global.global_env.user; env;
- env = env->next, i++);
+ for (i = 0, env = HYD_server_info.user_global.global_env.user; env; env = env->next, i++);
HYD_STRING_STASH(exec_stash, HYDU_int_to_str(i), status);
for (env = HYD_server_info.user_global.global_env.user; env; env = env->next) {
@@ -425,8 +424,7 @@ HYD_status HYD_pmcd_pmi_fill_in_exec_launch_info(struct HYD_pg *pg)
}
HYD_STRING_STASH(exec_stash, HYDU_strdup("--global-system-env"), status);
- for (i = 0, env = HYD_server_info.user_global.global_env.system; env;
- env = env->next, i++);
+ for (i = 0, env = HYD_server_info.user_global.global_env.system; env; env = env->next, i++);
HYD_STRING_STASH(exec_stash, HYDU_int_to_str(i), status);
for (env = HYD_server_info.user_global.global_env.system; env; env = env->next) {
diff --git a/src/pm/hydra/tools/bootstrap/external/external_common_launch.c b/src/pm/hydra/tools/bootstrap/external/external_common_launch.c
index 9fe1a69..7ad0a54 100644
--- a/src/pm/hydra/tools/bootstrap/external/external_common_launch.c
+++ b/src/pm/hydra/tools/bootstrap/external/external_common_launch.c
@@ -97,15 +97,13 @@ static HYD_status sge_get_path(char **path)
goto fn_exit;
}
-HYD_status HYDT_bscd_common_launch_procs(char **args, struct HYD_proxy *proxy_list,
- int *control_fd)
+HYD_status HYDT_bscd_common_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd)
{
int num_hosts, idx, i, host_idx, fd, exec_idx, offset, lh, len, rc, autofork;
int *pid, *fd_list, *dummy;
int sockpair[2];
struct HYD_proxy *proxy;
- char *targs[HYD_NUM_TMP_STRINGS] = { NULL }, *path = NULL, *extra_arg_list =
- NULL, *extra_arg;
+ char *targs[HYD_NUM_TMP_STRINGS] = { NULL }, *path = NULL, *extra_arg_list = NULL, *extra_arg;
char quoted_exec_string[HYD_TMP_STRLEN], *original_exec_string;
struct HYD_env *env = NULL;
HYD_status status = HYD_SUCCESS;
@@ -199,8 +197,7 @@ HYD_status HYDT_bscd_common_launch_procs(char **args, struct HYD_proxy *proxy_li
HYD_bscu_pid_list = pid;
/* Increase fd list to accommodate these new fds */
- HYDU_MALLOC(fd_list, int *, (HYD_bscu_fd_count + (2 * num_hosts) + 1) * sizeof(int),
- status);
+ HYDU_MALLOC(fd_list, int *, (HYD_bscu_fd_count + (2 * num_hosts) + 1) * sizeof(int), status);
for (i = 0; i < HYD_bscu_fd_count; i++)
fd_list[i] = HYD_bscu_fd_list[i];
HYDU_FREE(HYD_bscu_fd_list);
@@ -223,8 +220,7 @@ HYD_status HYDT_bscd_common_launch_procs(char **args, struct HYD_proxy *proxy_li
len = strlen(proxy->node->user) + strlen("@") + strlen(proxy->node->hostname) + 1;
HYDU_MALLOC(targs[host_idx], char *, len, status);
- MPL_snprintf(targs[host_idx], len, "%s@%s", proxy->node->user,
- proxy->node->hostname);
+ MPL_snprintf(targs[host_idx], len, "%s@%s", proxy->node->user, proxy->node->hostname);
}
/* append proxy ID */
@@ -275,8 +271,7 @@ HYD_status HYDT_bscd_common_launch_procs(char **args, struct HYD_proxy *proxy_li
* to have problems when stdin is closed before they are
* launched. */
if (!strcmp(HYDT_bsci_info.launcher, "ssh") ||
- !strcmp(HYDT_bsci_info.launcher, "rsh") ||
- !strcmp(HYDT_bsci_info.launcher, "sge"))
+ !strcmp(HYDT_bsci_info.launcher, "rsh") || !strcmp(HYDT_bsci_info.launcher, "sge"))
dummy = &fd;
else
dummy = NULL;
diff --git a/src/pm/hydra/tools/bootstrap/external/ll.h b/src/pm/hydra/tools/bootstrap/external/ll.h
index 6196092..9d67453 100644
--- a/src/pm/hydra/tools/bootstrap/external/ll.h
+++ b/src/pm/hydra/tools/bootstrap/external/ll.h
@@ -11,8 +11,7 @@
HYD_status HYDTI_bscd_ll_query_node_count(int *count);
-HYD_status HYDT_bscd_ll_launch_procs(char **args, struct HYD_proxy *proxy_list,
- int *control_fd);
+HYD_status HYDT_bscd_ll_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd);
HYD_status HYDT_bscd_ll_query_proxy_id(int *proxy_id);
HYD_status HYDT_bscd_ll_query_native_int(int *ret);
HYD_status HYDT_bscd_ll_query_node_list(struct HYD_node **node_list);
diff --git a/src/pm/hydra/tools/bootstrap/external/ll_launch.c b/src/pm/hydra/tools/bootstrap/external/ll_launch.c
index 5f200ac..d4dc9c9 100644
--- a/src/pm/hydra/tools/bootstrap/external/ll_launch.c
+++ b/src/pm/hydra/tools/bootstrap/external/ll_launch.c
@@ -12,8 +12,7 @@
static int fd_stdout, fd_stderr;
-HYD_status HYDT_bscd_ll_launch_procs(char **args, struct HYD_proxy *proxy_list,
- int *control_fd)
+HYD_status HYDT_bscd_ll_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd)
{
int idx, i, total_procs, node_count;
int *pid, *fd_list, exec_idx;
diff --git a/src/pm/hydra/tools/bootstrap/external/pbs.h b/src/pm/hydra/tools/bootstrap/external/pbs.h
index 461d142..cc25a8d 100644
--- a/src/pm/hydra/tools/bootstrap/external/pbs.h
+++ b/src/pm/hydra/tools/bootstrap/external/pbs.h
@@ -20,8 +20,7 @@ struct HYDT_bscd_pbs_sys {
extern struct HYDT_bscd_pbs_sys *HYDT_bscd_pbs_sys;
-HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list,
- int *control_fd);
+HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd);
HYD_status HYDT_bscd_pbs_query_env_inherit(const char *env_name, int *ret);
HYD_status HYDT_bscd_pbs_wait_for_completion(int timeout);
HYD_status HYDT_bscd_pbs_launcher_finalize(void);
diff --git a/src/pm/hydra/tools/bootstrap/external/pbs_launch.c b/src/pm/hydra/tools/bootstrap/external/pbs_launch.c
index c97d634..32c6f14 100644
--- a/src/pm/hydra/tools/bootstrap/external/pbs_launch.c
+++ b/src/pm/hydra/tools/bootstrap/external/pbs_launch.c
@@ -35,8 +35,7 @@ static HYD_status find_pbs_node_id(const char *hostname, int *node_id)
goto fn_exit;
}
-HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list,
- int *control_fd)
+HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd)
{
int proxy_count, i, args_count, err, hostid;
struct HYD_proxy *proxy;
@@ -60,8 +59,7 @@ HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list,
for (args_count = 0; args[args_count]; args_count++)
targs[args_count] = HYDU_strdup(args[args_count]);
- HYDU_MALLOC(HYDT_bscd_pbs_sys->task_id, tm_task_id *, proxy_count * sizeof(tm_task_id),
- status);
+ HYDU_MALLOC(HYDT_bscd_pbs_sys->task_id, tm_task_id *, proxy_count * sizeof(tm_task_id), status);
HYDU_MALLOC(HYDT_bscd_pbs_sys->spawn_events, tm_event_t *,
proxy_count * sizeof(tm_event_t), status);
@@ -72,8 +70,7 @@ HYD_status HYDT_bscd_pbs_launch_procs(char **args, struct HYD_proxy *proxy_list,
for (i = 0, proxy = proxy_list; proxy; proxy = proxy->next, i++) {
if (pbs_node_list) {
status = find_pbs_node_id(proxy->node->hostname, &hostid);
- HYDU_ERR_POP(status, "error finding PBS node ID for host %s\n",
- proxy->node->hostname);
+ HYDU_ERR_POP(status, "error finding PBS node ID for host %s\n", proxy->node->hostname);
}
targs[args_count] = HYDU_int_to_str(i);
diff --git a/src/pm/hydra/tools/bootstrap/external/pbs_wait.c b/src/pm/hydra/tools/bootstrap/external/pbs_wait.c
index aeb08c9..f4fe2ad 100644
--- a/src/pm/hydra/tools/bootstrap/external/pbs_wait.c
+++ b/src/pm/hydra/tools/bootstrap/external/pbs_wait.c
@@ -42,8 +42,7 @@ HYD_status HYDT_bscd_pbs_wait_for_completion(int timeout)
if (HYDT_bscd_pbs_sys->spawn_events[idx] == e) {
/* got a spawn event (task_id[idx] is now valid);
* register this task for a termination event */
- err = tm_obit(HYDT_bscd_pbs_sys->task_id[idx], &taskobits[idx],
- &obit_events[idx]);
+ err = tm_obit(HYDT_bscd_pbs_sys->task_id[idx], &taskobits[idx], &obit_events[idx]);
HYDU_ERR_CHKANDJUMP(status, err != TM_SUCCESS, HYD_INTERNAL_ERROR,
"tm_obit() failed with TM error %d\n", err);
spawn_count--;
diff --git a/src/pm/hydra/tools/bootstrap/external/slurm.h b/src/pm/hydra/tools/bootstrap/external/slurm.h
index 2971378..6b4bd09 100644
--- a/src/pm/hydra/tools/bootstrap/external/slurm.h
+++ b/src/pm/hydra/tools/bootstrap/external/slurm.h
@@ -9,8 +9,7 @@
#include "hydra.h"
-HYD_status HYDT_bscd_slurm_launch_procs(char **args, struct HYD_proxy *proxy_list,
- int *control_fd);
+HYD_status HYDT_bscd_slurm_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd);
HYD_status HYDT_bscd_slurm_query_proxy_id(int *proxy_id);
HYD_status HYDT_bscd_slurm_query_native_int(int *ret);
HYD_status HYDT_bscd_slurm_query_node_list(struct HYD_node **node_list);
diff --git a/src/pm/hydra/tools/bootstrap/external/slurm_launch.c b/src/pm/hydra/tools/bootstrap/external/slurm_launch.c
index 6a55df2..682fa22 100644
--- a/src/pm/hydra/tools/bootstrap/external/slurm_launch.c
+++ b/src/pm/hydra/tools/bootstrap/external/slurm_launch.c
@@ -59,8 +59,7 @@ static HYD_status proxy_list_to_node_str(struct HYD_proxy *proxy_list, char **no
goto fn_exit;
}
-HYD_status HYDT_bscd_slurm_launch_procs(char **args, struct HYD_proxy *proxy_list,
- int *control_fd)
+HYD_status HYDT_bscd_slurm_launch_procs(char **args, struct HYD_proxy *proxy_list, int *control_fd)
{
int num_hosts, idx, i;
int *pid, *fd_list;
diff --git a/src/pm/hydra/tools/bootstrap/persist/persist_launch.c b/src/pm/hydra/tools/bootstrap/persist/persist_launch.c
index 47ddab3..c2faae4 100644
--- a/src/pm/hydra/tools/bootstrap/persist/persist_launch.c
+++ b/src/pm/hydra/tools/bootstrap/persist/persist_launch.c
@@ -31,15 +31,13 @@ static HYD_status persist_cb(int fd, HYD_event_t events, void *userp)
HYDU_ASSERT(!closed, status);
if (hdr.io_type == HYDT_PERSIST_STDOUT) {
- HYDU_sock_write(STDOUT_FILENO, buf, hdr.buflen, &sent, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ HYDU_sock_write(STDOUT_FILENO, buf, hdr.buflen, &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "stdout forwarding error\n");
HYDU_ASSERT(!closed, status);
HYDU_ASSERT(sent == hdr.buflen, status);
}
else {
- HYDU_sock_write(STDERR_FILENO, buf, hdr.buflen, &sent, &closed,
- HYDU_SOCK_COMM_MSGWAIT);
+ HYDU_sock_write(STDERR_FILENO, buf, hdr.buflen, &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "stderr forwarding error\n");
HYDU_ASSERT(!closed, status);
HYDU_ASSERT(sent == hdr.buflen, status);
diff --git a/src/pm/hydra/tools/bootstrap/persist/persist_server.c b/src/pm/hydra/tools/bootstrap/persist/persist_server.c
index 8f78e86..0561b5e 100644
--- a/src/pm/hydra/tools/bootstrap/persist/persist_server.c
+++ b/src/pm/hydra/tools/bootstrap/persist/persist_server.c
@@ -99,8 +99,7 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
}
else {
status = HYDT_dmx_deregister_fd(private.stdout_fd);
- HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n",
- private.stdout_fd);
+ HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n", private.stdout_fd);
close(private.stdout_fd);
}
}
@@ -130,8 +129,7 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
}
else {
status = HYDT_dmx_deregister_fd(private.stderr_fd);
- HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n",
- private.stderr_fd);
+ HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n", private.stderr_fd);
close(private.stderr_fd);
}
}
@@ -162,8 +160,7 @@ static HYD_status listen_cb(int fd, HYD_event_t events, void *userp)
/* fork and let the slave process handle this connection */
private.slave_pid = fork();
- HYDU_ERR_CHKANDJUMP(status, private.slave_pid < 0, HYD_INTERNAL_ERROR,
- "fork failed\n");
+ HYDU_ERR_CHKANDJUMP(status, private.slave_pid < 0, HYD_INTERNAL_ERROR, "fork failed\n");
if (private.slave_pid > 0) { /* master process */
close(private.client_fd); /* the slave process will handle this */
diff --git a/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in b/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in
index 4aae377..abbd61e 100644
--- a/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in
+++ b/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in
@@ -177,8 +177,7 @@ HYD_status HYDT_bsci_init(const char *user_rmk, const char *user_launcher,
/* This function is mandatory */
if (HYDT_bsci_fns.launch_procs == NULL)
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
- "mandatory launch function undefined\n");
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "mandatory launch function undefined\n");
fn_exit:
HYDU_FUNC_EXIT();
diff --git a/src/pm/hydra/tools/ckpoint/blcr/ckpoint_blcr.c b/src/pm/hydra/tools/ckpoint/blcr/ckpoint_blcr.c
index 4dfa679..4da436c 100644
--- a/src/pm/hydra/tools/ckpoint/blcr/ckpoint_blcr.c
+++ b/src/pm/hydra/tools/ckpoint/blcr/ckpoint_blcr.c
@@ -92,12 +92,10 @@ static HYD_status create_stdinouterr_sock(int *port)
sin.sin_port = htons(0);
ret = bind(listen_fd, (struct sockaddr *) &sin, sizeof(sin));
- HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "bind() failed, %s\n",
- strerror(errno));
+ HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "bind() failed, %s\n", strerror(errno));
ret = listen(listen_fd, SOMAXCONN);
- HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "listen() failed, %s\n",
- strerror(errno));
+ HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "listen() failed, %s\n", strerror(errno));
len = sizeof(sin);
ret = getsockname(listen_fd, (struct sockaddr *) &sin, &len);
@@ -222,16 +220,14 @@ HYD_status HYDT_ckpoint_blcr_checkpoint(const char *prefix, int pgid, int id, in
HYDU_FUNC_ENTER();
/* build the checkpoint filename */
- MPL_snprintf(filename, sizeof(filename), "%s/context-num%d-%d-%d", prefix, ckpt_num, pgid,
- id);
+ MPL_snprintf(filename, sizeof(filename), "%s/context-num%d-%d-%d", prefix, ckpt_num, pgid, id);
/* remove existing checkpoint file, if any */
(void) unlink(filename);
/* open the checkpoint file */
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC /* | O_LARGEFILE */ , 0600);
- HYDU_ERR_CHKANDJUMP(status, fd < 0, HYD_INTERNAL_ERROR, "open failed: %s\n",
- strerror(errno));
+ HYDU_ERR_CHKANDJUMP(status, fd < 0, HYD_INTERNAL_ERROR, "open failed: %s\n", strerror(errno));
cr_initialize_checkpoint_args_t(&my_args);
my_args.cr_fd = fd;
@@ -272,8 +268,7 @@ HYD_status HYDT_ckpoint_blcr_checkpoint(const char *prefix, int pgid, int id, in
}
ret = close(my_args.cr_fd);
- HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n",
- strerror(errno));
+ HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n", strerror(errno));
fn_exit:
HYDU_FUNC_EXIT();
@@ -312,8 +307,7 @@ HYD_status HYDT_ckpoint_blcr_restart(const char *prefix, int pgid, int id, int c
HYDU_ERR_POP(status, "blcr restart\n");
/* open the checkpoint file */
- MPL_snprintf(filename, sizeof(filename), "%s/context-num%d-%d-%d", prefix, ckpt_num, pgid,
- id);
+ MPL_snprintf(filename, sizeof(filename), "%s/context-num%d-%d-%d", prefix, ckpt_num, pgid, id);
context_fd = open(filename, O_RDONLY /* | O_LARGEFILE */);
HYDU_ERR_CHKANDJUMP(status, context_fd < 0, HYD_INTERNAL_ERROR, "open failed, %s\n",
strerror(errno));
@@ -329,8 +323,7 @@ HYD_status HYDT_ckpoint_blcr_restart(const char *prefix, int pgid, int id, int c
strerror(errno));
ret = close(context_fd);
- HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n",
- strerror(errno));
+ HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n", strerror(errno));
/* get fds for stdin/out/err sockets, and get pids of restarted processes */
status = wait_for_stdinouterr_sockets(num_ranks, ranks, in, out, err, pid);
diff --git a/src/pm/hydra/tools/ckpoint/ckpoint.c b/src/pm/hydra/tools/ckpoint/ckpoint.c
index 3fef2a4..b730bd3 100644
--- a/src/pm/hydra/tools/ckpoint/ckpoint.c
+++ b/src/pm/hydra/tools/ckpoint/ckpoint.c
@@ -29,8 +29,7 @@ HYD_status HYDT_ckpoint_init(const char *user_ckpointlib, int user_ckpoint_num)
if (user_ckpointlib)
HYDT_ckpoint_info.ckpointlib = user_ckpointlib;
- else if (MPL_env2str("HYDRA_CKPOINTLIB", (const char **) &HYDT_ckpoint_info.ckpointlib) ==
- 0)
+ else if (MPL_env2str("HYDRA_CKPOINTLIB", (const char **) &HYDT_ckpoint_info.ckpointlib) == 0)
HYDT_ckpoint_info.ckpointlib = HYDRA_DEFAULT_CKPOINTLIB;
/* If there is no default checkpointlib, we bail out */
@@ -114,8 +113,7 @@ HYD_status HYDT_ckpoint_checkpoint(int pgid, int id, const char *user_ckpoint_pr
* join with it to free resources */
if (in_ckpt == HYDT_CKPOINT_FINISHED) {
ret = pthread_join(thread, NULL);
- HYDU_ERR_CHKANDJUMP(status, ret, HYD_FAILURE, "pthread_join failed: %s.",
- strerror(ret));
+ HYDU_ERR_CHKANDJUMP(status, ret, HYD_FAILURE, "pthread_join failed: %s.", strerror(ret));
}
/* set state, and start the thread to do the checkpoint */
diff --git a/src/pm/hydra/tools/demux/demux.c b/src/pm/hydra/tools/demux/demux.c
index fbda54c..de72774 100644
--- a/src/pm/hydra/tools/demux/demux.c
+++ b/src/pm/hydra/tools/demux/demux.c
@@ -76,8 +76,7 @@ HYD_status HYDT_dmx_init(char **demux)
}
HYD_status HYDT_dmx_register_fd(int num_fds, int *fd, HYD_event_t events, void *userp,
- HYD_status(*callback) (int fd, HYD_event_t events,
- void *userp))
+ HYD_status(*callback) (int fd, HYD_event_t events, void *userp))
{
struct HYDT_dmxu_callback *cb_element, *run;
#if defined HAVE_ERROR_CHECKING
@@ -107,8 +106,7 @@ HYD_status HYDT_dmx_register_fd(int num_fds, int *fd, HYD_event_t events, void *
}
#endif /* HAVE_ERROR_CHECKING */
- HYDU_MALLOC(cb_element, struct HYDT_dmxu_callback *, sizeof(struct HYDT_dmxu_callback),
- status);
+ HYDU_MALLOC(cb_element, struct HYDT_dmxu_callback *, sizeof(struct HYDT_dmxu_callback), status);
cb_element->num_fds = num_fds;
HYDU_MALLOC(cb_element->fd, int *, num_fds * sizeof(int), status);
memcpy(cb_element->fd, fd, num_fds * sizeof(int));
@@ -158,8 +156,7 @@ HYD_status HYDT_dmx_deregister_fd(int fd)
}
/* FD is not found */
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
- "could not find fd to deregister: %d\n", fd);
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "could not find fd to deregister: %d\n", fd);
fn_exit:
HYDU_FUNC_EXIT();
diff --git a/src/pm/hydra/tools/demux/demux.h b/src/pm/hydra/tools/demux/demux.h
index 736f459..71fcb0e 100644
--- a/src/pm/hydra/tools/demux/demux.h
+++ b/src/pm/hydra/tools/demux/demux.h
@@ -38,8 +38,7 @@ HYD_status HYDT_dmx_init(char **demux);
* event.
*/
HYD_status HYDT_dmx_register_fd(int num_fds, int *fd, HYD_event_t events, void *userp,
- HYD_status(*callback) (int fd, HYD_event_t events,
- void *userp));
+ HYD_status(*callback) (int fd, HYD_event_t events, void *userp));
/**
* \brief HYDT_dmx_deregister_fd - Deregister file descriptor
diff --git a/src/pm/hydra/tools/demux/demux_poll.c b/src/pm/hydra/tools/demux/demux_poll.c
index fd522bd..3b98f9a 100644
--- a/src/pm/hydra/tools/demux/demux_poll.c
+++ b/src/pm/hydra/tools/demux/demux_poll.c
@@ -15,8 +15,7 @@ HYD_status HYDT_dmxu_poll_wait_for_event(int wtime)
HYDU_FUNC_ENTER();
- HYDU_MALLOC(pollfds, struct pollfd *, HYDT_dmxu_num_cb_fds * sizeof(struct pollfd),
- status);
+ HYDU_MALLOC(pollfds, struct pollfd *, HYDT_dmxu_num_cb_fds * sizeof(struct pollfd), status);
for (i = 0, run = HYDT_dmxu_cb_list; run; run = run->next) {
for (j = 0; j < run->num_fds; j++) {
diff --git a/src/pm/hydra/tools/demux/demux_select.c b/src/pm/hydra/tools/demux/demux_select.c
index d9ae11f..13ccc62 100644
--- a/src/pm/hydra/tools/demux/demux_select.c
+++ b/src/pm/hydra/tools/demux/demux_select.c
@@ -51,8 +51,7 @@ HYD_status HYDT_dmxu_select_wait_for_event(int wtime)
status = HYD_SUCCESS;
goto fn_exit;
}
- HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "select error (%s)\n",
- HYDU_strerror(errno));
+ HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "select error (%s)\n", HYDU_strerror(errno));
}
work_done = 0;
diff --git a/src/pm/hydra/tools/nameserver/hydra_nameserver.c b/src/pm/hydra/tools/nameserver/hydra_nameserver.c
index 38361f0..af57689 100644
--- a/src/pm/hydra/tools/nameserver/hydra_nameserver.c
+++ b/src/pm/hydra/tools/nameserver/hydra_nameserver.c
@@ -129,8 +129,7 @@ static HYD_status request_cb(int fd, HYD_event_t events, void *userp)
HYDU_FUNC_ENTER();
- status =
- HYDU_sock_read(fd, &list_len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &list_len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data\n");
if (closed) {
@@ -151,25 +150,21 @@ static HYD_status request_cb(int fd, HYD_event_t events, void *userp)
if (!strcmp(cmd, "PUBLISH")) {
HYDU_MALLOC(publish, struct HYDT_ns_publish *, sizeof(struct HYDT_ns_publish), status);
- status =
- HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data\n");
HYDU_ASSERT(!closed, status);
HYDU_MALLOC(publish->name, char *, len + 1, status);
- status =
- HYDU_sock_read(fd, publish->name, len, &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, publish->name, len, &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data\n");
HYDU_ASSERT(!closed, status);
- status =
- HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data\n");
HYDU_ASSERT(!closed, status);
HYDU_MALLOC(publish->info, char *, len + 1, status);
- status =
- HYDU_sock_read(fd, publish->info, len, &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, publish->info, len, &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data\n");
HYDU_ASSERT(!closed, status);
@@ -198,8 +193,7 @@ static HYD_status request_cb(int fd, HYD_event_t events, void *userp)
}
}
else if (!strcmp(cmd, "UNPUBLISH")) {
- status =
- HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data\n");
HYDU_ASSERT(!closed, status);
@@ -236,8 +230,7 @@ static HYD_status request_cb(int fd, HYD_event_t events, void *userp)
}
}
else if (!strcmp(cmd, "LOOKUP")) {
- status =
- HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_read(fd, &len, sizeof(int), &recvd, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "error reading data\n");
HYDU_ASSERT(!closed, status);
diff --git a/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c b/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c
index e0a1455..38da519 100644
--- a/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c
+++ b/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c
@@ -134,8 +134,7 @@ static hwloc_obj_t find_obj_containing_pu(hwloc_obj_type_t type, int idx, int ca
return obj;
}
-static HYD_status get_nbobjs_by_type(hwloc_obj_type_t type, int *nbobjs,
- int *nbobjs_per_parent)
+static HYD_status get_nbobjs_by_type(hwloc_obj_type_t type, int *nbobjs, int *nbobjs_per_parent)
{
int x, nb;
hwloc_obj_type_t parent, t;
@@ -254,8 +253,7 @@ static HYD_status cache_to_cpu_type(int cache_depth, hwloc_obj_type_t * cpu_type
cache_obj->attr->cache.depth != cache_depth)
cache_obj = cache_obj->first_child;
if (cache_obj == NULL) {
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "cache level %d not found\n",
- cache_depth);
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "cache level %d not found\n", cache_depth);
}
cpu_obj = hwloc_get_root_obj(topology);
@@ -436,17 +434,13 @@ static HYD_status handle_bitmap_binding(const char *binding, const char *mapping
if (map_str[i] == 'T')
status = get_nbobjs_by_type(HWLOC_OBJ_PU, &total_nbobjs[i], &nbobjs_per_parent[i]);
else if (map_str[i] == 'C')
- status =
- get_nbobjs_by_type(HWLOC_OBJ_CORE, &total_nbobjs[i], &nbobjs_per_parent[i]);
+ status = get_nbobjs_by_type(HWLOC_OBJ_CORE, &total_nbobjs[i], &nbobjs_per_parent[i]);
else if (map_str[i] == 'S')
- status =
- get_nbobjs_by_type(HWLOC_OBJ_SOCKET, &total_nbobjs[i], &nbobjs_per_parent[i]);
+ status = get_nbobjs_by_type(HWLOC_OBJ_SOCKET, &total_nbobjs[i], &nbobjs_per_parent[i]);
else if (map_str[i] == 'N')
- status =
- get_nbobjs_by_type(HWLOC_OBJ_NODE, &total_nbobjs[i], &nbobjs_per_parent[i]);
+ status = get_nbobjs_by_type(HWLOC_OBJ_NODE, &total_nbobjs[i], &nbobjs_per_parent[i]);
else if (map_str[i] == 'B')
- status =
- get_nbobjs_by_type(HWLOC_OBJ_MACHINE, &total_nbobjs[i], &nbobjs_per_parent[i]);
+ status = get_nbobjs_by_type(HWLOC_OBJ_MACHINE, &total_nbobjs[i], &nbobjs_per_parent[i]);
HYDU_ERR_POP(status, "unable to get number of objects\n");
nbpu_per_obj[i] = HYDT_topo_hwloc_info.num_bitmaps / total_nbobjs[i];
@@ -564,8 +558,7 @@ HYD_status HYDT_topo_hwloc_bind(int idx)
HYDU_FUNC_ENTER();
hwloc_set_cpubind(topology, HYDT_topo_hwloc_info.bitmap[id], 0);
- hwloc_set_membind(topology, HYDT_topo_hwloc_info.bitmap[id],
- HYDT_topo_hwloc_info.membind, 0);
+ hwloc_set_membind(topology, HYDT_topo_hwloc_info.bitmap[id], HYDT_topo_hwloc_info.membind, 0);
HYDU_FUNC_EXIT();
return status;
diff --git a/src/pm/hydra/ui/mpich/mpiexec.c b/src/pm/hydra/ui/mpich/mpiexec.c
index 83fbcfa..653d3cd 100644
--- a/src/pm/hydra/ui/mpich/mpiexec.c
+++ b/src/pm/hydra/ui/mpich/mpiexec.c
@@ -102,7 +102,7 @@ static HYD_status qsort_node_list(void)
HYD_status status = HYD_SUCCESS;
for (count = 0, node = HYD_server_info.node_list; node; node = node->next, count++)
- /* skip */;
+ /* skip */ ;
HYDU_MALLOC(node_list, struct HYD_node **, count * sizeof(struct HYD_node *), status);
for (i = 0, node = HYD_server_info.node_list; node; node = node->next, i++)
diff --git a/src/pm/hydra/ui/mpich/utils.c b/src/pm/hydra/ui/mpich/utils.c
index 65eb3e0..a84d9da 100644
--- a/src/pm/hydra/ui/mpich/utils.c
+++ b/src/pm/hydra/ui/mpich/utils.c
@@ -57,8 +57,7 @@ static void help_help_fn(void)
printf(" -genv {name} {value} environment variable name and value\n");
printf(" -genvlist {env1,env2,...} environment variable list to pass\n");
printf(" -genvnone do not pass any environment variables\n");
- printf
- (" -genvall pass all environment variables not managed\n");
+ printf(" -genvall pass all environment variables not managed\n");
printf(" by the launcher (default)\n");
printf("\n");
@@ -66,8 +65,7 @@ static void help_help_fn(void)
printf(" -f {name} file containing the host names\n");
printf(" -hosts {host list} comma separated host list\n");
printf(" -wdir {dirname} working directory to use\n");
- printf
- (" -configfile {name} config file containing MPMD launch options\n");
+ printf(" -configfile {name} config file containing MPMD launch options\n");
printf("\n");
printf("\n");
@@ -121,8 +119,7 @@ static void help_help_fn(void)
printf("\n");
printf(" Demux engine options:\n");
- printf(" -demux demux engine (%s)\n",
- HYDRA_AVAILABLE_DEMUXES);
+ printf(" -demux demux engine (%s)\n", HYDRA_AVAILABLE_DEMUXES);
printf("\n");
printf(" Other Hydra options:\n");
@@ -136,8 +133,7 @@ static void help_help_fn(void)
printf(" -prepend-pattern prepend pattern to output\n");
printf(" -outfile-pattern direct stdout to file\n");
printf(" -errfile-pattern direct stderr to file\n");
- printf
- (" -nameserver name server information (host:port format)\n");
+ printf(" -nameserver name server information (host:port format)\n");
printf(" -disable-auto-cleanup don't cleanup processes on error\n");
printf(" -disable-hostname-propagation let MPICH auto-detect the hostname\n");
printf(" -order-nodes order nodes as ascending/descending cores\n");
@@ -336,8 +332,7 @@ static HYD_status mfile_fn(char *arg, char ***argv)
"duplicate host file setting\n");
if (strcmp(**argv, "HYDRA_USE_LOCALHOST")) {
- status =
- HYDU_parse_hostfile(**argv, &HYD_server_info.node_list, HYDU_process_mfile_token);
+ status = HYDU_parse_hostfile(**argv, &HYD_server_info.node_list, HYDU_process_mfile_token);
HYDU_ERR_POP(status, "error parsing hostfile\n");
}
else {
@@ -1208,11 +1203,9 @@ static HYD_status info_fn(char *arg, char ***argv)
HYD_status status = HYD_SUCCESS;
HYDU_dump_noprefix(stdout, "HYDRA build details:\n");
+ HYDU_dump_noprefix(stdout, " Version: %s\n", HYDRA_VERSION);
HYDU_dump_noprefix(stdout,
- " Version: %s\n", HYDRA_VERSION);
- HYDU_dump_noprefix(stdout,
- " Release Date: %s\n",
- HYDRA_RELEASE_DATE);
+ " Release Date: %s\n", HYDRA_RELEASE_DATE);
HYDU_dump_noprefix(stdout, " CC: %s\n", HYDRA_CC);
HYDU_dump_noprefix(stdout, " CXX: %s\n", HYDRA_CXX);
HYDU_dump_noprefix(stdout, " F77: %s\n", HYDRA_F77);
@@ -1228,8 +1221,7 @@ static HYD_status info_fn(char *arg, char ***argv)
" Topology libraries available: %s\n",
HYDRA_AVAILABLE_TOPOLIBS);
HYDU_dump_noprefix(stdout,
- " Resource management kernels available: %s\n",
- HYDRA_AVAILABLE_RMKS);
+ " Resource management kernels available: %s\n", HYDRA_AVAILABLE_RMKS);
HYDU_dump_noprefix(stdout,
" Checkpointing libraries available: %s\n",
HYDRA_AVAILABLE_CKPOINTLIBS);
@@ -1366,8 +1358,7 @@ static HYD_status hostname_propagation_fn(char *arg, char ***argv)
goto fn_exit;
}
- status = HYDU_set_int(arg, &hostname_propagation,
- strcmp(arg, "disable-hostname-propagation"));
+ status = HYDU_set_int(arg, &hostname_propagation, strcmp(arg, "disable-hostname-propagation"));
HYDU_ERR_POP(status, "error setting hostname propagation\n");
fn_exit:
@@ -1440,8 +1431,7 @@ static void usize_help_fn(void)
{
printf("\n");
printf("-usize: Universe size (SYSTEM, INFINITE, <value>\n");
- printf
- (" SYSTEM: Number of cores passed to mpiexec through hostfile or resource manager\n");
+ printf(" SYSTEM: Number of cores passed to mpiexec through hostfile or resource manager\n");
printf(" INFINITE: No limit\n");
printf(" <value>: Numeric value >= 0\n\n");
}
@@ -1520,10 +1510,8 @@ static HYD_status set_default_values(void)
tmp = NULL;
}
- if (HYD_server_info.node_list == NULL &&
- MPL_env2str("HYDRA_HOST_FILE", (const char **) &tmp)) {
- status =
- HYDU_parse_hostfile(tmp, &HYD_server_info.node_list, HYDU_process_mfile_token);
+ if (HYD_server_info.node_list == NULL && MPL_env2str("HYDRA_HOST_FILE", (const char **) &tmp)) {
+ status = HYDU_parse_hostfile(tmp, &HYD_server_info.node_list, HYDU_process_mfile_token);
HYDU_ERR_POP(status, "error parsing hostfile\n");
}
diff --git a/src/pm/hydra/utils/alloc/alloc.c b/src/pm/hydra/utils/alloc/alloc.c
index 4c44c71..fa5d429 100644
--- a/src/pm/hydra/utils/alloc/alloc.c
+++ b/src/pm/hydra/utils/alloc/alloc.c
@@ -182,8 +182,7 @@ void HYDU_free_pg_list(struct HYD_pg *pg_list)
}
}
-static HYD_status alloc_proxy(struct HYD_proxy **proxy, struct HYD_pg *pg,
- struct HYD_node *node)
+static HYD_status alloc_proxy(struct HYD_proxy **proxy, struct HYD_pg *pg, struct HYD_node *node)
{
HYD_status status = HYD_SUCCESS;
@@ -298,8 +297,7 @@ void HYDU_free_exec_list(struct HYD_exec *exec_list)
HYDU_FUNC_EXIT();
}
-static HYD_status add_exec_to_proxy(struct HYD_exec *exec, struct HYD_proxy *proxy,
- int num_procs)
+static HYD_status add_exec_to_proxy(struct HYD_exec *exec, struct HYD_proxy *proxy, int num_procs)
{
int i;
struct HYD_exec *texec;
@@ -420,8 +418,7 @@ HYD_status HYDU_create_proxy_list(struct HYD_exec *exec_list, struct HYD_node *n
exec = exec_list;
filler_round = 1;
- for (proxy = pg->proxy_list; proxy && proxy->filler_processes == 0;
- proxy = proxy->next);
+ for (proxy = pg->proxy_list; proxy && proxy->filler_processes == 0; proxy = proxy->next);
if (proxy == NULL) {
filler_round = 0;
proxy = pg->proxy_list;
@@ -448,8 +445,7 @@ HYD_status HYDU_create_proxy_list(struct HYD_exec *exec_list, struct HYD_node *n
proxy = pg->proxy_list;
}
- proxy_rem_cores =
- filler_round ? proxy->filler_processes : proxy->node->core_count;
+ proxy_rem_cores = filler_round ? proxy->filler_processes : proxy->node->core_count;
}
num_procs = (exec_rem_procs > proxy_rem_cores) ? proxy_rem_cores : exec_rem_procs;
diff --git a/src/pm/hydra/utils/args/args.c b/src/pm/hydra/utils/args/args.c
index 6f21887..56a5571 100644
--- a/src/pm/hydra/utils/args/args.c
+++ b/src/pm/hydra/utils/args/args.c
@@ -140,8 +140,7 @@ static HYD_status match_arg(char ***argv_p, struct HYD_arg_match_table *match_ta
if (**argv_p && (!strcmp(**argv_p, "-h") || !strcmp(**argv_p, "-help") ||
!strcmp(**argv_p, "--help"))) {
if (m->help_fn == NULL) {
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
- "No help message available\n");
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "No help message available\n");
}
else {
m->help_fn();
@@ -207,8 +206,7 @@ HYD_status HYDU_set_int(char *arg, int *var, int val)
{
HYD_status status = HYD_SUCCESS;
- HYDU_ERR_CHKANDJUMP(status, *var != -1, HYD_INTERNAL_ERROR,
- "duplicate setting: %s\n", arg);
+ HYDU_ERR_CHKANDJUMP(status, *var != -1, HYD_INTERNAL_ERROR, "duplicate setting: %s\n", arg);
*var = val;
@@ -289,8 +287,7 @@ HYD_status HYDU_process_mfile_token(char *token, int newline, struct HYD_node **
for (node = *node_list; node->next; node = node->next);
if (node->user)
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
- "duplicate username setting\n");
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "duplicate username setting\n");
node->user = HYDU_strdup(user);
}
@@ -319,8 +316,7 @@ HYD_status HYDU_parse_hostfile(const char *hostfile, struct HYD_node **node_list
HYDU_FUNC_ENTER();
if ((fp = fopen(hostfile, "r")) == NULL)
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
- "unable to open host file: %s\n", hostfile);
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "unable to open host file: %s\n", hostfile);
if (node_list)
*node_list = NULL;
@@ -402,8 +398,7 @@ HYD_status HYDU_send_strlist(int fd, char **strlist)
/* Check how many arguments we have */
list_len = HYDU_strlist_lastidx(strlist);
- status =
- HYDU_sock_write(fd, &list_len, sizeof(int), &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_write(fd, &list_len, sizeof(int), &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "unable to write data to proxy\n");
HYDU_ASSERT(!closed, status);
@@ -411,8 +406,7 @@ HYD_status HYDU_send_strlist(int fd, char **strlist)
for (i = 0; strlist[i]; i++) {
len = strlen(strlist[i]) + 1;
- status =
- HYDU_sock_write(fd, &len, sizeof(int), &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
+ status = HYDU_sock_write(fd, &len, sizeof(int), &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "unable to write data to proxy\n");
HYDU_ASSERT(!closed, status);
diff --git a/src/pm/hydra/utils/dbg/dbg.c b/src/pm/hydra/utils/dbg/dbg.c
index 6572597..49b66d1 100644
--- a/src/pm/hydra/utils/dbg/dbg.c
+++ b/src/pm/hydra/utils/dbg/dbg.c
@@ -19,8 +19,7 @@ HYD_status HYDU_dbg_init(const char *str)
HYDU_ERR_POP(status, "unable to get local host name\n");
HYDU_MALLOC(HYD_dbg_prefix, char *, strlen(hostname) + 1 + strlen(str) + 1, status);
- HYDU_snprintf(HYD_dbg_prefix, strlen(hostname) + 1 + strlen(str) + 1, "%s@%s", str,
- hostname);
+ HYDU_snprintf(HYD_dbg_prefix, strlen(hostname) + 1 + strlen(str) + 1, "%s@%s", str, hostname);
fn_exit:
HYDU_FUNC_EXIT();
diff --git a/src/pm/hydra/utils/env/env.c b/src/pm/hydra/utils/env/env.c
index ec9af6a..be2bec6 100644
--- a/src/pm/hydra/utils/env/env.c
+++ b/src/pm/hydra/utils/env/env.c
@@ -273,8 +273,7 @@ HYD_status HYDU_putenv(struct HYD_env *env, HYD_env_overwrite_t overwrite)
HYDU_FUNC_ENTER();
/* If the overwrite flag is false, just exit */
- if (MPL_env2str(env->env_name, (const char **) &str) &&
- overwrite == HYD_ENV_OVERWRITE_FALSE)
+ if (MPL_env2str(env->env_name, (const char **) &str) && overwrite == HYD_ENV_OVERWRITE_FALSE)
goto fn_exit;
i = 0;
diff --git a/src/pm/hydra/utils/others/others.c b/src/pm/hydra/utils/others/others.c
index 67d72c4..4d0287d 100644
--- a/src/pm/hydra/utils/others/others.c
+++ b/src/pm/hydra/utils/others/others.c
@@ -18,8 +18,7 @@ int HYDU_dceil(int x, int y)
return z + 1;
}
-HYD_status HYDU_add_to_node_list(const char *hostname, int num_procs,
- struct HYD_node ** node_list)
+HYD_status HYDU_add_to_node_list(const char *hostname, int num_procs, struct HYD_node ** node_list)
{
struct HYD_node *node;
HYD_status status = HYD_SUCCESS;
diff --git a/src/pm/hydra/utils/sock/sock.c b/src/pm/hydra/utils/sock/sock.c
index af04cba..6c33727 100644
--- a/src/pm/hydra/utils/sock/sock.c
+++ b/src/pm/hydra/utils/sock/sock.c
@@ -93,8 +93,7 @@ HYD_status HYDU_sock_listen(int *listen_fd, char *port_range, uint16_t * port)
HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "no port to bind\n");
if (listen(*listen_fd, SOMAXCONN) < 0)
- HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "listen error (%s)\n",
- HYDU_strerror(errno));
+ HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "listen error (%s)\n", HYDU_strerror(errno));
/* We asked for any port, so we need to find out which port we
* actually got. */
@@ -136,8 +135,7 @@ HYD_status HYDU_sock_connect(const char *host, uint16_t port, int *fd, int retri
ht = gethostbyname(host);
if (ht == NULL)
HYDU_ERR_SETANDJUMP(status, HYD_INVALID_PARAM,
- "unable to get host address for %s (%s)\n", host,
- HYDU_herror(h_errno));
+ "unable to get host address for %s (%s)\n", host, HYDU_herror(h_errno));
memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length);
/* Create a socket and set the required options */
@@ -196,8 +194,7 @@ HYD_status HYDU_sock_accept(int listen_fd, int *fd)
*fd = accept(listen_fd, 0, 0);
if (*fd < 0)
- HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "accept error (%s)\n",
- HYDU_strerror(errno));
+ HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "accept error (%s)\n", HYDU_strerror(errno));
/* Disable nagle */
if (setsockopt(*fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(int)) < 0)
@@ -239,8 +236,7 @@ HYD_status HYDU_sock_read(int fd, void *buf, int maxlen, int *recvd, int *closed
} while (tmp < 0 && errno == EINTR);
if (tmp < 0) {
- HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "read error (%s)\n",
- HYDU_strerror(errno));
+ HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "read error (%s)\n", HYDU_strerror(errno));
}
else if (tmp == 0) {
*closed = 1;
@@ -287,8 +283,7 @@ HYD_status HYDU_sock_write(int fd, const void *buf, int maxlen, int *sent, int *
*closed = 1;
goto fn_exit;
}
- HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "write error (%s)\n",
- HYDU_strerror(errno));
+ HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "write error (%s)\n", HYDU_strerror(errno));
}
else {
*sent += tmp;
@@ -463,14 +458,12 @@ HYD_status HYDU_sock_get_iface_ip(char *iface, char **ip)
break;
if (!ifa)
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "unable to find interface %s\n",
- iface);
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "unable to find interface %s\n", iface);
sa = (struct sockaddr_in *) ifa->ifa_addr;
#if defined HAVE_INET_NTOP
(*ip) = HYDU_strdup((char *)
- inet_ntop(AF_INET, (const void *) &(sa->sin_addr), buf,
- MAX_HOSTNAME_LEN));
+ inet_ntop(AF_INET, (const void *) &(sa->sin_addr), buf, MAX_HOSTNAME_LEN));
#else
(*ip) = NULL;
#endif /* HAVE_INET_NTOP */
diff --git a/src/pm/hydra/utils/string/string.c b/src/pm/hydra/utils/string/string.c
index 1614374..3f8bf7f 100644
--- a/src/pm/hydra/utils/string/string.c
+++ b/src/pm/hydra/utils/string/string.c
@@ -233,8 +233,7 @@ char **HYDU_str_to_strlist(char *str)
HYDU_MALLOC(strlist, char **, HYD_NUM_TMP_STRINGS * sizeof(char *), status);
if (!strlist)
- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
- "Unable to allocate mem for strlist\n");
+ HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "Unable to allocate mem for strlist\n");
for (i = 0; i < HYD_NUM_TMP_STRINGS; i++)
strlist[i] = NULL;
http://git.mpich.org/mpich.git/commitdiff/6a39ab8721cbd4daca1803c186f8d41e97935f17
commit 6a39ab8721cbd4daca1803c186f8d41e97935f17
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Thu May 2 22:11:50 2013 -0500
Added new string stash/spit macros.
We have been allocating a "large enough" pool of temporary strings and
hoping that we don't overflow it for our temporary allocations. This
commit provides macros that better check for overflow problems without
making the code too clumsy.
No reviewer.
diff --git a/src/pm/hydra/include/hydra.h b/src/pm/hydra/include/hydra.h
index 491a2e9..31dd1e1 100644
--- a/src/pm/hydra/include/hydra.h
+++ b/src/pm/hydra/include/hydra.h
@@ -173,6 +173,52 @@ int killpg(int pgrp, int sig);
#define HYDRA_NAMESERVER_DEFAULT_PORT 6392
+struct HYD_string_stash {
+ char **strlist;
+ int max_count;
+ int cur_count;
+};
+
+#define HYD_STRING_STASH_INIT(stash) \
+ do { \
+ (stash).strlist = NULL; \
+ (stash).max_count = 0; \
+ (stash).cur_count = 0; \
+ } while (0)
+
+#define HYD_STRING_STASH(stash, str, status) \
+ do { \
+ if ((stash).cur_count >= (stash).max_count - 1) { \
+ HYDU_REALLOC((stash).strlist, char **, (stash).max_count + HYD_NUM_TMP_STRINGS, \
+ (status)); \
+ (stash).max_count += HYD_NUM_TMP_STRINGS; \
+ } \
+ (stash).strlist[(stash).cur_count++] = (str); \
+ (stash).strlist[(stash).cur_count] = NULL; \
+ } while (0)
+
+#define HYD_STRING_SPIT(stash, str, status) \
+ do { \
+ if ((stash).cur_count == 0) { \
+ (str) = HYDU_strdup(""); \
+ } \
+ else { \
+ (status) = HYDU_str_alloc_and_join((stash).strlist, &(str)); \
+ HYDU_ERR_POP((status), "unable to join strings\n"); \
+ HYDU_free_strlist((stash).strlist); \
+ HYDU_FREE((stash).strlist); \
+ HYD_STRING_STASH_INIT((stash)); \
+ } \
+ } while (0)
+
+#define HYD_STRING_STASH_FREE(stash) \
+ do { \
+ HYDU_free_strlist((stash).strlist); \
+ HYDU_FREE((stash).strlist); \
+ (stash).max_count = 0; \
+ (stash).cur_count = 0; \
+ } while (0)
+
enum HYD_bool {
HYD_FALSE = 0,
HYD_TRUE = 1
@@ -618,19 +664,6 @@ HYD_status HYDU_sock_cloexec(int fd);
HYDU_free((void *) p); \
}
-#define HYDU_STRLIST_CONSOLIDATE(strlist, i, status) \
- { \
- char *out; \
- if ((i) >= (HYD_NUM_TMP_STRINGS / 2)) { \
- (strlist)[(i)] = NULL; \
- (status) = HYDU_str_alloc_and_join((strlist), &out); \
- HYDU_ERR_POP((status), "unable to join strings\n"); \
- HYDU_free_strlist((strlist)); \
- strlist[0] = out; \
- (i) = 1; \
- } \
- }
-
HYD_status HYDU_list_append_strlist(char **exec, char **client_arg);
HYD_status HYDU_print_strlist(char **args);
void HYDU_free_strlist(char **args);
diff --git a/src/pm/hydra/pm/pmiserv/pmip_cb.c b/src/pm/hydra/pm/pmiserv/pmip_cb.c
index 8b6710d..e268293 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_cb.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_cb.c
@@ -468,7 +468,7 @@ static HYD_status launch_procs(void)
int i, j, arg, process_id;
int using_pmi_port = 0;
char *str, *envstr, *list, *pmi_port;
- char *client_args[HYD_NUM_TMP_STRINGS];
+ struct HYD_string_stash stash;
struct HYD_env *env, *force_env = NULL;
struct HYD_exec *exec;
struct HYD_pmcd_hdr hdr;
@@ -691,11 +691,11 @@ static HYD_status launch_procs(void)
HYDU_FREE(str);
}
+ HYD_STRING_STASH_INIT(stash);
for (j = 0, arg = 0; exec->exec[j]; j++)
- client_args[arg++] = HYDU_strdup(exec->exec[j]);
- client_args[arg++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup(exec->exec[j]), status);
- status = HYDU_create_process(client_args, force_env,
+ status = HYDU_create_process(stash.strlist, force_env,
HYD_pmcd_pmip.downstream.pmi_rank[process_id] ? NULL :
&HYD_pmcd_pmip.downstream.in,
&HYD_pmcd_pmip.downstream.out[process_id],
@@ -709,7 +709,7 @@ static HYD_status launch_procs(void)
HYDU_ERR_POP(status, "unable to set stdin socket to non-blocking\n");
}
- HYDU_free_strlist(client_args);
+ HYD_STRING_STASH_FREE(stash);
if (pmi_fds[1] != HYD_FD_UNSET) {
close(pmi_fds[1]);
diff --git a/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c b/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
index 6c190b8..7269176 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
@@ -183,10 +183,10 @@ static HYD_status fn_init(int fd, char *args[])
static HYD_status fn_initack(int fd, char *args[])
{
int id, i;
- char *val;
+ char *val, *cmd;
struct HYD_pmcd_token *tokens;
int token_count;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ struct HYD_string_stash stash;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -209,22 +209,19 @@ static HYD_status fn_initack(int fd, char *args[])
}
HYDU_ASSERT(i < HYD_pmcd_pmip.local.proxy_process_count, status);
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=initack\ncmd=set size=");
- tmp[i++] = HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_process_count);
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=initack\ncmd=set size="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_process_count),
+ status);
- /* FIXME: allow for multiple ranks per PMI ID */
- tmp[i++] = HYDU_strdup("\ncmd=set rank=");
- tmp[i++] = HYDU_int_to_str(id);
+ HYD_STRING_STASH(stash, HYDU_strdup("\ncmd=set rank="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(id), status);
- tmp[i++] = HYDU_strdup("\ncmd=set debug=");
- tmp[i++] = HYDU_int_to_str(HYD_pmcd_pmip.user_global.debug);
- tmp[i++] = HYDU_strdup("\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("\ncmd=set debug="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(HYD_pmcd_pmip.user_global.debug), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "error while joining strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -241,25 +238,22 @@ static HYD_status fn_initack(int fd, char *args[])
static HYD_status fn_get_maxes(int fd, char *args[])
{
- int i;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ struct HYD_string_stash stash;
+ char *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=maxes kvsname_max=");
- tmp[i++] = HYDU_int_to_str(PMI_MAXKVSLEN);
- tmp[i++] = HYDU_strdup(" keylen_max=");
- tmp[i++] = HYDU_int_to_str(PMI_MAXKEYLEN);
- tmp[i++] = HYDU_strdup(" vallen_max=");
- tmp[i++] = HYDU_int_to_str(PMI_MAXVALLEN);
- 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);
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=maxes kvsname_max="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(PMI_MAXKVSLEN), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(" keylen_max="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(PMI_MAXKEYLEN), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(" vallen_max="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(PMI_MAXVALLEN), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
+
+ HYD_STRING_SPIT(stash, cmd, status);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -277,7 +271,8 @@ static HYD_status fn_get_appnum(int fd, char *args[])
{
int i, idx;
struct HYD_exec *exec;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ struct HYD_string_stash stash;
+ char *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -296,15 +291,12 @@ static HYD_status fn_get_appnum(int fd, char *args[])
break;
}
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=appnum appnum=");
- tmp[i++] = HYDU_int_to_str(exec->appnum);
- tmp[i++] = HYDU_strdup("\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=appnum appnum="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(exec->appnum), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -320,21 +312,18 @@ static HYD_status fn_get_appnum(int fd, char *args[])
static HYD_status fn_get_my_kvsname(int fd, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
- int i;
+ struct HYD_string_stash stash;
+ char *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=my_kvsname kvsname=");
- tmp[i++] = HYDU_strdup(HYD_pmcd_pmip.local.kvs->kvsname);
- tmp[i++] = HYDU_strdup("\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=my_kvsname kvsname="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(HYD_pmcd_pmip.local.kvs->kvsname), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -350,26 +339,25 @@ static HYD_status fn_get_my_kvsname(int fd, char *args[])
static HYD_status fn_get_usize(int fd, char *args[])
{
- int i;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ struct HYD_string_stash stash;
+ char *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=universe_size size=");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=universe_size size="), status);
if (HYD_pmcd_pmip.user_global.usize == HYD_USIZE_SYSTEM)
- tmp[i++] = HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_core_map.global_count);
+ HYD_STRING_STASH(stash,
+ HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_core_map.global_count),
+ status);
else if (HYD_pmcd_pmip.user_global.usize == HYD_USIZE_INFINITE)
- tmp[i++] = HYDU_int_to_str(-1);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(-1), status);
else
- tmp[i++] = HYDU_int_to_str(HYD_pmcd_pmip.user_global.usize);
- tmp[i++] = HYDU_strdup("\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_int_to_str(HYD_pmcd_pmip.user_global.usize), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -385,7 +373,8 @@ static HYD_status fn_get_usize(int fd, char *args[])
static HYD_status fn_get(int fd, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *key, *val;
+ struct HYD_string_stash stash;
+ char *cmd, *key, *val;
struct HYD_pmcd_token *tokens;
int token_count, i;
HYD_status status = HYD_SUCCESS;
@@ -400,15 +389,13 @@ static HYD_status fn_get(int fd, char *args[])
"unable to find token: key\n");
if (!strcmp(key, "PMI_process_mapping")) {
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=get_result rc=0 msg=success value=");
- tmp[i++] = HYDU_strdup(HYD_pmcd_pmip.system_global.pmi_process_mapping);
- tmp[i++] = HYDU_strdup("\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=get_result rc=0 msg=success value="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(HYD_pmcd_pmip.system_global.pmi_process_mapping),
+ status);
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -423,23 +410,20 @@ static HYD_status fn_get(int fd, char *args[])
}
}
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=get_result rc=");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=get_result rc="), status);
if (val) {
- tmp[i++] = HYDU_strdup("0 msg=success value=");
- tmp[i++] = HYDU_strdup(val);
+ HYD_STRING_STASH(stash, HYDU_strdup("0 msg=success value="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(val), status);
}
else {
- tmp[i++] = HYDU_strdup("-1 msg=key_");
- tmp[i++] = HYDU_strdup(key);
- tmp[i++] = HYDU_strdup("_not_found value=unknown");
+ HYD_STRING_STASH(stash, HYDU_strdup("-1 msg=key_"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(key), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("_not_found value=unknown"), status);
}
- tmp[i++] = HYDU_strdup("\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending command downstream\n");
@@ -457,10 +441,11 @@ static HYD_status fn_get(int fd, char *args[])
static HYD_status fn_put(int fd, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ struct HYD_string_stash stash;
+ char *cmd;
char *key, *val;
struct HYD_pmcd_token *tokens;
- int token_count, i;
+ int token_count;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -477,15 +462,12 @@ static HYD_status fn_put(int fd, char *args[])
val = HYDU_strdup("");
/* add to the cache */
- i = 0;
- tmp[i++] = HYDU_strdup(key);
- tmp[i++] = HYDU_strdup("=");
- tmp[i++] = HYDU_strdup(val);
- tmp[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup(key), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(val), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
cache_put.keyval[cache_put.keyval_len++] = cmd;
debug("cached command: %s\n", cmd);
diff --git a/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c b/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
index 4246057..8d2c66d 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
@@ -17,25 +17,23 @@ static struct HYD_pmcd_pmi_v2_reqs *pending_reqs = NULL;
static HYD_status send_cmd_upstream(const char *start, int fd, char *args[])
{
- int i, j, sent, closed;
- char *tmp[HYD_NUM_TMP_STRINGS], *buf;
+ int i, sent, closed;
+ struct HYD_string_stash stash;
+ char *buf;
struct HYD_pmcd_hdr hdr;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- j = 0;
- tmp[j++] = HYDU_strdup(start);
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup(start), status);
for (i = 0; args[i]; i++) {
- tmp[j++] = HYDU_strdup(args[i]);
+ HYD_STRING_STASH(stash, HYDU_strdup(args[i]), status);
if (args[i + 1])
- tmp[j++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[j] = NULL;
- status = HYDU_str_alloc_and_join(tmp, &buf);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, buf, status);
HYD_pmcd_init_header(&hdr);
hdr.cmd = PMI_CMD;
@@ -152,7 +150,8 @@ static HYD_status fn_fullinit(int fd, char *args[])
{
int id, i;
char *rank_str;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ struct HYD_string_stash stash;
+ char *cmd;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -177,30 +176,29 @@ static HYD_status fn_fullinit(int fd, char *args[])
}
HYDU_ASSERT(i < HYD_pmcd_pmip.local.proxy_process_count, status);
- i = 0;
- /* FIXME: allow for multiple ranks per PMI ID */
- tmp[i++] = HYDU_strdup("cmd=fullinit-response;pmi-version=2;pmi-subversion=0;rank=");
- tmp[i++] = HYDU_int_to_str(id);
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash,
+ HYDU_strdup("cmd=fullinit-response;pmi-version=2;pmi-subversion=0;rank="),
+ status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(id), status);
- tmp[i++] = HYDU_strdup(";size=");
- tmp[i++] = HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_process_count);
- tmp[i++] = HYDU_strdup(";appnum=0");
+ HYD_STRING_STASH(stash, HYDU_strdup(";size="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_process_count),
+ status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";appnum=0"), status);
if (HYD_pmcd_pmip.local.spawner_kvsname) {
- tmp[i++] = HYDU_strdup(";spawner-jobid=");
- tmp[i++] = HYDU_strdup(HYD_pmcd_pmip.local.spawner_kvsname);
+ HYD_STRING_STASH(stash, HYDU_strdup(";spawner-jobid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(HYD_pmcd_pmip.local.spawner_kvsname), status);
}
if (HYD_pmcd_pmip.user_global.debug) {
- tmp[i++] = HYDU_strdup(";debugged=TRUE;pmiverbose=TRUE");
+ HYD_STRING_STASH(stash, HYDU_strdup(";debugged=TRUE;pmiverbose=TRUE"), status);
}
else {
- tmp[i++] = HYDU_strdup(";debugged=FALSE;pmiverbose=FALSE");
+ HYD_STRING_STASH(stash, HYDU_strdup(";debugged=FALSE;pmiverbose=FALSE"), status);
}
- tmp[i++] = HYDU_strdup(";rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup(";rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "error while joining strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -216,8 +214,8 @@ static HYD_status fn_fullinit(int fd, char *args[])
static HYD_status fn_job_getid(int fd, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid;
- int i;
+ struct HYD_string_stash stash;
+ char *cmd, *thrid;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -229,22 +227,18 @@ static HYD_status fn_job_getid(int fd, char *args[])
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=job-getid-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=job-getid-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("jobid=");
- tmp[i++] = HYDU_strdup(HYD_pmcd_pmip.local.kvs->kvsname);
- tmp[i++] = HYDU_strdup(";rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("jobid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(HYD_pmcd_pmip.local.kvs->kvsname), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
-
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -259,11 +253,10 @@ static HYD_status fn_job_getid(int fd, char *args[])
static HYD_status fn_info_putnodeattr(int fd, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
- char *key, *val, *thrid;
- int i, ret;
+ struct HYD_string_stash stash;
+ char *key, *val, *thrid, *cmd;
struct HYD_pmcd_token *tokens;
- int token_count;
+ int token_count, ret;
struct HYD_pmcd_pmi_v2_reqs *req;
HYD_status status = HYD_SUCCESS;
@@ -284,21 +277,18 @@ static HYD_status fn_info_putnodeattr(int fd, char *args[])
status = HYD_pmcd_pmi_add_kvs(key, val, HYD_pmcd_pmip.local.kvs, &ret);
HYDU_ERR_POP(status, "unable to put data into kvs\n");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=info-putnodeattr-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-putnodeattr-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("rc=");
- tmp[i++] = HYDU_int_to_str(ret);
- tmp[i++] = HYDU_strdup(";");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("rc="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(ret), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -322,10 +312,11 @@ static HYD_status fn_info_putnodeattr(int fd, char *args[])
static HYD_status fn_info_getnodeattr(int fd, char *args[])
{
- int i, found;
+ int found;
struct HYD_pmcd_pmi_kvs_pair *run;
char *key, *waitval, *thrid;
- char *tmp[HYD_NUM_TMP_STRINGS] = { 0 }, *cmd;
+ struct HYD_string_stash stash;
+ char *cmd;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -353,21 +344,18 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
}
if (found) { /* We found the attribute */
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=info-getnodeattr-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getnodeattr-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("found=TRUE;value=");
- tmp[i++] = HYDU_strdup(run->val);
- tmp[i++] = HYDU_strdup(";rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("found=TRUE;value="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(run->val), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -381,19 +369,16 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
}
else {
/* Tell the client that we can't find the attribute */
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=info-getnodeattr-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getnodeattr-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("found=FALSE;rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("found=FALSE;rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -409,9 +394,10 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
static HYD_status fn_info_getjobattr(int fd, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *key, *thrid;
+ struct HYD_string_stash stash;
+ char *cmd, *key, *thrid;
struct HYD_pmcd_token *tokens;
- int token_count, i;
+ int token_count;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -426,21 +412,19 @@ static HYD_status fn_info_getjobattr(int fd, char *args[])
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
if (!strcmp(key, "PMI_process_mapping")) {
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=info-getjobattr-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getjobattr-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("found=TRUE;value=");
- tmp[i++] = HYDU_strdup(HYD_pmcd_pmip.system_global.pmi_process_mapping);
- tmp[i++] = HYDU_strdup(";rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("found=TRUE;value="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(HYD_pmcd_pmip.system_global.pmi_process_mapping),
+ status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -462,9 +446,10 @@ static HYD_status fn_info_getjobattr(int fd, char *args[])
static HYD_status fn_finalize(int fd, char *args[])
{
char *thrid;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ struct HYD_string_stash stash;
+ char *cmd;
struct HYD_pmcd_token *tokens;
- int token_count, i;
+ int token_count;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -474,19 +459,16 @@ static HYD_status fn_finalize(int fd, char *args[])
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=finalize-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=finalize-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmci.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmci.c
index 380a752..c705c33 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmci.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmci.c
@@ -94,7 +94,8 @@ static HYD_status ui_cmd_cb(int fd, HYD_event_t events, void *userp)
HYD_status HYD_pmci_launch_procs(void)
{
struct HYD_proxy *proxy;
- char *proxy_args[HYD_NUM_TMP_STRINGS] = { NULL }, *control_port = NULL;
+ struct HYD_string_stash proxy_stash;
+ char *control_port = NULL;
int node_count, i, *control_fd;
HYD_status status = HYD_SUCCESS;
@@ -115,7 +116,7 @@ HYD_status HYD_pmci_launch_procs(void)
if (HYD_server_info.user_global.debug)
HYDU_dump(stdout, "Got a control port string of %s\n", control_port);
- status = HYD_pmcd_pmi_fill_in_proxy_args(proxy_args, control_port, 0);
+ status = HYD_pmcd_pmi_fill_in_proxy_args(&proxy_stash, control_port, 0);
HYDU_ERR_POP(status, "unable to fill in proxy arguments\n");
status = HYD_pmcd_pmi_fill_in_exec_launch_info(&HYD_server_info.pg_list);
@@ -129,8 +130,8 @@ HYD_status HYD_pmci_launch_procs(void)
for (i = 0; i < node_count; i++)
control_fd[i] = HYD_FD_UNSET;
- status =
- HYDT_bsci_launch_procs(proxy_args, HYD_server_info.pg_list.proxy_list, control_fd);
+ status = HYDT_bsci_launch_procs(proxy_stash.strlist, HYD_server_info.pg_list.proxy_list,
+ control_fd);
HYDU_ERR_POP(status, "launcher cannot launch processes\n");
for (i = 0, proxy = HYD_server_info.pg_list.proxy_list; proxy; proxy = proxy->next, i++)
@@ -147,7 +148,7 @@ HYD_status HYD_pmci_launch_procs(void)
fn_exit:
if (control_port)
HYDU_FREE(control_port);
- HYDU_free_strlist(proxy_args);
+ HYD_STRING_STASH_FREE(proxy_stash);
HYDU_FUNC_EXIT();
return status;
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c
index faf019e..ff96bd0 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi.c
@@ -63,7 +63,8 @@ HYD_status HYD_pmcd_pmi_free_publish(struct HYD_pmcd_pmi_publish * publish)
HYD_status HYD_pmcd_pmi_publish(char *name, char *port, int *success)
{
struct HYD_pmcd_pmi_publish *r, *publish;
- char *ns, *ns_host, *ns_port_str, *tmp[HYD_NUM_TMP_STRINGS];
+ struct HYD_string_stash stash;
+ char *ns, *ns_host, *ns_port_str;
int ns_port, ns_fd, i;
HYD_status status = HYD_SUCCESS;
@@ -115,15 +116,14 @@ HYD_status HYD_pmcd_pmi_publish(char *name, char *port, int *success)
status = HYDU_sock_connect(ns_host, (uint16_t) ns_port, &ns_fd, 0, HYD_CONNECT_DELAY);
HYDU_ERR_POP(status, "error connecting to the nameserver\n");
- i = 0;
- tmp[i++] = HYDU_strdup("PUBLISH");
- tmp[i++] = HYDU_strdup(name);
- tmp[i++] = HYDU_strdup(port);
- tmp[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("PUBLISH"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(name), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(port), status);
- status = HYDU_send_strlist(ns_fd, tmp);
+ status = HYDU_send_strlist(ns_fd, stash.strlist);
HYDU_ERR_POP(status, "error sending string list\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_STASH_FREE(stash);
status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed,
HYDU_SOCK_COMM_MSGWAIT);
@@ -156,7 +156,8 @@ HYD_status HYD_pmcd_pmi_publish(char *name, char *port, int *success)
HYD_status HYD_pmcd_pmi_unpublish(char *name, int *success)
{
struct HYD_pmcd_pmi_publish *r, *publish;
- char *ns, *ns_host, *ns_port_str, *tmp[HYD_NUM_TMP_STRINGS];
+ struct HYD_string_stash stash;
+ char *ns, *ns_host, *ns_port_str;
int ns_port, ns_fd, i;
HYD_status status = HYD_SUCCESS;
@@ -213,13 +214,13 @@ HYD_status HYD_pmcd_pmi_unpublish(char *name, int *success)
status = HYDU_sock_connect(ns_host, (uint16_t) ns_port, &ns_fd, 0, HYD_CONNECT_DELAY);
HYDU_ERR_POP(status, "error connecting to the nameserver\n");
- i = 0;
- tmp[i++] = HYDU_strdup("UNPUBLISH");
- tmp[i++] = HYDU_strdup(name);
- tmp[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("UNPUBLISH"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(name), status);
- status = HYDU_send_strlist(ns_fd, tmp);
+ status = HYDU_send_strlist(ns_fd, stash.strlist);
HYDU_ERR_POP(status, "error sending string list\n");
+ HYD_STRING_STASH_FREE(stash);
status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed,
HYDU_SOCK_COMM_MSGWAIT);
@@ -249,7 +250,8 @@ HYD_status HYD_pmcd_pmi_unpublish(char *name, int *success)
HYD_status HYD_pmcd_pmi_lookup(char *name, char **value)
{
struct HYD_pmcd_pmi_publish *publish;
- char *ns, *ns_host, *ns_port_str, *tmp[HYD_NUM_TMP_STRINGS];
+ struct HYD_string_stash stash;
+ char *ns, *ns_host, *ns_port_str;
int ns_port, ns_fd, i;
HYD_status status = HYD_SUCCESS;
@@ -286,13 +288,13 @@ HYD_status HYD_pmcd_pmi_lookup(char *name, char **value)
status = HYDU_sock_connect(ns_host, (uint16_t) ns_port, &ns_fd, 0, HYD_CONNECT_DELAY);
HYDU_ERR_POP(status, "error connecting to the nameserver\n");
- i = 0;
- tmp[i++] = HYDU_strdup("LOOKUP");
- tmp[i++] = HYDU_strdup(name);
- tmp[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("LOOKUP"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(name), status);
- status = HYDU_send_strlist(ns_fd, tmp);
+ status = HYDU_send_strlist(ns_fd, stash.strlist);
HYDU_ERR_POP(status, "error sending string list\n");
+ HYD_STRING_STASH_FREE(stash);
status = HYDU_sock_read(ns_fd, &len, sizeof(int), &recvd, &closed,
HYDU_SOCK_COMM_MSGWAIT);
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
index cbc4c08..26915f2 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
@@ -242,8 +242,9 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
int token_count, i, j, k, new_pgid, total_spawns;
int argcnt, num_segments;
- char *control_port, *proxy_args[HYD_NUM_TMP_STRINGS] = { NULL };
- char *tmp[HYD_NUM_TMP_STRINGS];
+ struct HYD_string_stash proxy_stash;
+ char *control_port;
+ struct HYD_string_stash stash;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -398,15 +399,12 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
if (path == NULL)
execname = HYDU_strdup(val);
else {
- i = 0;
- tmp[i++] = HYDU_strdup(path);
- tmp[i++] = HYDU_strdup("/");
- tmp[i++] = HYDU_strdup(val);
- tmp[i++] = NULL;
-
- status = HYDU_str_alloc_and_join(tmp, &execname);
- HYDU_ERR_POP(status, "error while joining strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup(path), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("/"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(val), status);
+
+ HYD_STRING_SPIT(stash, execname, status);
}
i = 0;
@@ -502,27 +500,25 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
/* Go to the last PG */
for (pg = &HYD_server_info.pg_list; pg->next; pg = pg->next);
- status = HYD_pmcd_pmi_fill_in_proxy_args(proxy_args, control_port, new_pgid);
+ HYD_STRING_STASH_INIT(proxy_stash);
+ status = HYD_pmcd_pmi_fill_in_proxy_args(&proxy_stash, control_port, new_pgid);
HYDU_ERR_POP(status, "unable to fill in proxy arguments\n");
HYDU_FREE(control_port);
status = HYD_pmcd_pmi_fill_in_exec_launch_info(pg);
HYDU_ERR_POP(status, "unable to fill in executable arguments\n");
- status = HYDT_bsci_launch_procs(proxy_args, pg->proxy_list, NULL);
+ status = HYDT_bsci_launch_procs(proxy_stash.strlist, pg->proxy_list, NULL);
HYDU_ERR_POP(status, "launcher cannot launch processes\n");
{
- char *cmd_str[HYD_NUM_TMP_STRINGS], *cmd;
+ char *cmd;
- i = 0;
- cmd_str[i++] = HYDU_strdup("cmd=spawn_result rc=0");
- cmd_str[i++] = HYDU_strdup("\n");
- cmd_str[i++] = NULL;
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=spawn_result rc=0"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
- status = HYDU_str_alloc_and_join(cmd_str, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(cmd_str);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "error writing PMI line\n");
@@ -535,7 +531,7 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
fn_exit:
HYD_pmcd_pmi_free_tokens(tokens, token_count);
- HYDU_free_strlist(proxy_args);
+ HYD_STRING_STASH_FREE(proxy_stash);
if (segment_list)
HYDU_FREE(segment_list);
HYDU_FUNC_EXIT();
@@ -547,8 +543,9 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
static HYD_status fn_publish_name(int fd, int pid, int pgid, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *val;
- int i, token_count;
+ struct HYD_string_stash stash;
+ char *cmd, *val;
+ int token_count;
struct HYD_pmcd_token *tokens;
char *name, *port;
int success = 0;
@@ -570,16 +567,16 @@ static HYD_status fn_publish_name(int fd, int pid, int pgid, char *args[])
status = HYD_pmcd_pmi_publish(name, port, &success);
HYDU_ERR_POP(status, "error publishing service\n");
- i = 0;
+ HYD_STRING_STASH_INIT(stash);
if (success)
- tmp[i++] = HYDU_strdup("cmd=publish_result info=ok rc=0 msg=success\n");
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=publish_result info=ok rc=0 msg=success\n"),
+ status);
else
- tmp[i++] = HYDU_strdup("cmd=publish_result info=ok rc=1 msg=key_already_present\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash,
+ HYDU_strdup("cmd=publish_result info=ok rc=1 msg=key_already_present\n"),
+ status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -595,8 +592,9 @@ static HYD_status fn_publish_name(int fd, int pid, int pgid, char *args[])
static HYD_status fn_unpublish_name(int fd, int pid, int pgid, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *name;
- int i, token_count;
+ struct HYD_string_stash stash;
+ char *cmd, *name;
+ int token_count;
struct HYD_pmcd_token *tokens;
int success = 0;
HYD_status status = HYD_SUCCESS;
@@ -612,16 +610,16 @@ static HYD_status fn_unpublish_name(int fd, int pid, int pgid, char *args[])
status = HYD_pmcd_pmi_unpublish(name, &success);
HYDU_ERR_POP(status, "error unpublishing service\n");
- i = 0;
+ HYD_STRING_STASH_INIT(stash);
if (success)
- tmp[i++] = HYDU_strdup("cmd=unpublish_result info=ok rc=0 msg=success\n");
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=unpublish_result info=ok rc=0 msg=success\n"),
+ status);
else
- tmp[i++] = HYDU_strdup("cmd=unpublish_result info=ok rc=1 msg=service_not_found\n");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash,
+ HYDU_strdup("cmd=unpublish_result info=ok rc=1 msg=service_not_found\n"),
+ status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -637,8 +635,9 @@ static HYD_status fn_unpublish_name(int fd, int pid, int pgid, char *args[])
static HYD_status fn_lookup_name(int fd, int pid, int pgid, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *name, *value;
- int i, token_count;
+ struct HYD_string_stash stash;
+ char *cmd, *name, *value;
+ int token_count;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -653,21 +652,18 @@ static HYD_status fn_lookup_name(int fd, int pid, int pgid, char *args[])
status = HYD_pmcd_pmi_lookup(name, &value);
HYDU_ERR_POP(status, "error while looking up service\n");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=lookup_result");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=lookup_result"), status);
if (value) {
- tmp[i++] = HYDU_strdup(" port=");
- tmp[i++] = HYDU_strdup(value);
- tmp[i++] = HYDU_strdup(" info=ok rc=0 msg=success\n");
+ HYD_STRING_STASH(stash, HYDU_strdup(" port="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(value), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(" info=ok rc=0 msg=success\n"), status);
}
else {
- tmp[i++] = HYDU_strdup(" rc=1 msg=service_not_found\n");
+ HYD_STRING_STASH(stash, HYDU_strdup(" rc=1 msg=service_not_found\n"), status);
}
- tmp[i++] = NULL;
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
index 87ff14f..3e2f51b 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
@@ -111,13 +111,12 @@ static HYD_status poke_progress(char *key)
static HYD_status fn_info_getjobattr(int fd, int pid, int pgid, char *args[])
{
- int i;
struct HYD_proxy *proxy;
struct HYD_pmcd_pmi_pg_scratch *pg_scratch;
struct HYD_pmcd_pmi_kvs_pair *run;
const char *key;
- char *thrid, *val;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ char *thrid, *val, *cmd;
+ struct HYD_string_stash stash;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -149,28 +148,24 @@ static HYD_status fn_info_getjobattr(int fd, int pid, int pgid, char *args[])
}
}
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=info-getjobattr-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getjobattr-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("found=");
+ HYD_STRING_STASH(stash, HYDU_strdup("found="), status);
if (val) {
- tmp[i++] = HYDU_strdup("TRUE;value=");
- tmp[i++] = HYDU_strdup(val);
- tmp[i++] = HYDU_strdup(";rc=0;");
+ HYD_STRING_STASH(stash, HYDU_strdup("TRUE;value="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(val), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";rc=0;"), status);
}
else {
- tmp[i++] = HYDU_strdup("FALSE;rc=0;");
+ HYD_STRING_STASH(stash, HYDU_strdup("FALSE;rc=0;"), status);
}
- tmp[i++] = NULL;
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
-
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -188,9 +183,9 @@ static HYD_status fn_info_getjobattr(int fd, int pid, int pgid, char *args[])
static HYD_status fn_kvs_put(int fd, int pid, int pgid, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
- char *key, *val, *thrid;
- int i, ret;
+ struct HYD_string_stash stash;
+ char *key, *val, *thrid, *cmd;
+ int ret;
struct HYD_proxy *proxy;
struct HYD_pmcd_pmi_pg_scratch *pg_scratch;
struct HYD_pmcd_token *tokens;
@@ -222,22 +217,18 @@ static HYD_status fn_kvs_put(int fd, int pid, int pgid, char *args[])
status = HYD_pmcd_pmi_add_kvs(key, val, pg_scratch->kvs, &ret);
HYDU_ERR_POP(status, "unable to put data into kvs\n");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=kvs-put-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=kvs-put-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("rc=");
- tmp[i++] = HYDU_int_to_str(ret);
- tmp[i++] = HYDU_strdup(";");
- tmp[i++] = NULL;
-
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
+ HYD_STRING_STASH(stash, HYDU_strdup("rc="), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(ret), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -268,8 +259,8 @@ static HYD_status fn_kvs_get(int fd, int pid, int pgid, char *args[])
struct HYD_pg *pg;
struct HYD_proxy *proxy;
struct HYD_pmcd_pmi_kvs_pair *run;
- char *key, *thrid;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ char *key, *thrid, *cmd;
+ struct HYD_string_stash stash;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -322,27 +313,24 @@ static HYD_status fn_kvs_get(int fd, int pid, int pgid, char *args[])
}
}
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=kvs-get-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=kvs-get-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
if (found) {
- tmp[i++] = HYDU_strdup("found=TRUE;value=");
- tmp[i++] = HYDU_strdup(run->val);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("found=TRUE;value="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(run->val), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
else {
- tmp[i++] = HYDU_strdup("found=FALSE;");
+ HYD_STRING_STASH(stash, HYDU_strdup("found=FALSE;"), status);
}
- tmp[i++] = HYDU_strdup("rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -361,7 +349,8 @@ static HYD_status fn_kvs_fence(int fd, int pid, int pgid, char *args[])
{
struct HYD_proxy *proxy;
struct HYD_pmcd_pmi_pg_scratch *pg_scratch;
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid;
+ struct HYD_string_stash stash;
+ char *cmd, *thrid;
struct HYD_pmcd_token *tokens;
int token_count, i;
static int fence_count = 0;
@@ -396,19 +385,16 @@ static HYD_status fn_kvs_fence(int fd, int pid, int pgid, char *args[])
pg_scratch->ecount[i].epoch = 1;
}
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=kvs-fence-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=kvs-fence-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- tmp[i++] = HYDU_strdup("rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -471,8 +457,9 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
int token_count, i, j, k, new_pgid;
int argcnt, num_segments;
- char *control_port, *proxy_args[HYD_NUM_TMP_STRINGS] = { NULL };
- char *tmp[HYD_NUM_TMP_STRINGS];
+ struct HYD_string_stash proxy_stash;
+ char *control_port;
+ struct HYD_string_stash stash;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -613,15 +600,12 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
if (path == NULL)
execname = HYDU_strdup(val);
else {
- i = 0;
- tmp[i++] = HYDU_strdup(path);
- tmp[i++] = HYDU_strdup("/");
- tmp[i++] = HYDU_strdup(val);
- tmp[i++] = NULL;
-
- status = HYDU_str_alloc_and_join(tmp, &execname);
- HYDU_ERR_POP(status, "error while joining strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup(path), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("/"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(val), status);
+
+ HYD_STRING_SPIT(stash, execname, status);
}
i = 0;
@@ -716,36 +700,33 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
/* Go to the last PG */
for (pg = &HYD_server_info.pg_list; pg->next; pg = pg->next);
- status = HYD_pmcd_pmi_fill_in_proxy_args(proxy_args, control_port, new_pgid);
+ status = HYD_pmcd_pmi_fill_in_proxy_args(&proxy_stash, control_port, new_pgid);
HYDU_ERR_POP(status, "unable to fill in proxy arguments\n");
HYDU_FREE(control_port);
status = HYD_pmcd_pmi_fill_in_exec_launch_info(pg);
HYDU_ERR_POP(status, "unable to fill in executable arguments\n");
- status = HYDT_bsci_launch_procs(proxy_args, pg->proxy_list, NULL);
+ status = HYDT_bsci_launch_procs(proxy_stash.strlist, pg->proxy_list, NULL);
HYDU_ERR_POP(status, "launcher cannot launch processes\n");
{
- char *cmd_str[HYD_NUM_TMP_STRINGS], *cmd;
+ char *cmd;
- i = 0;
- cmd_str[i++] = HYDU_strdup("cmd=spawn-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=spawn-response;"), status);
if (thrid) {
- cmd_str[i++] = HYDU_strdup("thrid=");
- cmd_str[i++] = HYDU_strdup(thrid);
- cmd_str[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
- cmd_str[i++] = HYDU_strdup("rc=0;");
- cmd_str[i++] = HYDU_strdup("jobid=");
- cmd_str[i++] = HYDU_strdup(pg_scratch->kvs->kvsname);
- cmd_str[i++] = HYDU_strdup(";");
- cmd_str[i++] = HYDU_strdup("nerrs=0;");
- cmd_str[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("jobid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(pg_scratch->kvs->kvsname), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("nerrs=0;"), status);
- status = HYDU_str_alloc_and_join(cmd_str, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(cmd_str);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -754,7 +735,7 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
fn_exit:
HYD_pmcd_pmi_free_tokens(tokens, token_count);
- HYDU_free_strlist(proxy_args);
+ HYD_STRING_STASH_FREE(proxy_stash);
if (segment_list)
HYDU_FREE(segment_list);
HYDU_FUNC_EXIT();
@@ -766,9 +747,9 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
static HYD_status fn_name_publish(int fd, int pid, int pgid, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid, *val;
- char *name, *port;
- int i, token_count, success;
+ struct HYD_string_stash stash;
+ char *cmd, *thrid, *val, *name, *port;
+ int token_count, success;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -790,25 +771,22 @@ static HYD_status fn_name_publish(int fd, int pid, int pgid, char *args[])
status = HYD_pmcd_pmi_publish(name, port, &success);
HYDU_ERR_POP(status, "error publishing service\n");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=name-publish-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=name-publish-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
if (!success) {
- tmp[i++] = HYDU_strdup("rc=1;errmsg=duplicate_service_");
- tmp[i++] = HYDU_strdup(name);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=1;errmsg=duplicate_service_"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(name), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
else
- tmp[i++] = HYDU_strdup("rc=0;");
- tmp[i++] = NULL;
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -824,8 +802,9 @@ static HYD_status fn_name_publish(int fd, int pid, int pgid, char *args[])
static HYD_status fn_name_unpublish(int fd, int pid, int pgid, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid, *name;
- int i, token_count, success;
+ struct HYD_string_stash stash;
+ char *cmd, *thrid, *name;
+ int token_count, success;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -842,25 +821,22 @@ static HYD_status fn_name_unpublish(int fd, int pid, int pgid, char *args[])
status = HYD_pmcd_pmi_unpublish(name, &success);
HYDU_ERR_POP(status, "error unpublishing service\n");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=name-unpublish-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=name-unpublish-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
if (success)
- tmp[i++] = HYDU_strdup("rc=0;");
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
else {
- tmp[i++] = HYDU_strdup("rc=1;errmsg=service_");
- tmp[i++] = HYDU_strdup(name);
- tmp[i++] = HYDU_strdup("_not_found;");
+ HYD_STRING_STASH(stash, HYDU_strdup("rc=1;errmsg=service_"), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(name), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("_not_found;"), status);
}
- tmp[i++] = NULL;
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -876,9 +852,10 @@ static HYD_status fn_name_unpublish(int fd, int pid, int pgid, char *args[])
static HYD_status fn_name_lookup(int fd, int pid, int pgid, char *args[])
{
- char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid, *name, *value;
+ struct HYD_string_stash stash;
+ char *cmd, *thrid, *name, *value;
struct HYD_pmcd_pmi_publish *publish;
- int i, token_count;
+ int token_count;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -898,26 +875,23 @@ static HYD_status fn_name_lookup(int fd, int pid, int pgid, char *args[])
status = HYD_pmcd_pmi_lookup(name, &value);
HYDU_ERR_POP(status, "error while looking up service\n");
- i = 0;
- tmp[i++] = HYDU_strdup("cmd=name-lookup-response;");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("cmd=name-lookup-response;"), status);
if (thrid) {
- tmp[i++] = HYDU_strdup("thrid=");
- tmp[i++] = HYDU_strdup(thrid);
- tmp[i++] = HYDU_strdup(";");
+ HYD_STRING_STASH(stash, HYDU_strdup("thrid="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(thrid), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
}
if (value) {
- tmp[i++] = HYDU_strdup("port=");
- tmp[i++] = HYDU_strdup(value);
- tmp[i++] = HYDU_strdup(";found=TRUE;rc=0;");
+ HYD_STRING_STASH(stash, HYDU_strdup("port="), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(value), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(";found=TRUE;rc=0;"), status);
}
else {
- tmp[i++] = HYDU_strdup("found=FALSE;rc=1;");
+ HYD_STRING_STASH(stash, HYDU_strdup("found=FALSE;rc=1;"), status);
}
- tmp[i++] = NULL;
- status = HYDU_str_alloc_and_join(tmp, &cmd);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, cmd, status);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_utils.c b/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
index 45222aa..7823905 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
@@ -10,14 +10,14 @@
#include "pmiserv_pmi.h"
#include "pmiserv_utils.h"
-HYD_status HYD_pmcd_pmi_fill_in_proxy_args(char **proxy_args, char *control_port, int pgid)
+HYD_status HYD_pmcd_pmi_fill_in_proxy_args(struct HYD_string_stash *proxy_stash,
+ char *control_port, int pgid)
{
- int i, arg, use_ddd, use_valgrind, use_strace, retries, ret;
- char *path_str[HYD_NUM_TMP_STRINGS];
+ int use_ddd, use_valgrind, use_strace, retries, ret;
+ char *str;
+ struct HYD_string_stash stash;
HYD_status status = HYD_SUCCESS;
- arg = 0;
-
/* Hack to use ddd and valgrind with the proxy */
if (MPL_env2bool("HYDRA_USE_DDD", &use_ddd) == 0)
use_ddd = 0;
@@ -26,81 +26,80 @@ HYD_status HYD_pmcd_pmi_fill_in_proxy_args(char **proxy_args, char *control_port
if (MPL_env2bool("HYDRA_USE_STRACE", &use_strace) == 0)
use_strace = 0;
+ HYD_STRING_STASH_INIT(*proxy_stash);
if (use_ddd) {
- proxy_args[arg++] = HYDU_strdup("ddd");
- proxy_args[arg++] = HYDU_strdup("--args");
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("ddd"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--args"), status);
}
if (use_valgrind) {
- proxy_args[arg++] = HYDU_strdup("valgrind");
- proxy_args[arg++] = HYDU_strdup("--leak-check=full");
- proxy_args[arg++] = HYDU_strdup("--show-reachable=yes");
- proxy_args[arg++] = HYDU_strdup("--track-origins=yes");
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("valgrind"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--leak-check=full"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--show-reachable=yes"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--track-origins=yes"), status);
}
if (use_strace) {
- proxy_args[arg++] = HYDU_strdup("strace");
- proxy_args[arg++] = HYDU_strdup("-o");
- proxy_args[arg++] = HYDU_strdup("hydra_strace");
- proxy_args[arg++] = HYDU_strdup("-ff");
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("strace"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("-o"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("hydra_strace"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("-ff"), status);
}
- i = 0;
- path_str[i++] = HYDU_strdup(HYD_server_info.base_path);
- path_str[i++] = HYDU_strdup("hydra_pmi_proxy");
- path_str[i] = NULL;
- status = HYDU_str_alloc_and_join(path_str, &proxy_args[arg++]);
- HYDU_ERR_POP(status, "unable to join strings\n");
- HYDU_free_strlist(path_str);
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup(HYD_server_info.base_path), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("hydra_pmi_proxy"), status);
+ HYD_STRING_SPIT(stash, str, status);
+
+ HYD_STRING_STASH(*proxy_stash, str, status);
- proxy_args[arg++] = HYDU_strdup("--control-port");
- proxy_args[arg++] = HYDU_strdup(control_port);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--control-port"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup(control_port), status);
if (HYD_server_info.user_global.debug)
- proxy_args[arg++] = HYDU_strdup("--debug");
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--debug"), status);
if (HYDT_bsci_info.rmk) {
- proxy_args[arg++] = HYDU_strdup("--rmk");
- proxy_args[arg++] = HYDU_strdup(HYDT_bsci_info.rmk);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--rmk"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup(HYDT_bsci_info.rmk), status);
}
if (HYDT_bsci_info.launcher) {
- proxy_args[arg++] = HYDU_strdup("--launcher");
- proxy_args[arg++] = HYDU_strdup(HYDT_bsci_info.launcher);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--launcher"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup(HYDT_bsci_info.launcher), status);
}
if (HYDT_bsci_info.launcher_exec) {
- proxy_args[arg++] = HYDU_strdup("--launcher-exec");
- proxy_args[arg++] = HYDU_strdup(HYDT_bsci_info.launcher_exec);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--launcher-exec"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup(HYDT_bsci_info.launcher_exec), status);
}
- proxy_args[arg++] = HYDU_strdup("--demux");
- proxy_args[arg++] = HYDU_strdup(HYD_server_info.user_global.demux);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--demux"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup(HYD_server_info.user_global.demux), status);
if (HYD_server_info.user_global.iface) {
- proxy_args[arg++] = HYDU_strdup("--iface");
- proxy_args[arg++] = HYDU_strdup(HYD_server_info.user_global.iface);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--iface"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup(HYD_server_info.user_global.iface), status);
}
- proxy_args[arg++] = HYDU_strdup("--pgid");
- proxy_args[arg++] = HYDU_int_to_str(pgid);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--pgid"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_int_to_str(pgid), status);
ret = MPL_env2int("HYDRA_PROXY_RETRY_COUNT", &retries);
if (ret == 0)
retries = HYD_DEFAULT_RETRY_COUNT;
- proxy_args[arg++] = HYDU_strdup("--retries");
- proxy_args[arg++] = HYDU_int_to_str(retries);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--retries"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_int_to_str(retries), status);
- proxy_args[arg++] = HYDU_strdup("--usize");
- proxy_args[arg++] = HYDU_int_to_str(HYD_server_info.user_global.usize);
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--usize"), status);
+ HYD_STRING_STASH(*proxy_stash, HYDU_int_to_str(HYD_server_info.user_global.usize), status);
- proxy_args[arg++] = HYDU_strdup("--proxy-id");
- proxy_args[arg++] = NULL;
+ HYD_STRING_STASH(*proxy_stash, HYDU_strdup("--proxy-id"), status);
if (HYD_server_info.user_global.debug) {
HYDU_dump_noprefix(stdout, "\nProxy launch args: ");
- HYDU_print_strlist(proxy_args);
+ HYDU_print_strlist(proxy_stash->strlist);
HYDU_dump_noprefix(stdout, "\n");
}
@@ -113,8 +112,8 @@ HYD_status HYD_pmcd_pmi_fill_in_proxy_args(char **proxy_args, char *control_port
static HYD_status pmi_process_mapping(struct HYD_pg *pg, char **process_mapping_str)
{
- int i, is_equal, filler_round, core_count;
- char *tmp[HYD_NUM_TMP_STRINGS];
+ int is_equal, filler_round, core_count;
+ struct HYD_string_stash stash;
struct block {
int start_idx;
int num_nodes;
@@ -204,28 +203,23 @@ static HYD_status pmi_process_mapping(struct HYD_pg *pg, char **process_mapping_
create_mapping_key:
/* Create the mapping out of the blocks */
- i = 0;
- tmp[i++] = HYDU_strdup("(");
- tmp[i++] = HYDU_strdup("vector,");
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_strdup("("), status);
+ HYD_STRING_STASH(stash, HYDU_strdup("vector,"), status);
for (block = blocklist_head; block; block = block->next) {
- tmp[i++] = HYDU_strdup("(");
- tmp[i++] = HYDU_int_to_str(block->start_idx);
- tmp[i++] = HYDU_strdup(",");
- tmp[i++] = HYDU_int_to_str(block->num_nodes);
- tmp[i++] = HYDU_strdup(",");
- tmp[i++] = HYDU_int_to_str(block->core_count);
- tmp[i++] = HYDU_strdup(")");
+ HYD_STRING_STASH(stash, HYDU_strdup("("), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(block->start_idx), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(","), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(block->num_nodes), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(","), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(block->core_count), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(")"), status);
if (block->next)
- tmp[i++] = HYDU_strdup(",");
- HYDU_STRLIST_CONSOLIDATE(tmp, i, status);
+ HYD_STRING_STASH(stash, HYDU_strdup(","), status);
}
- tmp[i++] = HYDU_strdup(")");
- tmp[i++] = NULL;
-
- status = HYDU_str_alloc_and_join(tmp, process_mapping_str);
- HYDU_ERR_POP(status, "error while joining strings\n");
+ HYD_STRING_STASH(stash, HYDU_strdup(")"), status);
- HYDU_free_strlist(tmp);
+ HYD_STRING_SPIT(stash, *process_mapping_str, status);
for (block = blocklist_head; block; block = nblock) {
nblock = block->next;
@@ -242,16 +236,16 @@ static HYD_status pmi_process_mapping(struct HYD_pg *pg, char **process_mapping_
HYD_status HYD_pmcd_pmi_fill_in_exec_launch_info(struct HYD_pg *pg)
{
- int i, arg, inherited_env_count, user_env_count, system_env_count, exec_count;
- int total_args, proxy_count, total_filler_processes, total_core_count;
+ int i, inherited_env_count, user_env_count, system_env_count, exec_count;
+ int proxy_count, total_filler_processes, total_core_count;
int pmi_id, *filler_pmi_ids = NULL, *nonfiller_pmi_ids = NULL;
struct HYD_env *env;
struct HYD_proxy *proxy;
struct HYD_exec *exec;
struct HYD_node *node;
struct HYD_pmcd_pmi_pg_scratch *pg_scratch;
- char *mapping = NULL, *map = NULL;
- char *tmp[HYD_NUM_TMP_STRINGS];
+ char *mapping = NULL, *map;
+ struct HYD_string_stash stash, exec_stash;
HYD_status status = HYD_SUCCESS;
status = pmi_process_mapping(pg, &mapping);
@@ -301,216 +295,210 @@ HYD_status HYD_pmcd_pmi_fill_in_exec_launch_info(struct HYD_pg *pg)
for (exec_count = 0, exec = proxy->exec_list; exec; exec = exec->next)
exec_count++;
- total_args = HYD_NUM_TMP_STRINGS; /* For the basic arguments */
-
- /* Environments */
- total_args += inherited_env_count;
- total_args += user_env_count;
- total_args += system_env_count;
-
- /* For each exec add a few strings */
- total_args += (exec_count * HYD_NUM_TMP_STRINGS);
-
- /* Add a few strings for the remaining arguments */
- total_args += HYD_NUM_TMP_STRINGS;
+ HYD_STRING_STASH_INIT(exec_stash);
- HYDU_MALLOC(proxy->exec_launch_info, char **, total_args * sizeof(char *), status);
-
- arg = 0;
- proxy->exec_launch_info[arg++] = HYDU_strdup("--version");
- proxy->exec_launch_info[arg++] = HYDU_strdup(HYDRA_VERSION);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--version"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYDRA_VERSION), status);
if (HYD_server_info.iface_ip_env_name) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--iface-ip-env-name");
- proxy->exec_launch_info[arg++] = HYDU_strdup(HYD_server_info.iface_ip_env_name);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--iface-ip-env-name"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.iface_ip_env_name), status);
}
- proxy->exec_launch_info[arg++] = HYDU_strdup("--hostname");
- proxy->exec_launch_info[arg++] = HYDU_strdup(proxy->node->hostname);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--hostname"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(proxy->node->hostname), status);
/* This map has three fields: filler cores on this node,
* remaining cores on this node, total cores in the system */
- proxy->exec_launch_info[arg++] = HYDU_strdup("--global-core-map");
- tmp[0] = HYDU_int_to_str(proxy->filler_processes);
- tmp[1] = HYDU_strdup(",");
- tmp[2] = HYDU_int_to_str(proxy->node->core_count);
- tmp[3] = HYDU_strdup(",");
- tmp[4] = HYDU_int_to_str(total_core_count);
- tmp[5] = NULL;
- status = HYDU_str_alloc_and_join(tmp, &map);
- HYDU_ERR_POP(status, "unable to join strings\n");
- proxy->exec_launch_info[arg++] = map;
- HYDU_free_strlist(tmp);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--global-core-map"), status);
+
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(proxy->filler_processes), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(","), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(proxy->node->core_count), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(","), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(total_core_count), status);
+ HYD_STRING_SPIT(stash, map, status);
+
+ HYD_STRING_STASH(exec_stash, map, status);
/* This map has two fields: start PMI ID during the filler
* phase, start PMI ID for the remaining phase */
- proxy->exec_launch_info[arg++] = HYDU_strdup("--pmi-id-map");
- tmp[0] = HYDU_int_to_str(filler_pmi_ids[proxy_count]);
- tmp[1] = HYDU_strdup(",");
- tmp[2] = HYDU_int_to_str(nonfiller_pmi_ids[proxy_count]);
- tmp[3] = NULL;
- status = HYDU_str_alloc_and_join(tmp, &map);
- HYDU_ERR_POP(status, "unable to join strings\n");
- proxy->exec_launch_info[arg++] = map;
- HYDU_free_strlist(tmp);
-
- proxy->exec_launch_info[arg++] = HYDU_strdup("--global-process-count");
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(pg->pg_process_count);
-
- proxy->exec_launch_info[arg++] = HYDU_strdup("--auto-cleanup");
- proxy->exec_launch_info[arg++] =
- HYDU_int_to_str(HYD_server_info.user_global.auto_cleanup);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--pmi-id-map"), status);
+
+ HYD_STRING_STASH_INIT(stash);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(filler_pmi_ids[proxy_count]), status);
+ HYD_STRING_STASH(stash, HYDU_strdup(","), status);
+ HYD_STRING_STASH(stash, HYDU_int_to_str(nonfiller_pmi_ids[proxy_count]), status);
+ HYD_STRING_SPIT(stash, map, status);
+
+ HYD_STRING_STASH(exec_stash, map, status);
+
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--global-process-count"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(pg->pg_process_count), status);
+
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--auto-cleanup"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(HYD_server_info.user_global.auto_cleanup),
+ status);
pg_scratch = (struct HYD_pmcd_pmi_pg_scratch *) pg->pg_scratch;
- proxy->exec_launch_info[arg++] = HYDU_strdup("--pmi-kvsname");
- proxy->exec_launch_info[arg++] = HYDU_strdup(pg_scratch->kvs->kvsname);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--pmi-kvsname"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(pg_scratch->kvs->kvsname), status);
if (pg->spawner_pg) {
pg_scratch = (struct HYD_pmcd_pmi_pg_scratch *) pg->spawner_pg->pg_scratch;
- proxy->exec_launch_info[arg++] = HYDU_strdup("--pmi-spawner-kvsname");
- proxy->exec_launch_info[arg++] = HYDU_strdup(pg_scratch->kvs->kvsname);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--pmi-spawner-kvsname"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(pg_scratch->kvs->kvsname), status);
}
- proxy->exec_launch_info[arg++] = HYDU_strdup("--pmi-process-mapping");
- proxy->exec_launch_info[arg++] = HYDU_strdup(mapping);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--pmi-process-mapping"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(mapping), status);
if (proxy->node->local_binding) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--binding");
- proxy->exec_launch_info[arg++] = HYDU_strdup(proxy->node->local_binding);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--binding"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(proxy->node->local_binding), status);
}
else if (HYD_server_info.user_global.binding) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--binding");
- proxy->exec_launch_info[arg++] = HYDU_strdup(HYD_server_info.user_global.binding);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--binding"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.user_global.binding), status);
}
if (HYD_server_info.user_global.mapping) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--mapping");
- proxy->exec_launch_info[arg++] = HYDU_strdup(HYD_server_info.user_global.mapping);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--mapping"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.user_global.mapping), status);
}
if (HYD_server_info.user_global.membind) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--membind");
- proxy->exec_launch_info[arg++] = HYDU_strdup(HYD_server_info.user_global.membind);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--membind"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.user_global.membind), status);
}
if (HYD_server_info.user_global.topolib) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--topolib");
- proxy->exec_launch_info[arg++] = HYDU_strdup(HYD_server_info.user_global.topolib);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--topolib"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.user_global.topolib), status);
}
if (HYD_server_info.user_global.ckpointlib) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--ckpointlib");
- proxy->exec_launch_info[arg++] =
- HYDU_strdup(HYD_server_info.user_global.ckpointlib);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--ckpointlib"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.user_global.ckpointlib),
+ status);
}
if (HYD_server_info.user_global.ckpoint_prefix) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--ckpoint-prefix");
- proxy->exec_launch_info[arg++] =
- HYDU_strdup(HYD_server_info.user_global.ckpoint_prefix);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--ckpoint-prefix"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.user_global.ckpoint_prefix),
+ status);
}
if (HYD_server_info.user_global.ckpoint_num) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--ckpoint-num");
- proxy->exec_launch_info[arg++] =
- HYDU_int_to_str(HYD_server_info.user_global.ckpoint_num);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--ckpoint-num"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(HYD_server_info.user_global.ckpoint_num),
+ status);
}
- proxy->exec_launch_info[arg++] = HYDU_strdup("--global-inherited-env");
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--global-inherited-env"), status);
for (i = 0, env = HYD_server_info.user_global.global_env.inherited; env;
env = env->next, i++);
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(i);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(i), status);
for (env = HYD_server_info.user_global.global_env.inherited; env; env = env->next) {
- status = HYDU_env_to_str(env, &proxy->exec_launch_info[arg++]);
+ char *envstr;
+
+ status = HYDU_env_to_str(env, &envstr);
HYDU_ERR_POP(status, "error converting env to string\n");
+
+ HYD_STRING_STASH(exec_stash, envstr, status);
}
- proxy->exec_launch_info[arg++] = NULL;
- arg = HYDU_strlist_lastidx(proxy->exec_launch_info);
- proxy->exec_launch_info[arg++] = HYDU_strdup("--global-user-env");
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--global-user-env"), status);
for (i = 0, env = HYD_server_info.user_global.global_env.user; env;
env = env->next, i++);
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(i);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(i), status);
for (env = HYD_server_info.user_global.global_env.user; env; env = env->next) {
- status = HYDU_env_to_str(env, &proxy->exec_launch_info[arg++]);
+ char *envstr;
+
+ status = HYDU_env_to_str(env, &envstr);
HYDU_ERR_POP(status, "error converting env to string\n");
+
+ HYD_STRING_STASH(exec_stash, envstr, status);
}
- proxy->exec_launch_info[arg++] = NULL;
- arg = HYDU_strlist_lastidx(proxy->exec_launch_info);
- proxy->exec_launch_info[arg++] = HYDU_strdup("--global-system-env");
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--global-system-env"), status);
for (i = 0, env = HYD_server_info.user_global.global_env.system; env;
env = env->next, i++);
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(i);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(i), status);
for (env = HYD_server_info.user_global.global_env.system; env; env = env->next) {
- status = HYDU_env_to_str(env, &proxy->exec_launch_info[arg++]);
+ char *envstr;
+
+ status = HYDU_env_to_str(env, &envstr);
HYDU_ERR_POP(status, "error converting env to string\n");
+
+ HYD_STRING_STASH(exec_stash, envstr, status);
}
- proxy->exec_launch_info[arg++] = NULL;
- arg = HYDU_strlist_lastidx(proxy->exec_launch_info);
if (HYD_server_info.user_global.global_env.prop) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--genv-prop");
- proxy->exec_launch_info[arg++] =
- HYDU_strdup(HYD_server_info.user_global.global_env.prop);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--genv-prop"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(HYD_server_info.user_global.global_env.prop),
+ status);
}
- proxy->exec_launch_info[arg++] = HYDU_strdup("--proxy-core-count");
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(proxy->node->core_count);
- proxy->exec_launch_info[arg++] = NULL;
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--proxy-core-count"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(proxy->node->core_count), status);
/* Now pass the local executable information */
for (exec = proxy->exec_list; exec; exec = exec->next) {
- arg = HYDU_strlist_lastidx(proxy->exec_launch_info);
- proxy->exec_launch_info[arg++] = HYDU_strdup("--exec");
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--exec"), status);
- proxy->exec_launch_info[arg++] = HYDU_strdup("--exec-appnum");
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(exec->appnum);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--exec-appnum"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(exec->appnum), status);
- proxy->exec_launch_info[arg++] = HYDU_strdup("--exec-proc-count");
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(exec->proc_count);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--exec-proc-count"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(exec->proc_count), status);
- proxy->exec_launch_info[arg++] = HYDU_strdup("--exec-local-env");
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--exec-local-env"), status);
for (i = 0, env = exec->user_env; env; env = env->next, i++);
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(i);
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(i), status);
for (env = exec->user_env; env; env = env->next) {
- status = HYDU_env_to_str(env, &proxy->exec_launch_info[arg++]);
+ char *envstr;
+
+ status = HYDU_env_to_str(env, &envstr);
HYDU_ERR_POP(status, "error converting env to string\n");
+
+ HYD_STRING_STASH(exec_stash, envstr, status);
}
- proxy->exec_launch_info[arg++] = NULL;
if (exec->env_prop) {
- arg = HYDU_strlist_lastidx(proxy->exec_launch_info);
- proxy->exec_launch_info[arg++] = HYDU_strdup("--exec-env-prop");
- proxy->exec_launch_info[arg++] = HYDU_strdup(exec->env_prop);
- proxy->exec_launch_info[arg++] = NULL;
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--exec-env-prop"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(exec->env_prop), status);
}
- arg = HYDU_strlist_lastidx(proxy->exec_launch_info);
-
if (exec->wdir) {
- proxy->exec_launch_info[arg++] = HYDU_strdup("--exec-wdir");
- proxy->exec_launch_info[arg++] = HYDU_strdup(exec->wdir);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--exec-wdir"), status);
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(exec->wdir), status);
}
- proxy->exec_launch_info[arg++] = HYDU_strdup("--exec-args");
+ HYD_STRING_STASH(exec_stash, HYDU_strdup("--exec-args"), status);
for (i = 0; exec->exec[i]; i++);
- proxy->exec_launch_info[arg++] = HYDU_int_to_str(i);
- proxy->exec_launch_info[arg++] = NULL;
+ HYD_STRING_STASH(exec_stash, HYDU_int_to_str(i), status);
- HYDU_list_append_strlist(exec->exec, proxy->exec_launch_info);
+ for (i = 0; exec->exec[i]; i++)
+ HYD_STRING_STASH(exec_stash, HYDU_strdup(exec->exec[i]), status);
}
if (HYD_server_info.user_global.debug) {
HYDU_dump_noprefix(stdout, "Arguments being passed to proxy %d:\n", proxy_count);
- HYDU_print_strlist(proxy->exec_launch_info);
+ HYDU_print_strlist(stash.strlist);
HYDU_dump_noprefix(stdout, "\n");
}
+ status = HYDU_strdup_list(exec_stash.strlist, &proxy->exec_launch_info);
+ HYDU_ERR_POP(status, "unable to dup strlist\n");
+
+ HYD_STRING_STASH_FREE(exec_stash);
+
proxy_count++;
}
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_utils.h b/src/pm/hydra/pm/pmiserv/pmiserv_utils.h
index 4f7543b..992bb6a 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_utils.h
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_utils.h
@@ -10,7 +10,8 @@
#include "demux.h"
#include "pmiserv_pmi.h"
-HYD_status HYD_pmcd_pmi_fill_in_proxy_args(char **proxy_args, char *control_port, int pgid);
+HYD_status HYD_pmcd_pmi_fill_in_proxy_args(struct HYD_string_stash *stash,
+ char *control_port, int pgid);
HYD_status HYD_pmcd_pmi_fill_in_exec_launch_info(struct HYD_pg *pg);
HYD_status HYD_pmcd_pmi_alloc_pg_scratch(struct HYD_pg *pg);
HYD_status HYD_pmcd_pmi_free_pg_scratch(struct HYD_pg *pg);
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/include/hydra.h | 62 +++-
src/pm/hydra/pm/pmiserv/common.c | 12 +-
src/pm/hydra/pm/pmiserv/common.h | 18 +-
src/pm/hydra/pm/pmiserv/pmi_v2_common.c | 3 +-
src/pm/hydra/pm/pmiserv/pmip_cb.c | 46 +--
src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c | 181 +++++------
src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c | 204 +++++------
src/pm/hydra/pm/pmiserv/pmip_utils.c | 3 +-
src/pm/hydra/pm/pmiserv/pmiserv_cb.c | 45 +--
src/pm/hydra/pm/pmiserv/pmiserv_pmci.c | 11 +-
src/pm/hydra/pm/pmiserv/pmiserv_pmi.c | 51 ++--
src/pm/hydra/pm/pmiserv/pmiserv_pmi.h | 2 +-
src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c | 100 +++---
src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c | 249 ++++++--------
src/pm/hydra/pm/pmiserv/pmiserv_utils.c | 364 ++++++++++----------
src/pm/hydra/pm/pmiserv/pmiserv_utils.h | 3 +-
.../bootstrap/external/external_common_launch.c | 15 +-
src/pm/hydra/tools/bootstrap/external/ll.h | 3 +-
src/pm/hydra/tools/bootstrap/external/ll_launch.c | 3 +-
src/pm/hydra/tools/bootstrap/external/pbs.h | 3 +-
src/pm/hydra/tools/bootstrap/external/pbs_launch.c | 9 +-
src/pm/hydra/tools/bootstrap/external/pbs_wait.c | 3 +-
src/pm/hydra/tools/bootstrap/external/slurm.h | 3 +-
.../hydra/tools/bootstrap/external/slurm_launch.c | 3 +-
.../hydra/tools/bootstrap/persist/persist_launch.c | 6 +-
.../hydra/tools/bootstrap/persist/persist_server.c | 9 +-
src/pm/hydra/tools/bootstrap/src/bsci_init.c.in | 3 +-
src/pm/hydra/tools/ckpoint/blcr/ckpoint_blcr.c | 21 +-
src/pm/hydra/tools/ckpoint/ckpoint.c | 6 +-
src/pm/hydra/tools/demux/demux.c | 9 +-
src/pm/hydra/tools/demux/demux.h | 3 +-
src/pm/hydra/tools/demux/demux_poll.c | 3 +-
src/pm/hydra/tools/demux/demux_select.c | 3 +-
src/pm/hydra/tools/nameserver/hydra_nameserver.c | 21 +-
src/pm/hydra/tools/topo/hwloc/topo_hwloc.c | 21 +-
src/pm/hydra/ui/mpich/mpiexec.c | 2 +-
src/pm/hydra/ui/mpich/utils.c | 36 +--
src/pm/hydra/utils/alloc/alloc.c | 12 +-
src/pm/hydra/utils/args/args.c | 18 +-
src/pm/hydra/utils/dbg/dbg.c | 3 +-
src/pm/hydra/utils/env/env.c | 3 +-
src/pm/hydra/utils/others/others.c | 3 +-
src/pm/hydra/utils/sock/sock.c | 21 +-
src/pm/hydra/utils/string/string.c | 3 +-
44 files changed, 716 insertions(+), 886 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list