<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Jose<div class=""><br class=""></div><div class="">I have just pushed an updated example with the MatMat operation, and I do not see the memory leak. Can you check?</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #2fb41d" class=""><b class="">zampins@jasmine</b></span><span style="font-variant-ligatures: no-common-ligatures" class="">:</span><span style="font-variant-ligatures: no-common-ligatures; color: #400bd9" class=""><b class="">~/petsc</b></span><span style="font-variant-ligatures: no-common-ligatures" class="">$ make -f gmakefile.test test search='mat%' searchin='ex69' PETSC_OPTIONS='-malloc -malloc_dump -malloc_debug' </span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/usr/bin/python /home/zampins/petsc/config/gmakegentest.py --petsc-dir=/home/zampins/petsc --petsc-arch=arch-gpu-double-openmp-openblas --testdir=./arch-gpu-double-openmp-openblas/tests</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Using MAKEFLAGS: -- PETSC_OPTIONS=-malloc -malloc_dump -malloc_debug searchin=ex69 search=mat%</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">          CC arch-gpu-double-openmp-openblas/tests/mat/tests/ex69.o</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">     CLINKER arch-gpu-double-openmp-openblas/tests/mat/tests/ex69</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">        TEST arch-gpu-double-openmp-openblas/tests/counts/mat_tests-ex69_1.counts</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-0_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-0_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-0_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-0_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-0_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-0_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-0_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-0_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-1_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-1_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-1_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-1_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-1_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-1_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-1_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-1_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-2_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-2_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-2_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-2_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-2_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-2_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-1test-2_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-1test-2_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-0_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-0_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-0_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-0_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-0_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-0_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-0_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-0_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-1_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-1_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-1_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-1_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-1_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-1_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-1_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-1_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-2_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-2_l-0_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-2_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-2_l-0_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-2_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-2_l-5_use_shell-0</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok mat_tests-ex69_1+nsize-2test-2_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ok diff-mat_tests-ex69_1+nsize-2test-2_l-5_use_shell-1</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo; min-height: 8px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># -------------</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#   Summary    </span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># -------------</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># success 48/48 tests (100.0%)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># failed 0/48 tests (0.0%)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># todo 0/48 tests (0.0%)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># skip 0/48 tests (0.0%)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># Wall clock time for tests: 58 sec</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># Approximate CPU time (not incl. build time): 62.11 sec</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#</span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># Timing summary (actual test time / total CPU time): </span></div><div style="margin: 0px; font-stretch: normal; font-size: 7px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#   mat_tests-ex69_1: 2.30 sec / 62.11 sec</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div><blockquote type="cite" class=""><div class="">On May 9, 2020, at 9:28 PM, Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" class="">jroman@dsic.upv.es</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">El 9 may 2020, a las 20:00, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> escribió:<br class=""><br class=""><br class=""><br class="">Il giorno sab 9 mag 2020 alle ore 19:43 Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" class="">jroman@dsic.upv.es</a>> ha scritto:<br class=""><br class=""><br class=""><blockquote type="cite" class="">El 9 may 2020, a las 12:45, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> escribió:<br class=""><br class="">Jose<br class=""><br class="">I have just pushed a test <a href="https://gitlab.com/petsc/petsc/-/blob/d64c2bc63c8d5d1a8c689f1abc762ae2722bba26/src/mat/tests/ex69.c" class="">https://gitlab.com/petsc/petsc/-/blob/d64c2bc63c8d5d1a8c689f1abc762ae2722bba26/src/mat/tests/ex69.c</a><br class="">See if it fits your framework, and feel free to modify the test to add more checks<br class=""></blockquote><br class="">Almost good. The following modification of the example fails with -test 1:<br class=""><br class=""><br class="">diff --git a/src/mat/tests/ex69.c b/src/mat/tests/ex69.c<br class="">index e562f1e2e3..2df2c89be1 100644<br class="">--- a/src/mat/tests/ex69.c<br class="">+++ b/src/mat/tests/ex69.c<br class="">@@ -84,6 +84,10 @@ int main(int argc,char **argv)<br class="">  }<br class="">  ierr = VecCUDARestoreArray(v,&vv);CHKERRQ(ierr);<br class=""><br class="">+  if (test==1) {<br class="">+    ierr = MatDenseCUDAGetArray(B,&aa);CHKERRQ(ierr);<br class="">+    if (aa) SETERRQ(PETSC_COMM_WORLD,PETSC_ERR_USER,"Expected a null pointer");<br class="">+  }<br class=""><br class="">  /* free work space */<br class="">  ierr = MatDestroy(&B);CHKERRQ(ierr);<br class=""><br class=""><br class=""><br class="">I would expect that after MatDenseCUDAResetArray() the pointer is NULL because it was set so in line 60. In the CPU counterpart it works as expected.<br class=""><br class="">Pushed a fix for this, thanks.<br class=""><br class="">Another comment is: in line 60 you have changed MatDenseCUDAPlaceArray() to MatDenseCUDAReplaceArray(). This is ok, but it is strange because MatDenseReplaceArray() does not exist. So the interface is different in GPU vs CPU, but I guess it is necessary here.<br class=""><br class="">I think we do not support calling PlaceArray twice anywhere PETSc. This is why I have added MatDenseCUDAReplaceArray(). If you need support for the CPU case too, I can add it.<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Yes, please. It is better to have the same thing in both cases.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I am attaching the modified example, now performs a mat-mat product. If I do A*B it works well, but if I replace A with a shell matrix I get a memory leak.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">[ 0]32 bytes VecCUDAAllocateCheck() line 34 in /home/users/proy/copa/jroman/soft/petsc/src/vec/vec/impls/seq/seqcuda/veccuda2.cu</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">[ 0]32 bytes VecCUDAAllocateCheck() line 34 in /home/users/proy/copa/jroman/soft/petsc/src/vec/vec/impls/seq/seqcuda/veccuda2.cu</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">Thanks.<br class="">Jose<br class=""><br class=""><br class=""><blockquote type="cite" class=""><br class=""><br class="">Il giorno ven 8 mag 2020 alle ore 18:48 Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" class="">jroman@dsic.upv.es</a>> ha scritto:<br class="">Attached. Run with -test 1 or -test 2<br class=""><br class=""><blockquote type="cite" class="">El 8 may 2020, a las 17:14, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> escribió:<br class=""><br class="">Jose<br class=""><br class="">Just send me a MWE and I’ll fix the case for you<br class=""><br class="">Thanks<br class="">Stefano<br class=""></blockquote><br class=""><br class="">--<span class="Apple-converted-space"> </span><br class="">Stefano<br class=""></blockquote><br class=""><br class=""><br class="">--<span class="Apple-converted-space"> </span><br class="">Stefano<br class=""></blockquote><span id="cid:119F5E22-A464-4104-AB31-3CEC6FED8549@kaust.edu.sa"><ex69.c></span></div></blockquote></div><br class=""></div></body></html>