[petsc-users] Memory leak when destroying an IS created using ISConcatenate
Michael Souza
souza.michael at gmail.com
Tue Dec 16 13:02:12 CST 2014
There is a memory leak when destroying an IS object created with
ISConcatenate function.
The leak can be reproduced with code below.
Cheers,
Michael Souza
------------------------------------------------------------------
static char help[] = "Memory leak in ISConcatenate function\n\n";
#include <petscksp.h>
#include "matblock.h"
int main(int argc, char **args) {
PetscErrorCode ierr;
IS isa, isb, isc;
ierr = PetscInitialize(&argc, &args, (char *) 0, help); CHKERRQ(ierr);
ierr = ISCreateStride(PETSC_COMM_WORLD,2,0,1,&isa); CHKERRQ(ierr);
ierr = ISCreateStride(PETSC_COMM_WORLD,2,2,1,&isb); CHKERRQ(ierr);
IS isarray[] = {isa, isb};
ierr = ISConcatenate(PETSC_COMM_WORLD,2,isarray,&isc); CHKERRQ(ierr);
ierr = ISDestroy(&isa); CHKERRQ(ierr);
ierr = ISDestroy(&isb); CHKERRQ(ierr);
ierr = ISDestroy(&isc); CHKERRQ(ierr);
ierr = PetscFinalize(); CHKERRQ(ierr);
PetscFunctionReturn(0);
}
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141216/fe2f26cd/attachment.html>
More information about the petsc-users
mailing list