[Trilinos-Users] Trouble Reading Epetra Exported HDF5 Matrix in Matlab

Davood Ansari david.ansari at gmail.com
Wed Mar 9 17:00:57 MST 2011


I have a distributed Epetra Matrix/Graph and I save it in HDF5 format with
the following method:

Teuchos::RCP<Epetra_CrsGraph> globalCrsGraph ;
.
.
.

EpetraExt::HDF5 myHDF5(Comm);
myHDF5.Create(filename);
myHDF5.Create("./matrix.h5");
myHDF5.Write("A", *globalCrsGraph);
myHDF5.Close() ;
.
.
.

When I use the follwing code to read and visulize the sparsity it in matlab
I only see the part of the graph that belongs to the last MPI process.

clear all;
close all;
clc;
NumGlobalCols = double(hdf5read('matrix.h5', '/A/NumGlobalCols/'));
NumGlobalRows = double(hdf5read('matrix.h5', '/A/NumGlobalRows/'));
NumGlobalNonzeros = double(hdf5read('matrix.h5', '/A/NumGlobalNonzeros/'));
Row = double(hdf5read('matrix.h5', '/A/ROW'));
Col = double(hdf5read('matrix.h5', '/A/COL'));
Val = double(hdf5read('matrix.h5', '/A/VAL'));
A=sparse(Row + 1, Col + 1, Val, NumGlobalRows, NumGlobalCols);
spy(A)

Any idea what is going on?

Thankfully
Davood
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20110309/c1ea0305/attachment.html 


More information about the Trilinos-Users mailing list