[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-74-ga4b73a8
Service Account
noreply at mpich.org
Wed Mar 26 10:39:18 CDT 2014
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 a4b73a8e9260a46ac258e2172e3cd2fe3dad2bad (commit)
from 5108fe176d1a10c57ac703dd1acbedcb47d6c937 (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/a4b73a8e9260a46ac258e2172e3cd2fe3dad2bad
commit a4b73a8e9260a46ac258e2172e3cd2fe3dad2bad
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date: Wed Mar 19 12:49:37 2014 -0500
avoid duplicate data in MPIR_proctable
De-dupes executable and host names in the MPIR_proctable by pointing
to an existing copy. Closes #1821
Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>
diff --git a/src/pm/hydra/tools/debugger/debugger.c b/src/pm/hydra/tools/debugger/debugger.c
index c88bb14..39ce83a 100644
--- a/src/pm/hydra/tools/debugger/debugger.c
+++ b/src/pm/hydra/tools/debugger/debugger.c
@@ -57,13 +57,23 @@ HYD_status HYDT_dbg_setup_procdesc(struct HYD_pg * pg)
break;
if (k + np < round * proxy->node->core_count)
continue;
- MPIR_proctable[i].host_name = HYDU_strdup(proxy->node->hostname);
+ /* avoid storing multiple copies of the host name */
+ if (i > 0 && strcmp(MPIR_proctable[i - 1].host_name, proxy->node->hostname) == 0)
+ MPIR_proctable[i].host_name = MPIR_proctable[i - 1].host_name;
+ else
+ MPIR_proctable[i].host_name = HYDU_strdup(proxy->node->hostname);
MPIR_proctable[i].pid = proxy->pid[(proxy->node->core_count * round) + j];
j++;
- if (exec->exec[0])
- MPIR_proctable[i].executable_name = HYDU_strdup(exec->exec[0]);
- else
+ if (exec->exec[0]) {
+ /* avoid storing multiple copies of the executable name */
+ if (i > 0 && strcmp(exec->exec[0], MPIR_proctable[i - 1].executable_name) == 0)
+ MPIR_proctable[i].executable_name = MPIR_proctable[i - 1].executable_name;
+ else
+ MPIR_proctable[i].executable_name = HYDU_strdup(exec->exec[0]);
+ }
+ else {
MPIR_proctable[i].executable_name = NULL;
+ }
i++;
}
k += exec->proc_count;
@@ -90,10 +100,16 @@ void HYDT_dbg_free_procdesc(void)
int i;
for (i = 0; i < MPIR_proctable_size; i++) {
- if (MPIR_proctable[i].host_name)
- HYDU_FREE(MPIR_proctable[i].host_name);
- if (MPIR_proctable[i].executable_name)
- HYDU_FREE(MPIR_proctable[i].executable_name);
+ /* skip over duplicate pointers when freeing */
+ if (MPIR_proctable[i].host_name) {
+ if (i == 0 || MPIR_proctable[i].host_name != MPIR_proctable[i - 1].host_name)
+ HYDU_FREE(MPIR_proctable[i].host_name);
+ }
+ if (MPIR_proctable[i].executable_name) {
+ if (i == 0 ||
+ MPIR_proctable[i].executable_name != MPIR_proctable[i - 1].executable_name)
+ HYDU_FREE(MPIR_proctable[i].executable_name);
+ }
}
HYDU_FREE(MPIR_proctable);
}
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/tools/debugger/debugger.c | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list