problems with MatLoad
Andreas Grassl
Andreas.Grassl at student.uibk.ac.at
Wed Apr 15 09:11:39 CDT 2009
Matthew Knepley schrieb:
> On Wed, Apr 8, 2009 at 11:12 AM, Andreas Grassl
> <Andreas.Grassl at student.uibk.ac.at
> <mailto:Andreas.Grassl at student.uibk.ac.at>> wrote:
>
> 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);
>
>
> The Viewer has COMM_WORLD, but you are reading a matrix with COMM_SELF.
> You need to create
> a separate viewer for each process to do what you want.
>
Thank you for the fast answer. I resolved this issue now, but how could i gather
the Matrix from COMM_SELF to COMM_WORLD. I searched for functions doing such
matrix copying, but MatConvert and MatCopy act on the same communicator.
Thanks in advance
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