[Trilinos-Users] Komplex vs. Epetra_LocalMap
Przemysław Kłosiewicz
przemyslaw.klosiewicz at ua.ac.be
Sat Oct 23 11:35:58 MDT 2010
Mike,
Thanks a lot for the suggestion. All seems to be working fine now.
Cheers,
Przemek.
On 23 Oct 2010, at 17:32, Heroux, Michael A wrote:
> Przemek,
>
> Although what you have done is possible, it is not a valid usage. Epetra
> assumes (it would be possible to check this, but very expensive) that an
> object based on a LocalMap will have identical values on each processor. If
> such an object is the output of an operation, Epetra will also perform the
> global operations to make sure that values are the same across all
> processors.
>
> Mike
>
>
> On 10/23/10 10:01 AM, "Przemysław Kłosiewicz"
> <przemyslaw.klosiewicz at ua.ac.be> wrote:
>
>> Oh, I see. I didn't realize mixing different types of communicators could be a
>> valid solution; I'll try that.
>> One thing though:
>> Suppose I create a vector v with a LocalMap, fill it with
>> v.PutScalar(comm.MyPID()) and run it on two mpi nodes.
>> If I now do a cout << v the output suggests that I end up having two different
>> vectors v: on node 0 it's a v full of zeros and on node 1 v is full of ones;
>> thus not identical.
>> Am I actually creating two different vectors or is it one and the same vector
>> which just happens to be out of sync somehow?
>>
>> Thanks,
>> Przemek.
>>
>> On 23 Oct 2010, at 16:26, Heroux, Michael A wrote:
>>
>>> Przemek,
>>>
>>> I think you want to create an Epetra_SerialComm object on each processor and
>>> then construct regular Epetra_Map objects using that comm object. This will
>>> give you the independence you want.
>>>
>>> LocalComm is intended to be used with data that is identical and replicated
>>> on each processor.
>>>
>>> I hope this helps.
>>>
>>> Mike
>>>
>>>
>>> On 10/23/10 7:49 AM, "Przemysław Kłosiewicz"
>>> <przemyslaw.klosiewicz at ua.ac.be> wrote:
>>>
>>>> Dear all
>>>>
>>>> I am solving a moderately sized complex linear system Ax = b using Amesos.
>>>> In
>>>> order to obtain an equivalent real-valued formulation I use Komplex which
>>>> needs re(A), im(A), re(b), etc... separately.
>>>> As long as I use a regular Epetra_Map for these matrices & vectors all goes
>>>> well. However, for some well-defined reason I don't want these matrices to
>>>> be
>>>> distributed so I tried using an Epetra_LocalMap (or an Epetra_Map with
>>>> NumGlobalElements = NumMyElements).
>>>> This is where Komplex fails: During the creation of a Komplex_LinearProblem
>>>> from matrices created with such maps I get the following exception:
>>>>
>>>> /home/pklosiew/trilinos-10.6.0-Source/packages/komplex/src/Komplex_LinearPro
>>>> bl
>>>> em.cpp:291:
>>>> Throw number = 1
>>>> Throw test that evaluated to true: KomplexMatrix_->InsertGlobalValues(Row,
>>>> NumIndices, Values, Indices)<0
>>>>
>>>> This only happens when running with mpi and where the number of processors >
>>>> 1.
>>>>
>>>> I have the impression Komplex tries to create double-sized distributed maps
>>>> from the original map, even though they should stay local.
>>>> Is this a bug, a feature or am I misusing the Epetra_LocalMap?
>>>>
>>>> Thanks,
>>>> Przemek.
>>>>
>>>>
>>>> (ps: the reason why I don't want Ax=b to be distributed is that I need to
>>>> solve these systems for a range of parameters p, as in: A(p)x = b(p) which
>>>> can
>>>> all be done in parallel with minimal communication.)
>>>>
>>>>
>>>> --
>>>> 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
>
>
--
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