[petsc-dev] Failure converting MPIBAIJ -> MPIAIJ
Lisandro Dalcin
dalcinl at gmail.com
Sun Sep 18 17:19:35 CDT 2011
(using release-3.2 branch)
Look the code below, it creates a matrix and explicitly set the type
to MPIBAIJ. The last line asks for converting the matrix to 'AIJ'
inplace (this uses MAT_REUSE_MATRIX and pass the same Mat handler as
the last arg to MatConvert()). I also tried to replace the convert
line with B = PETSc.Mat(); A.convert('aij', B), which would use
MAT_INITIAL_MATRIX, but the behavior is exactly the same .
[dalcinl at trantor petsc4py-dev]$ cat test-mat-baij.py
from petsc4py import PETSc
A = PETSc.Mat().create()
A.setSizes([32,32], bsize=2)
A.setType('mpibaij')
a, b = A.getOwnershipRange()
for i in range(a,b):
A[i,i] = 1
A.assemble()
A.convert('aij')
print 'OK'
The code runs fine in more than one process, see yourself:
[dalcinl at trantor petsc4py-dev]$ mpiexec -n 3 python test-mat-baij.py
OK
OK
OK
[dalcinl at trantor petsc4py-dev]$ mpiexec -n 2 python test-mat-baij.py
OK
OK
However, it fails with a corruption error when using one process.
[dalcinl at trantor petsc4py-dev]$ mpiexec -n 1 python test-mat-baij.py
Traceback (most recent call last):
File "test-mat-baij.py", line 11, in <module>
A.convert('aij')
File "Mat.pyx", line 481, in petsc4py.PETSc.Mat.convert
(src/petsc4py.PETSc.c:75853)
petsc4py.PETSc.Error: error code 64
[0] MatConvert() line 3847 in /home/devel/petsc/3.2/src/mat/interface/matrix.c
[0] MatConvert_MPIBAIJ_MPIAIJ() line 3161 in
/home/devel/petsc/3.2/src/mat/impls/baij/mpi/mpibaij.c
[0] MatDestroy() line 1028 in /home/devel/petsc/3.2/src/mat/interface/matrix.c
[0] Corrupt argument: see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#valgrind
[0] Invalid Pointer to Object: Parameter # 1
--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
More information about the petsc-dev
mailing list