problems with MatLoad
Andreas Grassl
Andreas.Grassl at student.uibk.ac.at
Wed Apr 8 11:12:15 CDT 2009
Hello,
I got some success on the localtoglobalmapping, but now I'm stuck with writing
to/reading from files. In a sequential code I write out some matrices with
PetscViewerBinaryOpen(comms,matrixname,FILE_MODE_WRITE,&viewer);
for (k=0;k<np;k++){
MatView(AS[k],viewer);}
PetscViewerDestroy(viewer);
and want to read them in in a parallel program, where each processor should own
one matrix:
ierr =
PetscViewerBinaryOpen(PETSC_COMM_WORLD,matrixname,FILE_MODE_READ,&viewer);
CHKERRQ(ierr);
ierr = MatLoad(viewer,MATSEQAIJ,&AS[rank]);CHKERRQ(ierr);
ierr = MatAssemblyBegin(AS[rank], MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
ierr = MatAssemblyEnd(AS[rank], MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
ierr = PetscViewerDestroy(viewer);CHKERRQ(ierr);
The program is hanging in the line with MatLoad and giving following output on
every node:
[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Argument out of range!
[0]PETSC ERROR: Comm must be of size 1!
I tried to sequentialize with PetscSequentialPhaseBegin(PETSC_COMM_WORLD,1) and
performing the file read with a loop.
Any suggestions what could go wrong?
thank you
ando
--
/"\ Grassl Andreas
\ / ASCII Ribbon Campaign Uni Innsbruck Institut f. Mathematik
X against HTML email Technikerstr. 13 Zi 709
/ \ +43 (0)512 507 6091
More information about the petsc-users
mailing list