Commit 8afce346 authored by Igor Ivanov's avatar Igor Ivanov Committed by Pavan Balaji
Browse files

mpid: Fix REQUEST memory leak for Irsend



Memory leak can appear in case netmod usage. Comm override functions
are responsible for creating its own request. So they  need to come
before the sreq is created.
Signed-off-by: default avatarIgor Ivanov <Igor.Ivanov@itseez.com>
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent cc4b0952
......@@ -50,6 +50,19 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
mpi_errno = MPIDI_Isend_self(buf, count, datatype, rank, tag, comm, context_offset, MPIDI_REQUEST_TYPE_RSEND, &sreq);
goto fn_exit;
}
if (rank != MPI_PROC_NULL) {
MPIDI_Comm_get_vc_set_active(comm, rank, &vc);
#ifdef ENABLE_COMM_OVERRIDES
/* this needs to come before the sreq is created, since the override
* function is responsible for creating its own request */
if (vc->comm_ops && vc->comm_ops->irsend)
{
mpi_errno = vc->comm_ops->irsend( vc, buf, count, datatype, rank, tag, comm, context_offset, &sreq);
goto fn_exit;
}
#endif
}
MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_RSEND);
......@@ -62,16 +75,6 @@ int MPID_Irsend(const void * buf, int count, MPI_Datatype datatype, int rank, in
goto fn_exit;
}
MPIDI_Comm_get_vc_set_active(comm, rank, &vc);
#ifdef ENABLE_COMM_OVERRIDES
if (vc->comm_ops && vc->comm_ops->irsend)
{
mpi_errno = vc->comm_ops->irsend( vc, buf, count, datatype, rank, tag, comm, context_offset, &sreq);
goto fn_exit;
}
#endif
MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
MPIDI_Pkt_init(ready_pkt, MPIDI_CH3_PKT_READY_SEND);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment