dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #05902
Comparing PETSc MPIAIJ and SeqAIJ assembled matrix
Hi
I'm working on parallel assembly and need to check if the results are
equal to results from sequential assembly.
From src/sandbox/pmesh/main.cpp:
Regular assembly:
Matrix A;
Assembler assembler(m);
assembler.assemble(A, a, true);
Parallel assembly:
Matrix B;
pAssembler passembler(mesh, partitions);
passembler.assemble(B, a, true);
B.rename("B", "Parallel matrix B");
The sequential assembly uses the PETSc function MatCreateSeqAIJ to create
the matrix. Parallel assembly uses PETSc MatCreateMPIAIJ to create the
matrix. In order to compare the matrices I tried writing them to file:
//Saving sequential matrix
File file_a("matA.m");
file_a << A;
//Saving parallel matrix
File file_b(appendRank("matB", "m"));
file_b << B;
Saving the matrix B results in PETSc error:
[1]PETSC ERROR: --------------------- Error Message
------------------------------------
[1]PETSC ERROR: Argument out of range!
[1]PETSC ERROR: Only local rows!
I guess this is because each processor has a part of the matrix. Is there
a way to "merge" the local matrices?
- Magnus