[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-26-gff16f6f
Service Account
noreply at mpich.org
Tue Mar 4 16:56:40 CST 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 ff16f6f65cc4b92b37947bc3755f8bf129163f85 (commit)
via 974d50299cbcf2fd909d6b9a5d7d13f2a3c0a9c3 (commit)
from c73c33196510911bd99ffbadcf04d1290e651d4d (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/ff16f6f65cc4b92b37947bc3755f8bf129163f85
commit ff16f6f65cc4b92b37947bc3755f8bf129163f85
Author: Bob Cernohous <bobc at us.ibm.com>
Date: Tue Oct 15 10:39:32 2013 -0500
Free the builtin communicators (world/self/iworld)
Also, do not reserve the internal-only copy of comm world context id when
it isn't being used (MPID_NEEDS_ICOMM_WORLD)
See mpich.org ticket #1947
closes #1947
(ibm) 984acc33d6c8149987016b62da5afb36450be94e
Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
Signed-off-by: Rob Latham <robl at mcs.anl.gov>
diff --git a/src/mpid/pamid/src/mpid_finalize.c b/src/mpid/pamid/src/mpid_finalize.c
index 82da86f..10d8dce 100644
--- a/src/mpid/pamid/src/mpid_finalize.c
+++ b/src/mpid/pamid/src/mpid_finalize.c
@@ -99,6 +99,13 @@ int MPID_Finalize()
PAMIX_Finalize(MPIDI_Client);
+#ifdef MPID_NEEDS_ICOMM_WORLD
+ MPIR_Comm_release_always(MPIR_Process.icomm_world, 0);
+#endif
+
+ MPIR_Comm_release_always(MPIR_Process.comm_self,0);
+ MPIR_Comm_release_always(MPIR_Process.comm_world,0);
+
rc = PAMI_Context_destroyv(MPIDI_Context, MPIDI_Process.avail_contexts);
MPID_assert_always(rc == PAMI_SUCCESS);
http://git.mpich.org/mpich.git/commitdiff/974d50299cbcf2fd909d6b9a5d7d13f2a3c0a9c3
commit 974d50299cbcf2fd909d6b9a5d7d13f2a3c0a9c3
Author: Haizhu Liu <haizhu at us.ibm.com>
Date: Fri Oct 11 10:48:18 2013 -0400
Fix Memory leak due to dynamic task change
Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
Signed-off-by: Rob Latham <robl at mcs.anl.gov>
diff --git a/src/mpid/pamid/src/dyntask/mpidi_pg.c b/src/mpid/pamid/src/dyntask/mpidi_pg.c
index f59890d..7d59b3a 100644
--- a/src/mpid/pamid/src/dyntask/mpidi_pg.c
+++ b/src/mpid/pamid/src/dyntask/mpidi_pg.c
@@ -204,11 +204,11 @@ int MPIDI_PG_Finalize(void)
fails to use MPI_Comm_disconnect on communicators that
were created with the dynamic process routines.*/
/* XXX DJG FIXME-MT should we be checking this? */
- if (MPIU_Object_get_ref(pg) == 0 || 1) {
+ if (MPIU_Object_get_ref(pg) == 0 ) {
if (pg == MPIDI_Process.my_pg)
MPIDI_Process.my_pg = NULL;
- MPIU_Object_set_ref(pg, 0); /* satisfy assertions in PG_Destroy */
- MPIDI_PG_Destroy( pg );
+ MPIU_Object_set_ref(pg, 0); /* satisfy assertions in PG_Destroy */
+ MPIDI_PG_Destroy( pg );
}
pg = pgNext;
}
@@ -218,10 +218,9 @@ int MPIDI_PG_Finalize(void)
point is that comm_world (and comm_self) still exist, and
hence the usual process to free the related VC structures will
not be invoked. */
- if (MPIDI_Process.my_pg) {
- MPIDI_PG_Destroy(MPIDI_Process.my_pg);
- }
- MPIDI_Process.my_pg = NULL;
+
+ /* The process group associated with MPI_COMM_WORLD will be
+ freed when MPI_COMM_WORLD is freed */
return mpi_errno;
}
diff --git a/src/mpid/pamid/src/dyntask/mpidi_port.c b/src/mpid/pamid/src/dyntask/mpidi_port.c
index fcdbee1..2488ed6 100644
--- a/src/mpid/pamid/src/dyntask/mpidi_port.c
+++ b/src/mpid/pamid/src/dyntask/mpidi_port.c
@@ -693,10 +693,6 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
}
TRACE_ERR("connect:free new vc\n");
- /* Free new_vc. It was explicitly allocated in MPIDI_Connect_to_root.*/
- if (rank == root) {
- MPIU_Free( new_vc);
- }
fn_exit:
if(local_translation) MPIU_Free(local_translation);
@@ -1350,11 +1346,6 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
TRACE_ERR("MPIR_Barrier_intra returned with mpi_errno=%d\n", mpi_errno);
}
- /* Free new_vc once the connection is completed. */
- if (rank == root) {
- MPIU_Free( new_vc );
- }
-
fn_exit:
if(local_translation) MPIU_Free(local_translation);
return mpi_errno;
diff --git a/src/mpid/pamid/src/mpid_init.c b/src/mpid/pamid/src/mpid_init.c
index 5a63d44..6abb609 100644
--- a/src/mpid/pamid/src/mpid_init.c
+++ b/src/mpid/pamid/src/mpid_init.c
@@ -1246,9 +1246,6 @@ int MPID_Init(int * argc,
* for getting the business card
*/
MPIDI_Process.my_pg_rank = pg_rank;
- /* FIXME: Why do we add a ref to pg here? */
- TRACE_ERR("Adding ref pg=%x\n", pg);
- MPIDI_PG_add_ref(pg);
}
#endif
diff --git a/src/mpid/pamid/src/mpid_vc.c b/src/mpid/pamid/src/mpid_vc.c
index a49f3a8..7a22133 100644
--- a/src/mpid/pamid/src/mpid_vc.c
+++ b/src/mpid/pamid/src/mpid_vc.c
@@ -34,7 +34,7 @@ struct MPIDI_VCRT
{
MPIU_OBJECT_HEADER;
unsigned size; /**< Number of entries in the table */
- MPID_VCR vcr_table[0]; /**< Array of virtual connection references */
+ MPID_VCR *vcr_table; /**< Array of virtual connection references */
};
@@ -48,7 +48,11 @@ int MPID_VCR_Dup(MPID_VCR orig_vcr, MPID_VCR * new_vcr)
}
#endif
- *new_vcr = orig_vcr;
+ (*new_vcr)->taskid = orig_vcr->taskid;
+#ifdef DYNAMIC_TASKING
+ (*new_vcr)->pg_rank = orig_vcr->pg_rank;
+ (*new_vcr)->pg = orig_vcr->pg;
+#endif
return MPI_SUCCESS;
}
@@ -63,9 +67,12 @@ int MPID_VCRT_Create(int size, MPID_VCRT *vcrt_ptr)
struct MPIDI_VCRT * vcrt;
int i,result;
- vcrt = MPIU_Malloc(sizeof(struct MPIDI_VCRT) + size*sizeof(MPID_VCR));
- for(i = 0; i < size; i++)
+ vcrt = MPIU_Malloc(sizeof(struct MPIDI_VCRT));
+ vcrt->vcr_table = MPIU_Malloc(size*sizeof(MPID_VCR));
+
+ for(i = 0; i < size; i++) {
vcrt->vcr_table[i] = MPIU_Malloc(sizeof(struct MPID_VCR_t));
+ }
if (vcrt != NULL)
{
MPIU_Object_set_ref(vcrt, 1);
@@ -98,17 +105,17 @@ int MPID_VCRT_Release(MPID_VCRT vcrt, int isDisconnect)
for (i = 0; i < vcrt->size; i++)
{
MPID_VCR const vcr = vcrt->vcr_table[i];
+
if (vcr->pg == MPIDI_Process.my_pg &&
vcr->pg_rank == MPIDI_Process.my_pg_rank)
{
TRACE_ERR("before MPIDI_PG_release_ref on vcr=%x pg=%x pg=%s inuse=%d\n", vcr, vcr->pg, (vcr->pg)->id, inuse);
inuse=MPIU_Object_get_ref(vcr->pg);
- TRACE_ERR("before MPIDI_PG_release_ref on vcr=%x pg=%x pg=%s inuse=%d\n", vcr, vcr->pg, (vcr->pg)->id, inuse);
MPIDI_PG_release_ref(vcr->pg, &inuse);
- TRACE_ERR("MPIDI_PG_release_ref on pg=%s inuse=%d\n", (vcr->pg)->id, inuse);
if (inuse == 0)
{
MPIDI_PG_Destroy(vcr->pg);
+ MPIU_Free(vcr);
}
continue;
}
@@ -117,11 +124,21 @@ int MPID_VCRT_Release(MPID_VCRT vcrt, int isDisconnect)
MPIDI_PG_release_ref(vcr->pg, &inuse);
if (inuse == 0)
MPIDI_PG_Destroy(vcr->pg);
- /*MPIU_Free(vcrt->vcr_table[i]);*/
+ if(vcr) MPIU_Free(vcr);
}
+ MPIU_Free(vcrt->vcr_table);
} /** CHECK */
+ else {
+ for (i = 0; i < vcrt->size; i++)
+ MPIU_Free(vcrt->vcr_table[i]);
+ MPIU_Free(vcrt->vcr_table);vcrt->vcr_table=NULL;
+ }
+#else
+ for (i = 0; i < vcrt->size; i++)
+ MPIU_Free(vcrt->vcr_table[i]);
+ MPIU_Free(vcrt->vcr_table);vcrt->vcr_table=NULL;
#endif
- MPIU_Free(vcrt);
+ MPIU_Free(vcrt);vcrt=NULL;
}
return MPI_SUCCESS;
}
-----------------------------------------------------------------------
Summary of changes:
src/mpid/pamid/src/dyntask/mpidi_pg.c | 13 +++++------
src/mpid/pamid/src/dyntask/mpidi_port.c | 9 --------
src/mpid/pamid/src/mpid_finalize.c | 7 ++++++
src/mpid/pamid/src/mpid_init.c | 3 --
src/mpid/pamid/src/mpid_vc.c | 33 +++++++++++++++++++++++-------
5 files changed, 38 insertions(+), 27 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list