[Trilinos-Users] Nonlinear maps & VectorToMatrixMarketFile

Klosiewicz Przemyslaw Przemyslaw.Klosiewicz at ua.ac.be
Fri Apr 29 11:18:44 MDT 2011


Hi all,

Up till now I've been using EpetraExt::VectorToMatrixMarketFile(...) and similar to quickly dump distributed vectors to files. However, as soon as "custom-defined" maps for these vectors are used the family of the above IO functions generates results suggesting the requirement of a default linear map.
As an example, consider an 'interleaving' map:

int myGlobalElements[2];
if (comm.MyPID() == 0) {
	myGlobalElements[0] = 0;
	myGlobalElements[1] = 2;
} else {
	myGlobalElements[0] = 1;
	myGlobalElements[1] = 3;
}
Epetra_Map map(4, 2, myGlobalElements, 0, comm);

and a vector:

Epetra_Vector v(map);
for (int idx = 0; idx < map.NumMyElements(); idx++) {
	v[idx] = comm.MyPID();
}

to create the vector [0, 1, 0, 1] when executed on 2 nodes. A quick cout << v indicates that all is fine.
Writing the file with VectorToMatrixMarketFile("v.mtx", v) though, gives:

%%MatrixMarket matrix array real general
4 1
0.0000000000000000e+00
0.0000000000000000e+00
1.0000000000000000e+00
1.0000000000000000e+00

The right behavior can of course be obtained by using a suitable Epetra_Import but I was expecting the IO functions not to depend on linear ordering.
Is this a bug, a feature or am I missing something crucial?

Thanks,
Przemyslaw


--
Przemyslaw Klosiewicz
PhD Student @ CoMP Research Group
Department of Mathematics and Computer Science, University of Antwerp
Middelheimlaan 1, 2020 Antwerp, Belgium

Office (G2.07):  T (+32) 3 265 32 80, F (+32) 3 265 37 77, E Przemyslaw.Klosiewicz at ua.ac.be
Home: T (+32) 497 24 18 82, E przemek.klosiewicz at gmail.com, Skype przemek_klosiewicz








More information about the Trilinos-Users mailing list