[Trilinos-Users] Nonlinear maps & VectorToMatrixMarketFile

Heroux, Michael A maherou at sandia.gov
Mon May 9 09:57:12 MDT 2011

```Przemyslaw,

Sorry for the delayed response.  Do you have a simple test program that
exhibits the behavior?  I can build one from your description, but it would
be convenient to use yours.

Mike

On 5/8/11 11:34 AM, "Klosiewicz Przemyslaw" <Przemyslaw.Klosiewicz at ua.ac.be>
wrote:

> Any ideas?
>
> Greetings,
> Przemyslaw
>
>
> On 29 Apr 2011, at 19:18, Klosiewicz Przemyslaw wrote:
>
>> 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
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>
>
> --
> 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
>
>
>
>
>
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users

```