From 3d72ccf1f4cf9f9054e1bfd655a71073a79fcbc6 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Sun, 15 Dec 2013 18:16:38 +0000 Subject: [PATCH] Don't reset the convertor to the default size and buffer as it should be already set to the right value. This fixes a problem identified by Guillaume Gouaillardet, where using a single persistent receive leads to leaking the convertor stack memory. Refs trac:3956 cmr=v1.7.4:reviewer=jsquyres:subject=Correctly handle the convertor internal stack for persistent receives. This commit was SVN r29920. The following Trac tickets were found above: Ticket 3956 --> https://svn.open-mpi.org/trac/ompi/ticket/3956 --- opal/datatype/opal_convertor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opal/datatype/opal_convertor.c b/opal/datatype/opal_convertor.c index 04a08b119b..c4a35eb361 100644 --- a/opal/datatype/opal_convertor.c +++ b/opal/datatype/opal_convertor.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2010 The University of Tennessee and The University + * Copyright (c) 2004-2013 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -12,6 +12,8 @@ * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2013 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -535,12 +537,10 @@ int32_t opal_convertor_set_position_nocheck( opal_convertor_t* convertor, uint32_t required_stack_length = datatype->btypes[OPAL_DATATYPE_LOOP] + 1; \ \ if( required_stack_length > convertor->stack_size ) { \ + assert(convertor->pStack == convertor->static_stack); \ convertor->stack_size = required_stack_length; \ convertor->pStack = (dt_stack_t*)malloc(sizeof(dt_stack_t) * \ convertor->stack_size ); \ - } else { \ - convertor->pStack = convertor->static_stack; \ - convertor->stack_size = DT_STATIC_STACK_SIZE; \ } \ } \ opal_convertor_create_stack_at_begining( convertor, opal_datatype_local_sizes ); \