[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-116-g976d7b9
mysql vizuser
noreply at mpich.org
Thu May 2 22:07:32 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 976d7b9b5519c08462cfa6a7c2a7bb38303afe5f (commit)
via 657da4c2d50ba84ef6a2fbf68f782ed1be307a1a (commit)
from 7dc192b8fbd33cffef12432d0137833ccd597771 (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/976d7b9b5519c08462cfa6a7c2a7bb38303afe5f
commit 976d7b9b5519c08462cfa6a7c2a7bb38303afe5f
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Thu May 2 22:07:07 2013 -0500
Revert accidental commit [7dc192b8]
diff --git a/src/pm/hydra/include/hydra.h b/src/pm/hydra/include/hydra.h
index 7837ca3..6cdbfa9 100644
--- a/src/pm/hydra/include/hydra.h
+++ b/src/pm/hydra/include/hydra.h
@@ -163,44 +163,6 @@ extern char **environ;
#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)
-
enum HYD_bool {
HYD_FALSE = 0,
HYD_TRUE = 1
@@ -646,6 +608,19 @@ 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_pmi_v1.c b/src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c
index 9ec7b30..3fb1992 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, *cmd;
+ char *val;
struct HYD_pmcd_token *tokens;
int token_count;
- struct HYD_string_stash stash;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -209,19 +209,22 @@ static HYD_status fn_initack(int fd, char *args[])
}
HYDU_ASSERT(i < HYD_pmcd_pmip.local.proxy_process_count, status);
- 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);
+ 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(stash, HYDU_strdup("\ncmd=set rank="), status);
- HYD_STRING_STASH(stash, HYDU_int_to_str(id), 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 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);
+ 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "error while joining strings\n");
+ HYDU_free_strlist(tmp);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -238,22 +241,25 @@ static HYD_status fn_initack(int fd, char *args[])
static HYD_status fn_get_maxes(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *cmd;
+ int i;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- 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);
+ 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);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -271,8 +277,7 @@ static HYD_status fn_get_appnum(int fd, char *args[])
{
int i, idx;
struct HYD_exec *exec;
- struct HYD_string_stash stash;
- char *cmd;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -291,12 +296,15 @@ static HYD_status fn_get_appnum(int fd, char *args[])
break;
}
- 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);
+ 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -312,18 +320,21 @@ static HYD_status fn_get_appnum(int fd, char *args[])
static HYD_status fn_get_my_kvsname(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *cmd;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ int i;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- 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);
+ 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -339,25 +350,26 @@ static HYD_status fn_get_my_kvsname(int fd, char *args[])
static HYD_status fn_get_usize(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *cmd;
+ int i;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=universe_size size="), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=universe_size size=");
if (HYD_pmcd_pmip.user_global.usize == HYD_USIZE_SYSTEM)
- HYD_STRING_STASH(stash,
- HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_core_map.global_count),
- status);
+ tmp[i++] = HYDU_int_to_str(HYD_pmcd_pmip.system_global.global_core_map.global_count);
else if (HYD_pmcd_pmip.user_global.usize == HYD_USIZE_INFINITE)
- HYD_STRING_STASH(stash, HYDU_int_to_str(-1), status);
+ tmp[i++] = HYDU_int_to_str(-1);
else
- HYD_STRING_STASH(stash, HYDU_int_to_str(HYD_pmcd_pmip.user_global.usize), status);
- HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
+ tmp[i++] = HYDU_int_to_str(HYD_pmcd_pmip.user_global.usize);
+ tmp[i++] = HYDU_strdup("\n");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -373,8 +385,7 @@ static HYD_status fn_get_usize(int fd, char *args[])
static HYD_status fn_get(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *cmd, *key, *val;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *key, *val;
struct HYD_pmcd_token *tokens;
int token_count, i;
HYD_status status = HYD_SUCCESS;
@@ -389,13 +400,15 @@ static HYD_status fn_get(int fd, char *args[])
"unable to find token: key\n");
if (!strcmp(key, "PMI_process_mapping")) {
- 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);
+ 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending PMI response\n");
@@ -410,20 +423,23 @@ static HYD_status fn_get(int fd, char *args[])
}
}
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=get_result rc="), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=get_result rc=");
if (val) {
- HYD_STRING_STASH(stash, HYDU_strdup("0 msg=success value="), status);
- HYD_STRING_STASH(stash, HYDU_strdup(val), status);
+ tmp[i++] = HYDU_strdup("0 msg=success value=");
+ tmp[i++] = HYDU_strdup(val);
}
else {
- 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("-1 msg=key_");
+ tmp[i++] = HYDU_strdup(key);
+ tmp[i++] = HYDU_strdup("_not_found value=unknown");
}
- HYD_STRING_STASH(stash, HYDU_strdup("\n"), status);
+ tmp[i++] = HYDU_strdup("\n");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = send_cmd_downstream(fd, cmd);
HYDU_ERR_POP(status, "error sending command downstream\n");
@@ -441,11 +457,10 @@ static HYD_status fn_get(int fd, char *args[])
static HYD_status fn_put(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *cmd;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
char *key, *val;
struct HYD_pmcd_token *tokens;
- int token_count;
+ int token_count, i;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -462,12 +477,15 @@ static HYD_status fn_put(int fd, char *args[])
val = HYDU_strdup("");
/* add to the cache */
- 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);
+ i = 0;
+ tmp[i++] = HYDU_strdup(key);
+ tmp[i++] = HYDU_strdup("=");
+ tmp[i++] = HYDU_strdup(val);
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
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 8d2c66d..4246057 100644
--- a/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c
@@ -17,23 +17,25 @@ 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, sent, closed;
- struct HYD_string_stash stash;
- char *buf;
+ int i, j, sent, closed;
+ char *tmp[HYD_NUM_TMP_STRINGS], *buf;
struct HYD_pmcd_hdr hdr;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup(start), status);
+ j = 0;
+ tmp[j++] = HYDU_strdup(start);
for (i = 0; args[i]; i++) {
- HYD_STRING_STASH(stash, HYDU_strdup(args[i]), status);
+ tmp[j++] = HYDU_strdup(args[i]);
if (args[i + 1])
- HYD_STRING_STASH(stash, HYDU_strdup(";"), status);
+ tmp[j++] = HYDU_strdup(";");
}
+ tmp[j] = NULL;
- HYD_STRING_SPIT(stash, buf, status);
+ status = HYDU_str_alloc_and_join(tmp, &buf);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
HYD_pmcd_init_header(&hdr);
hdr.cmd = PMI_CMD;
@@ -150,8 +152,7 @@ static HYD_status fn_fullinit(int fd, char *args[])
{
int id, i;
char *rank_str;
- struct HYD_string_stash stash;
- char *cmd;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -176,29 +177,30 @@ static HYD_status fn_fullinit(int fd, char *args[])
}
HYDU_ASSERT(i < HYD_pmcd_pmip.local.proxy_process_count, status);
- 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);
+ 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(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);
+ 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");
if (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);
+ tmp[i++] = HYDU_strdup(";spawner-jobid=");
+ tmp[i++] = HYDU_strdup(HYD_pmcd_pmip.local.spawner_kvsname);
}
if (HYD_pmcd_pmip.user_global.debug) {
- HYD_STRING_STASH(stash, HYDU_strdup(";debugged=TRUE;pmiverbose=TRUE"), status);
+ tmp[i++] = HYDU_strdup(";debugged=TRUE;pmiverbose=TRUE");
}
else {
- HYD_STRING_STASH(stash, HYDU_strdup(";debugged=FALSE;pmiverbose=FALSE"), status);
+ tmp[i++] = HYDU_strdup(";debugged=FALSE;pmiverbose=FALSE");
}
- HYD_STRING_STASH(stash, HYDU_strdup(";rc=0;"), status);
+ tmp[i++] = HYDU_strdup(";rc=0;");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "error while joining strings\n");
+ HYDU_free_strlist(tmp);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -214,8 +216,8 @@ static HYD_status fn_fullinit(int fd, char *args[])
static HYD_status fn_job_getid(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *cmd, *thrid;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid;
+ int i;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -227,18 +229,22 @@ static HYD_status fn_job_getid(int fd, char *args[])
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=job-getid-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=job-getid-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- 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);
+ 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+
+ HYDU_free_strlist(tmp);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -253,10 +259,11 @@ static HYD_status fn_job_getid(int fd, char *args[])
static HYD_status fn_info_putnodeattr(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *key, *val, *thrid, *cmd;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ char *key, *val, *thrid;
+ int i, ret;
struct HYD_pmcd_token *tokens;
- int token_count, ret;
+ int token_count;
struct HYD_pmcd_pmi_v2_reqs *req;
HYD_status status = HYD_SUCCESS;
@@ -277,18 +284,21 @@ 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");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-putnodeattr-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=info-putnodeattr-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- 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);
+ tmp[i++] = HYDU_strdup("rc=");
+ tmp[i++] = HYDU_int_to_str(ret);
+ tmp[i++] = HYDU_strdup(";");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -312,11 +322,10 @@ static HYD_status fn_info_putnodeattr(int fd, char *args[])
static HYD_status fn_info_getnodeattr(int fd, char *args[])
{
- int found;
+ int i, found;
struct HYD_pmcd_pmi_kvs_pair *run;
char *key, *waitval, *thrid;
- struct HYD_string_stash stash;
- char *cmd;
+ char *tmp[HYD_NUM_TMP_STRINGS] = { 0 }, *cmd;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -344,18 +353,21 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
}
if (found) { /* We found the attribute */
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getnodeattr-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=info-getnodeattr-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ 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(";rc=0;"), 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -369,16 +381,19 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
}
else {
/* Tell the client that we can't find the attribute */
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getnodeattr-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=info-getnodeattr-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- HYD_STRING_STASH(stash, HYDU_strdup("found=FALSE;rc=0;"), status);
+ tmp[i++] = HYDU_strdup("found=FALSE;rc=0;");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -394,10 +409,9 @@ static HYD_status fn_info_getnodeattr(int fd, char *args[])
static HYD_status fn_info_getjobattr(int fd, char *args[])
{
- struct HYD_string_stash stash;
- char *cmd, *key, *thrid;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *key, *thrid;
struct HYD_pmcd_token *tokens;
- int token_count;
+ int token_count, i;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -412,19 +426,21 @@ 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")) {
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getjobattr-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=info-getjobattr-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- 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);
+ 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
@@ -446,10 +462,9 @@ static HYD_status fn_info_getjobattr(int fd, char *args[])
static HYD_status fn_finalize(int fd, char *args[])
{
char *thrid;
- struct HYD_string_stash stash;
- char *cmd;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
struct HYD_pmcd_token *tokens;
- int token_count;
+ int token_count, i;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -459,16 +474,19 @@ static HYD_status fn_finalize(int fd, char *args[])
thrid = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, "thrid");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=finalize-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=finalize-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
+ tmp[i++] = HYDU_strdup("rc=0;");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
send_cmd_downstream(fd, cmd);
HYDU_FREE(cmd);
diff --git a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
index a18d807..cbc4c08 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c
@@ -243,7 +243,7 @@ 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 };
- struct HYD_string_stash stash;
+ char *tmp[HYD_NUM_TMP_STRINGS];
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -398,12 +398,15 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
if (path == NULL)
execname = HYDU_strdup(val);
else {
- 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;
+ 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);
}
i = 0;
@@ -510,13 +513,16 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_ERR_POP(status, "launcher cannot launch processes\n");
{
- char *cmd;
+ char *cmd_str[HYD_NUM_TMP_STRINGS], *cmd;
- 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);
+ i = 0;
+ cmd_str[i++] = HYDU_strdup("cmd=spawn_result rc=0");
+ cmd_str[i++] = HYDU_strdup("\n");
+ cmd_str[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(cmd_str, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(cmd_str);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "error writing PMI line\n");
@@ -541,9 +547,8 @@ 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[])
{
- struct HYD_string_stash stash;
- char *cmd, *val;
- int token_count;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *val;
+ int i, token_count;
struct HYD_pmcd_token *tokens;
char *name, *port;
int success = 0;
@@ -565,16 +570,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");
- HYD_STRING_STASH_INIT(stash);
+ i = 0;
if (success)
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=publish_result info=ok rc=0 msg=success\n"),
- status);
+ tmp[i++] = HYDU_strdup("cmd=publish_result info=ok rc=0 msg=success\n");
else
- HYD_STRING_STASH(stash,
- HYDU_strdup("cmd=publish_result info=ok rc=1 msg=key_already_present\n"),
- status);
+ tmp[i++] = HYDU_strdup("cmd=publish_result info=ok rc=1 msg=key_already_present\n");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -590,9 +595,8 @@ 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[])
{
- struct HYD_string_stash stash;
- char *cmd, *name;
- int token_count;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *name;
+ int i, token_count;
struct HYD_pmcd_token *tokens;
int success = 0;
HYD_status status = HYD_SUCCESS;
@@ -608,16 +612,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");
- HYD_STRING_STASH_INIT(stash);
+ i = 0;
if (success)
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=unpublish_result info=ok rc=0 msg=success\n"),
- status);
+ tmp[i++] = HYDU_strdup("cmd=unpublish_result info=ok rc=0 msg=success\n");
else
- HYD_STRING_STASH(stash,
- HYDU_strdup("cmd=unpublish_result info=ok rc=1 msg=service_not_found\n"),
- status);
+ tmp[i++] = HYDU_strdup("cmd=unpublish_result info=ok rc=1 msg=service_not_found\n");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -633,9 +637,8 @@ 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[])
{
- struct HYD_string_stash stash;
- char *cmd, *name, *value;
- int token_count;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *name, *value;
+ int i, token_count;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -650,18 +653,21 @@ 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");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=lookup_result"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=lookup_result");
if (value) {
- 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);
+ tmp[i++] = HYDU_strdup(" port=");
+ tmp[i++] = HYDU_strdup(value);
+ tmp[i++] = HYDU_strdup(" info=ok rc=0 msg=success\n");
}
else {
- HYD_STRING_STASH(stash, HYDU_strdup(" rc=1 msg=service_not_found\n"), status);
+ tmp[i++] = HYDU_strdup(" rc=1 msg=service_not_found\n");
}
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
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 bdfc7f7..87ff14f 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c
@@ -111,12 +111,13 @@ 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, *cmd;
- struct HYD_string_stash stash;
+ char *thrid, *val;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -148,24 +149,28 @@ static HYD_status fn_info_getjobattr(int fd, int pid, int pgid, char *args[])
}
}
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=info-getjobattr-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=info-getjobattr-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- HYD_STRING_STASH(stash, HYDU_strdup("found="), status);
+ tmp[i++] = HYDU_strdup("found=");
if (val) {
- 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);
+ tmp[i++] = HYDU_strdup("TRUE;value=");
+ tmp[i++] = HYDU_strdup(val);
+ tmp[i++] = HYDU_strdup(";rc=0;");
}
else {
- HYD_STRING_STASH(stash, HYDU_strdup("FALSE;rc=0;"), status);
+ tmp[i++] = HYDU_strdup("FALSE;rc=0;");
}
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -183,9 +188,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[])
{
- struct HYD_string_stash stash;
- char *key, *val, *thrid, *cmd;
- int ret;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
+ char *key, *val, *thrid;
+ int i, ret;
struct HYD_proxy *proxy;
struct HYD_pmcd_pmi_pg_scratch *pg_scratch;
struct HYD_pmcd_token *tokens;
@@ -217,18 +222,22 @@ 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");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=kvs-put-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=kvs-put-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- 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);
+ 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_SPIT(stash, cmd, status);
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -259,8 +268,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, *cmd;
- struct HYD_string_stash stash;
+ char *key, *thrid;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd;
struct HYD_pmcd_token *tokens;
int token_count;
HYD_status status = HYD_SUCCESS;
@@ -313,24 +322,27 @@ static HYD_status fn_kvs_get(int fd, int pid, int pgid, char *args[])
}
}
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=kvs-get-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=kvs-get-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
if (found) {
- 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);
+ tmp[i++] = HYDU_strdup("found=TRUE;value=");
+ tmp[i++] = HYDU_strdup(run->val);
+ tmp[i++] = HYDU_strdup(";");
}
else {
- HYD_STRING_STASH(stash, HYDU_strdup("found=FALSE;"), status);
+ tmp[i++] = HYDU_strdup("found=FALSE;");
}
- HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
+ tmp[i++] = HYDU_strdup("rc=0;");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -349,8 +361,7 @@ 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;
- struct HYD_string_stash stash;
- char *cmd, *thrid;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid;
struct HYD_pmcd_token *tokens;
int token_count, i;
static int fence_count = 0;
@@ -385,16 +396,19 @@ static HYD_status fn_kvs_fence(int fd, int pid, int pgid, char *args[])
pg_scratch->ecount[i].epoch = 1;
}
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=kvs-fence-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=kvs-fence-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
- HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
+ tmp[i++] = HYDU_strdup("rc=0;");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -458,7 +472,7 @@ 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 };
- struct HYD_string_stash stash;
+ char *tmp[HYD_NUM_TMP_STRINGS];
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
@@ -599,12 +613,15 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
if (path == NULL)
execname = HYDU_strdup(val);
else {
- 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;
+ 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);
}
i = 0;
@@ -710,22 +727,25 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_ERR_POP(status, "launcher cannot launch processes\n");
{
- char *cmd;
+ char *cmd_str[HYD_NUM_TMP_STRINGS], *cmd;
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=spawn-response;"), status);
+ i = 0;
+ cmd_str[i++] = HYDU_strdup("cmd=spawn-response;");
if (thrid) {
- 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("thrid=");
+ cmd_str[i++] = HYDU_strdup(thrid);
+ cmd_str[i++] = HYDU_strdup(";");
}
- 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);
+ 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_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(cmd_str, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(cmd_str);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -746,9 +766,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[])
{
- struct HYD_string_stash stash;
- char *cmd, *thrid, *val, *name, *port;
- int token_count, success;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid, *val;
+ char *name, *port;
+ int i, token_count, success;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -770,22 +790,25 @@ 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");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=name-publish-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=name-publish-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
if (!success) {
- 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);
+ tmp[i++] = HYDU_strdup("rc=1;errmsg=duplicate_service_");
+ tmp[i++] = HYDU_strdup(name);
+ tmp[i++] = HYDU_strdup(";");
}
else
- HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
+ tmp[i++] = HYDU_strdup("rc=0;");
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -801,9 +824,8 @@ 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[])
{
- struct HYD_string_stash stash;
- char *cmd, *thrid, *name;
- int token_count, success;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid, *name;
+ int i, token_count, success;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -820,22 +842,25 @@ 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");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=name-unpublish-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=name-unpublish-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
if (success)
- HYD_STRING_STASH(stash, HYDU_strdup("rc=0;"), status);
+ tmp[i++] = HYDU_strdup("rc=0;");
else {
- 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++] = HYDU_strdup("rc=1;errmsg=service_");
+ tmp[i++] = HYDU_strdup(name);
+ tmp[i++] = HYDU_strdup("_not_found;");
}
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
status = cmd_response(fd, pid, cmd);
HYDU_ERR_POP(status, "send command failed\n");
@@ -851,10 +876,9 @@ 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[])
{
- struct HYD_string_stash stash;
- char *cmd, *thrid, *name, *value;
+ char *tmp[HYD_NUM_TMP_STRINGS], *cmd, *thrid, *name, *value;
struct HYD_pmcd_pmi_publish *publish;
- int token_count;
+ int i, token_count;
struct HYD_pmcd_token *tokens;
HYD_status status = HYD_SUCCESS;
@@ -874,23 +898,26 @@ 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");
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("cmd=name-lookup-response;"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("cmd=name-lookup-response;");
if (thrid) {
- 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("thrid=");
+ tmp[i++] = HYDU_strdup(thrid);
+ tmp[i++] = HYDU_strdup(";");
}
if (value) {
- 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);
+ tmp[i++] = HYDU_strdup("port=");
+ tmp[i++] = HYDU_strdup(value);
+ tmp[i++] = HYDU_strdup(";found=TRUE;rc=0;");
}
else {
- HYD_STRING_STASH(stash, HYDU_strdup("found=FALSE;rc=1;"), status);
+ tmp[i++] = HYDU_strdup("found=FALSE;rc=1;");
}
+ tmp[i++] = NULL;
- HYD_STRING_SPIT(stash, cmd, status);
+ status = HYDU_str_alloc_and_join(tmp, &cmd);
+ HYDU_ERR_POP(status, "unable to join strings\n");
+ HYDU_free_strlist(tmp);
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 a64f111..45222aa 100644
--- a/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
+++ b/src/pm/hydra/pm/pmiserv/pmiserv_utils.c
@@ -12,8 +12,8 @@
HYD_status HYD_pmcd_pmi_fill_in_proxy_args(char **proxy_args, char *control_port, int pgid)
{
- int arg, use_ddd, use_valgrind, use_strace, retries, ret;
- struct HYD_string_stash stash;
+ int i, arg, use_ddd, use_valgrind, use_strace, retries, ret;
+ char *path_str[HYD_NUM_TMP_STRINGS];
HYD_status status = HYD_SUCCESS;
arg = 0;
@@ -45,11 +45,13 @@ HYD_status HYD_pmcd_pmi_fill_in_proxy_args(char **proxy_args, char *control_port
proxy_args[arg++] = HYDU_strdup("-ff");
}
- 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, proxy_args[arg], status);
- arg++;
+ 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);
proxy_args[arg++] = HYDU_strdup("--control-port");
proxy_args[arg++] = HYDU_strdup(control_port);
@@ -111,8 +113,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 is_equal, filler_round, core_count;
- struct HYD_string_stash stash;
+ int i, is_equal, filler_round, core_count;
+ char *tmp[HYD_NUM_TMP_STRINGS];
struct block {
int start_idx;
int num_nodes;
@@ -202,23 +204,28 @@ static HYD_status pmi_process_mapping(struct HYD_pg *pg, char **process_mapping_
create_mapping_key:
/* Create the mapping out of the blocks */
- HYD_STRING_STASH_INIT(stash);
- HYD_STRING_STASH(stash, HYDU_strdup("("), status);
- HYD_STRING_STASH(stash, HYDU_strdup("vector,"), status);
+ i = 0;
+ tmp[i++] = HYDU_strdup("(");
+ tmp[i++] = HYDU_strdup("vector,");
for (block = blocklist_head; block; block = block->next) {
- 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);
+ 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(")");
if (block->next)
- HYD_STRING_STASH(stash, HYDU_strdup(","), status);
+ 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_SPIT(stash, *process_mapping_str, status);
+ HYDU_free_strlist(tmp);
for (block = blocklist_head; block; block = nblock) {
nblock = block->next;
http://git.mpich.org/mpich.git/commitdiff/657da4c2d50ba84ef6a2fbf68f782ed1be307a1a
commit 657da4c2d50ba84ef6a2fbf68f782ed1be307a1a
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Thu May 2 22:06:58 2013 -0500
Revert accidental commit [99e8252a]
diff --git a/confdb/aclocal.m4 b/confdb/aclocal.m4
index 36fb15c..488feaa 100644
--- a/confdb/aclocal.m4
+++ b/confdb/aclocal.m4
@@ -1,13 +1,18 @@
dnl This version of aclocal.m4 simply includes all of the individual
dnl components
+builtin(include,aclocal_am.m4)
builtin(include,aclocal_bugfix.m4)
builtin(include,aclocal_cache.m4)
builtin(include,aclocal_cc.m4)
+builtin(include,aclocal_atomic.m4)
dnl aclocal_cross.m4 uses autoconf features dated back to 2.13.
dnl too old to be useful, 07/14/2010.
dnl builtin(include,aclocal_cross.m4)
builtin(include,aclocal_cxx.m4)
builtin(include,aclocal_f77.m4)
+dnl aclocal_f77old.m4 contains PAC_PROG_F77_CMDARGS which is NOT used in MPICH
+dnl but it is still used by other packages, so leave it in confdb.
+dnl builtin(include,aclocal_f77old.m4)
builtin(include,aclocal_util.m4)
builtin(include,aclocal_subcfg.m4)
builtin(include,aclocal_make.m4)
diff --git a/confdb/aclocal_attr_alias.m4 b/confdb/aclocal_attr_alias.m4
index 33db329..32f0165 100644
--- a/confdb/aclocal_attr_alias.m4
+++ b/confdb/aclocal_attr_alias.m4
@@ -148,7 +148,7 @@ int same_addrs2( void *ptr )
])
],[
rm -f pac_conftest_other.$OBJEXT
- AC_RUN_LOG([cp conftest.$OBJEXT pac_conftest_other.$OBJEXT])
+ PAC_RUNLOG([cp conftest.$OBJEXT pac_conftest_other.$OBJEXT])
test -s pac_conftest_other.$OBJEXT && pac_c_attr_alias_other=yes
dnl cp conftest.$ac_ext pac_conftest_other.$ac_ext
dnl echo
@@ -196,7 +196,7 @@ extern int same_addrs2( void *ptr );
])
],[
rm -f pac_conftest_main$EXEEXT
- AC_RUN_LOG([cp conftest$EXEEXT pac_conftest_main$EXEEXT])
+ PAC_RUNLOG([cp conftest$EXEEXT pac_conftest_main$EXEEXT])
test -x pac_conftest_main$EXEEXT && pac_c_attr_alias_main=yes
dnl cp conftest.$ac_ext pac_conftest_main.$ac_ext
dnl echo
@@ -371,7 +371,7 @@ dnl
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],[
cp conftest.$ac_ext pac_conftest.c
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
PAC_PUSH_FLAG([LIBS])
LIBS="pac_conftest.$OBJEXT $LIBS"
AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77])
@@ -429,7 +429,7 @@ extern mpif_cmblk_t mpifcmb_ __attribute__ ((alias("mpifcmbr")));
])
],[
cp conftest.$ac_ext pac_conftest.c
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
PAC_PUSH_FLAG([LIBS])
LIBS="pac_conftest.$OBJEXT $LIBS"
AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77])
diff --git a/confdb/aclocal_cc.m4 b/confdb/aclocal_cc.m4
index 06a5145..98fdc34 100644
--- a/confdb/aclocal_cc.m4
+++ b/confdb/aclocal_cc.m4
@@ -105,7 +105,7 @@ if test "$pac_result" = "yes" ; then
int foo(void){return 0;}
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $LIBS"
diff --git a/confdb/aclocal_cxx.m4 b/confdb/aclocal_cxx.m4
index 418d8b7..279b668 100644
--- a/confdb/aclocal_cxx.m4
+++ b/confdb/aclocal_cxx.m4
@@ -153,7 +153,7 @@ if test "$pac_result" = "yes" ; then
int foo(void){return 0;}
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $LIBS"
diff --git a/confdb/aclocal_f77.m4 b/confdb/aclocal_f77.m4
index 38225e0..92d310b 100644
--- a/confdb/aclocal_f77.m4
+++ b/confdb/aclocal_f77.m4
@@ -64,7 +64,7 @@ AC_COMPILE_IFELSE([
end
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT f77conftest.$OBJEXT])
saved_LIBS="$LIBS"
dnl FLIBS is set by AC_F77_LIBRARY_LDFLAGS
LIBS="f77conftest.$OBJEXT $FLIBS $LIBS"
@@ -96,7 +96,7 @@ if test "$pac_found" != "yes" ; then
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([void ${call} ${sym}(int a) {}])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT cconftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT cconftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="cconftest.$OBJEXT $LIBS"
AC_LANG_PUSH([Fortran 77])
@@ -242,7 +242,7 @@ AC_COMPILE_IFELSE([
])
],[
# pac_f77compile_ok=yes
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
# Save original LIBS, prepend previously generated object file to LIBS
saved_LIBS="$LIBS"
LIBS="pac_f77conftest.$OBJEXT $FLIBS $LIBS"
@@ -349,7 +349,7 @@ int cisize_(char *i1p, char *i2p) {
dnl Endof ac_lang_source
],[
# pac_compile_ok=yes
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
# Save LIBS and prepend object file to LIBS
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $LIBS"
@@ -481,7 +481,7 @@ if test "$pac_result" = "yes" ; then
end
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $LIBS"
@@ -541,10 +541,10 @@ AC_COMPILE_IFELSE([
])
],[
# pac_f77compile_ok=yes
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
- AC_RUN_LOG([test -d conftestdir || mkdir conftestdir])
- AC_RUN_LOG([${AR-ar} ${AR_FLAGS-cr} conftestdir/libf77conftest.a pac_f77conftest.$OBJEXT])
- AC_RUN_LOG([${RANLIB-ranlib} conftestdir/libf77conftest.a])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([test -d conftestdir || mkdir conftestdir])
+ PAC_RUNLOG([${AR-ar} ${AR_FLAGS-cr} conftestdir/libf77conftest.a pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([${RANLIB-ranlib} conftestdir/libf77conftest.a])
# Save original LIBS, prepend previously generated object file to LIBS
saved_LIBS="$LIBS"
LIBS="-lf77conftest $LIBS"
@@ -595,7 +595,7 @@ ifelse([$1],[],[checkdir=f77tmpdir],[checkdir=$1;checkdir_is_given=yes])
AC_CACHE_CHECK([for include directory flag for Fortran],
pac_cv_prog_f77_has_incdir,[
test -d $checkdir || mkdir $checkdir
-dnl AC_RUN_LOG([echo ' call sub()' > $checkdir/conftestf.h])
+dnl PAC_RUNLOG([echo ' call sub()' > $checkdir/conftestf.h])
echo ' call sub()' > $checkdir/conftestf.h
AC_LANG_PUSH([Fortran 77])
saved_FFLAGS="$FFLAGS"
@@ -673,7 +673,7 @@ AC_COMPILE_IFELSE([
AC_LANG_SOURCE([$2])
],[
# pac_f77compile_ok=yes
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
# Save original LIBS, prepend previously generated object file to LIBS
saved_LIBS="$LIBS"
LIBS="pac_f77conftest.$OBJEXT $FLIBS $LIBS"
@@ -732,7 +732,7 @@ AC_COMPILE_IFELSE([
])
],[
# pac_f77compile_ok=yes
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
# Save original LIBS, prepend previously generated object file to LIBS
saved_LIBS="$LIBS"
LIBS="pac_f77conftest.$OBJEXT $FLIBS $saved_LIBS"
@@ -833,7 +833,7 @@ dnl Use F77 as a linker to compile a Fortran main and C subprogram.
if test "$pac_linkwithC" != "yes" ; then
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $saved_LIBS"
AC_LANG_PUSH([Fortran 77])
@@ -852,7 +852,7 @@ dnl Use C as a linker and FLIBS to compile a Fortran main and C subprogram.
if test "$pac_linkwithf77" != "yes" ; then
AC_LANG_PUSH([Fortran 77])
AC_COMPILE_IFELSE([],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_f77conftest.$OBJEXT $FLIBS $saved_LIBS"
AC_LANG_PUSH([C])
@@ -961,7 +961,7 @@ int $confname(int a) {
}
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
AC_LANG_PUSH([Fortran 77])
AC_LANG_CONFTEST([
@@ -1089,7 +1089,7 @@ dnl Use F77 as a linker to compile a Fortran main and C subprogram.
if test "$pac_linkwithC" != "yes" ; then
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $saved_LIBS"
AC_LANG_PUSH([Fortran 77])
@@ -1110,7 +1110,7 @@ dnl Use C as a linker and FLIBS to compile a Fortran main and C subprogram.
if test "$pac_linkwithf77" != "yes" ; then
AC_LANG_PUSH([Fortran 77])
AC_COMPILE_IFELSE([],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_f77conftest.$OBJEXT $FLIBS $saved_LIBS"
AC_LANG_PUSH([C])
@@ -1277,7 +1277,7 @@ AC_COMPILE_IFELSE([
end
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
saved_LIBS="$LIBS"
# This test checks if Fortran init can be done in pure C environment,
# i.e. no FLIBS in linking, so don't put FLIBS in LIBS below
@@ -1368,7 +1368,7 @@ void ftest_( $pac_mpi_fint *itrue, $pac_mpi_fint *ifalse )
}
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $saved_LIBS"
AC_LANG_PUSH([Fortran 77])
diff --git a/confdb/aclocal_fc.m4 b/confdb/aclocal_fc.m4
index 716f085..02a5d5d 100644
--- a/confdb/aclocal_fc.m4
+++ b/confdb/aclocal_fc.m4
@@ -468,7 +468,7 @@ AC_COMPILE_IFELSE([
])
],[
# pac_f77compile_ok=yes
- AC_RUN_LOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_f77conftest.$OBJEXT])
# Save original LIBS, prepend previously generated object file to LIBS
saved_LIBS="$LIBS"
LIBS="pac_f77conftest.$OBJEXT $LIBS"
@@ -589,7 +589,7 @@ int $confname( int a )
])
],[
pac_compile_ok=yes
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
# Save LIBS and prepend object file to LIBS
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $LIBS"
@@ -678,7 +678,7 @@ if test "$pac_result" = "yes" ; then
end
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $LIBS"
@@ -778,7 +778,7 @@ AC_MSG_CHECKING([for Fortran 90 compiler vendor])
pac_cv_fc_vendor="unknown"
for arg in --version -V -v ; do
rm -f conftest.txt
- AC_RUN_LOG([$FC $arg </dev/null >conftest.txt 2>&1])
+ PAC_RUNLOG([$FC $arg </dev/null >conftest.txt 2>&1])
# Ignore the return code, because some compilers set the
# return code to zero on invalid arguments and some to
# non-zero on success (with no files to compile)
@@ -1027,7 +1027,7 @@ int cisize_(char *i1p, char *i2p)
}
])
],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
pac_ccompile_ok=yes
],[
pac_ccompile_ok=no
diff --git a/confdb/aclocal_make.m4 b/confdb/aclocal_make.m4
index 0f73e23..147e92e 100644
--- a/confdb/aclocal_make.m4
+++ b/confdb/aclocal_make.m4
@@ -148,6 +148,7 @@ dnl
dnl D*/
AC_DEFUN([PAC_PROG_MAKE_VPATH],[
AC_SUBST(VPATH)
+dnl AM_IGNORE(VPATH)
AC_CACHE_CHECK([for virtual path format],
pac_cv_prog_make_vpath,[
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
@@ -304,6 +305,7 @@ PAC_PROG_MAKE_INCLUDE
PAC_PROG_MAKE_ALLOWS_COMMENTS
PAC_PROG_MAKE_VPATH
AC_SUBST(SET_CFLAGS)
+dnl AM_IGNORE(SET_CFLAGS)
PAC_PROG_MAKE_SET_CFLAGS([SET_CFLAGS='CFLAGS='])
if test "$pac_cv_prog_make_echos_dir" = "no" ; then
AC_PROG_MAKE_SET
diff --git a/confdb/aclocal_runlog.m4 b/confdb/aclocal_runlog.m4
index ebab6ba..9b85db5 100644
--- a/confdb/aclocal_runlog.m4
+++ b/confdb/aclocal_runlog.m4
@@ -1,46 +1,252 @@
-dnl PAC_RUNLOG_IFELSE(COMMMAND,[ACTION-IF-RUN-OK],[ACTION-IF-RUN-FAIL])
-AC_DEFUN([PAC_RUNLOG_IFELSE],[AS_IF([AC_RUN_LOG([$1])],[$2],[$3])])
-
+dnl
+dnl PAC_RUN_LOG mimics _AC_RUN_LOG which is autoconf internal routine.
+dnl We also make sure PAC_RUN_LOG can be used in AS_IF, so the last
+dnl test command should have terminating ]), i.e. without newline before ]).
+dnl
+AC_DEFUN([PAC_RUNLOG],[
+{ AS_ECHO(["$as_me:$LINENO: $1"]) >&AS_MESSAGE_LOG_FD
+ (eval $1) 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ AS_ECHO(["$as_me:$LINENO: \$? = $ac_status"]) >&AS_MESSAGE_LOG_FD
+ test $ac_status = 0; }])
+dnl
+dnl PAC_COMMAND_IFELSE is written to replace AC_TRY_EVAL with added logging
+dnl to config.log, i.e. AC_TRY_EVAL does not log anything to config.log.
+dnl If autoconf provides AC_COMMAND_IFELSE or AC_EVAL_IFELSE,
+dnl AC_COMMAND_IFELSE dnl should be replaced by the official autoconf macros.
+dnl
+dnl PAC_COMMAND_IFELSE(COMMMAND,[ACTION-IF-RUN-OK],[ACTION-IF-RUN-FAIL])
+dnl
+AC_DEFUN([PAC_COMMAND_IFELSE],[
+dnl Should use _AC_DO_TOKENS but use AC_RUN_LOG instead
+dnl because _AC_XX is autoconf's undocumented macro.
+AS_IF([PAC_RUNLOG([$1])],[
+ $2
+],[
+ AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
+ m4_ifvaln([$3],[
+ (exit $ac_status)
+ $3
+ ])
+])
+])
+dnl
+dnl
+dnl
+AC_DEFUN([PAC_EVAL_IFELSE],[
+dnl Should use _AC_DO_TOKENS but use AC_RUN_LOG instead
+dnl because _AC_XX is autoconf's undocumented macro.
+AS_IF([PAC_RUNLOG([$$1])],[
+ $2
+],[
+ AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
+ m4_ifvaln([$3],[
+ (exit $ac_status)
+ $3
+ ])
+])
+])
+dnl
+dnl
+dnl
+AC_DEFUN([PAC_RUNLOG_IFELSE],[
+dnl pac_TESTLOG is the internal temporary logfile for this macro.
+pac_TESTLOG="pac_test.log"
+rm -f $pac_TESTLOG
+PAC_COMMAND_IFELSE([$1 > $pac_TESTLOG],[
+ ifelse([$2],[],[],[$2])
+],[
+ AS_ECHO(["*** $1 :"]) >&AS_MESSAGE_LOG_FD
+ cat $pac_TESTLOG >&AS_MESSAGE_LOG_FD
+ ifelse([$3],[],[],[$3])
+])
+rm -f $pac_TESTLOG
+])
+dnl
+dnl
+dnl
+dnl PAS_VAR_COPY - A portable layer that mimics AS_VAR_COPY when it is not
+dnl defined as in older autoconf, e.g. 2.63 and older.
+dnl This macro is absolutely necessary, because AS_VAR_GET in
+dnl some newer autoconf, e.g. 2.64, seems to be totally broken,
+dnl or behave very different from older autoconf, i.e. 2.63.
+dnl
+AC_DEFUN([PAS_VAR_COPY],[
+m4_ifdef([AS_VAR_COPY], [AS_VAR_COPY([$1],[$2])], [$1=AS_VAR_GET([$2])])
+])
+dnl
+dnl
+dnl
+dnl PAC_VAR_PUSHVAL(VARNAME, [LastSavedValue]))
+dnl
+dnl Save the content of the shell variable, VARNAME, onto a stack.
+dnl The saved value of VARNAME is restorable with respect to the nesting
+dnl of the macro.
+dnl
+dnl The Last saved value of VARNAME on the stack is stored in shell variable
+dnl pac_LastSavedValueOf_$VARNAME if the 2nd argument is NOT supplied.
+dnl If the 2nd argument is present, the last saved value will be stored
+dnl in the 2nd argument instead.
+dnl
+dnl The First saved value of VARNAME on the stack is stored in shell variable
+dnl dnl pac_FirstSavedValueOf_$VARNAME.
+dnl
+AC_DEFUN([PAC_VAR_PUSHVAL],[
+# START of PUSHVAL
+dnl define local m4-name pac_stk_level.
+AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level])
+AS_VAR_SET_IF([pac_stk_level],[
+ dnl autoconf < 2.64 does not have AS_VAR_ARITH, so use expr instead.
+ AS_VAR_SET([pac_stk_level], [`expr $pac_stk_level + 1`])
+],[
+ AS_VAR_SET([pac_stk_level], [0])
+])
+dnl AS_ECHO_N(["PUSHVAL: pac_stk_level = $pac_stk_level, "])
+dnl Save the content of VARNAME, i.e. $VARNAME, onto the stack.
+AS_VAR_SET([pac_stk_$1_$pac_stk_level],[$$1])
+AS_VAR_IF([pac_stk_level], [0], [
+ dnl Save the 1st pushed value of VARNAME as pac_FirstSavedValueOf_$VARNAME
+ PAS_VAR_COPY([pac_FirstSavedValueOf_$1],[pac_stk_$1_$pac_stk_level])
+])
+ifelse([$2],[],[
+ dnl Save the last pushed value of VARNAME as pac_LastSavedValueOf_$VARNAME
+ PAS_VAR_COPY([pac_LastSavedValueOf_$1],[pac_stk_$1_$pac_stk_level])
+ dnl AS_ECHO(["pac_LastSavedValueOf_$1 = $pac_LastSavedValueOf_$1"])
+],[
+ dnl Save the last pushed value of VARNAME as $2
+ PAS_VAR_COPY([$2],[pac_stk_$1_$pac_stk_level])
+ dnl AS_ECHO(["$2 = $$2"])
+])
+AS_VAR_POPDEF([pac_stk_level])
+# END of PUSHVAL
+])
+dnl
+dnl
+dnl
+dnl PAC_VAR_POPVAL(VARNAME)
+dnl
+dnl Restore variable, VARNAME, from the stack.
+dnl This macro is safe with respect to the nesting.
+dnl Some minimal checking of nesting balance of PAC_VAR_PUSH[POP]VAL()
+dnl is done here.
+dnl
+AC_DEFUN([PAC_VAR_POPVAL],[
+# START of POPVAL
+dnl define local m4-name pac_stk_level.
+AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level])
+AS_VAR_SET_IF([pac_stk_level],[
+ AS_VAR_IF([pac_stk_level],[-1],[
+ AC_MSG_WARN(["Imbalance of PUSHVAL/POPVAL of $1"])
+ ],[
+ dnl AS_ECHO_N(["POPVAL: pac_stk_level = $pac_stk_level, "])
+ PAS_VAR_COPY([$1],[pac_stk_$1_$pac_stk_level])
+ dnl AS_ECHO(["popped_val = $$1"])
+ dnl autoconf < 2.64 does not have AS_VAR_ARITH, so use expr instead.
+ AS_VAR_SET([pac_stk_level], [`expr $pac_stk_level - 1`])
+ ])
+],[
+ AC_MSG_WARN(["Uninitialized PUSHVAL/POPVAL of $1"])
+])
+AS_VAR_POPDEF([pac_stk_level])
+# END of POPVAL
+])
+dnl
+dnl
+dnl
dnl PAC_COMPILE_IFELSE_LOG is a wrapper around AC_COMPILE_IFELSE with the
dnl output of ac_compile to a specified logfile instead of AS_MESSAGE_LOG_FD
dnl
dnl PAC_COMPILE_IFELSE_LOG(logfilename, input,
dnl [action-if-true], [action-if-false])
dnl
+dnl where input, [action-if-true] and [action-if-false] are used
+dnl in AC_COMPILE_IFELSE(input, [action-if-true], [action-if-false]).
+dnl This macro is nesting safe.
+dnl
AC_DEFUN([PAC_COMPILE_IFELSE_LOG],[
-PAC_PUSH_FLAG([ac_compile])
-ac_compile="`echo $ac_compile | sed -e 's|>.*$|> $1 2>\&1|g'`"
-AC_COMPILE_IFELSE([$2],[$3],[$4])
-PAC_POP_FLAG([ac_compile])
+dnl
+dnl Instead of defining our own ac_compile and do AC_TRY_EVAL
+dnl on these variables. We modify ac_compile used by AC_*_IFELSE
+dnl by piping the output of the command to a logfile. The reason is that
+dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_compile
+dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in
+dnl these commands, i.e. deviate from how GNU standard uses these variables.
+dnl
+dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_compile.
+dnl Save a copy of ac_compile on a stack
+dnl which is safe through nested invocations of this macro.
+PAC_VAR_PUSHVAL([ac_compile])
+dnl Modify ac_compile based on the unmodified ac_compile.
+ac_compile="`echo $pac_FirstSavedValueOf_ac_compile | sed -e 's|>.*$|> $1 2>\&1|g'`"
+AC_COMPILE_IFELSE([$2],[
+ ifelse([$3],[],[:],[$3])
+],[
+ ifelse([$4],[],[:],[$4])
+])
+dnl Restore the original ac_compile from the stack.
+PAC_VAR_POPVAL([ac_compile])
])
-
+dnl
+dnl
+dnl
dnl PAC_LINK_IFELSE_LOG is a wrapper around AC_LINK_IFELSE with the
dnl output of ac_link to a specified logfile instead of AS_MESSAGE_LOG_FD
dnl
dnl PAC_LINK_IFELSE_LOG(logfilename, input,
dnl [action-if-true], [action-if-false])
dnl
+dnl where input, [action-if-true] and [action-if-false] are used
+dnl in AC_LINK_IFELSE(input, [action-if-true], [action-if-false]).
+dnl This macro is nesting safe.
+dnl
AC_DEFUN([PAC_LINK_IFELSE_LOG],[
-PAC_PUSH_FLAG([ac_link])
-ac_link="`echo $ac_link | sed -e 's|>.*$|> $1 2>\&1|g'`"
-AC_LINK_IFELSE([$2],[$3],[$4])
-PAC_POP_FLAG([ac_link])
+dnl
+dnl Instead of defining our own ac_link and do AC_TRY_EVAL
+dnl on these variables. We modify ac_link used by AC_*_IFELSE
+dnl by piping the output of the command to a logfile. The reason is that
+dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_link
+dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in
+dnl these commands, i.e. deviate from how GNU standard uses these variables.
+dnl
+dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_link.
+dnl Save a copy of ac_link on a stack
+dnl which is safe through nested invocations of this macro.
+PAC_VAR_PUSHVAL([ac_link])
+dnl Modify ac_link based on the unmodified ac_link.
+ac_link="`echo $pac_FirstSavedValueOf_ac_link | sed -e 's|>.*$|> $1 2>\&1|g'`"
+dnl
+AC_LINK_IFELSE([$2],[
+ ifelse([$3],[],[:],[$3])
+],[
+ ifelse([$4],[],[:],[$4])
])
-
+dnl Restore the original ac_link from the stack.
+PAC_VAR_POPVAL([ac_link])
+])
+dnl
+dnl
+dnl
dnl PAC_COMPLINK_IFELSE (input1, input2, [action-if-true], [action-if-false])
dnl
dnl where input1 and input2 are either AC_LANG_SOURCE or AC_LANG_PROGRAM
dnl enclosed input programs.
dnl
dnl The macro first compiles input1 and uses the object file created
-dnl as part of LIBS during linking.
+dnl as part of LIBS during linking. This macro is nesting safe.
dnl
AC_DEFUN([PAC_COMPLINK_IFELSE],[
AC_COMPILE_IFELSE([$1],[
- AC_RUN_LOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
- PAC_PUSH_FLAG([LIBS])
- LIBS="pac_conftest.$OBJEXT $LIBS"
- AC_LINK_IFELSE([$2],[$3],[$4])
- PAC_POP_FLAG([LIBS])
- rm -f pac_conftest.$OBJEXT]),[$4]
+ PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
+ PAC_VAR_PUSHVAL([LIBS])
+ LIBS="pac_conftest.$OBJEXT $pac_FirstSavedValueOf_LIBS"
+ AC_LINK_IFELSE([$2],[
+ ifelse([$3],[],[:],[$3])
+ ],[
+ ifelse([$4],[],[:],[$4])
+ ])
+ PAC_VAR_POPVAL([LIBS])
+ rm -f pac_conftest.$OBJEXT
+],[
+ ifelse([$4],[],[:],[$4])
+])
])
-----------------------------------------------------------------------
Summary of changes:
confdb/aclocal.m4 | 5 +
confdb/aclocal_attr_alias.m4 | 8 +-
confdb/aclocal_cc.m4 | 2 +-
confdb/aclocal_cxx.m4 | 2 +-
confdb/aclocal_f77.m4 | 38 +++---
confdb/aclocal_fc.m4 | 10 +-
confdb/aclocal_make.m4 | 2 +
confdb/aclocal_runlog.m4 | 246 +++++++++++++++++++++++++++---
src/pm/hydra/include/hydra.h | 51 ++-----
src/pm/hydra/pm/pmiserv/pmip_pmi_v1.c | 166 +++++++++++---------
src/pm/hydra/pm/pmiserv/pmip_pmi_v2.c | 198 +++++++++++++-----------
src/pm/hydra/pm/pmiserv/pmiserv_pmi_v1.c | 90 ++++++-----
src/pm/hydra/pm/pmiserv/pmiserv_pmi_v2.c | 237 ++++++++++++++++-------------
src/pm/hydra/pm/pmiserv/pmiserv_utils.c | 51 ++++---
14 files changed, 685 insertions(+), 421 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list