[Trilinos-Users] Parallel Epetra_LinearProblem

John Mitchell jamitch at sandia.gov
Thu Jun 10 15:01:22 MDT 2010


Thanks Alan and also to Mike Parks -- I had an offline discussion with 
him that cleared up a bunch of this. 

But now I have a different problem.

The linear problem requires that the RHS vector be constructed using a 
"domain" map.  But I only have data on a vector that is constructed 
using the "row" map associated with the operator.
Is there a simple way to map data from the "row map" vector to a 
different vector that uses the "range" map?


Williams, Alan B wrote:
> John,
> I'm not exactly sure what the problem is here, but...
>
> It is generally difficult to come up with the correct column-map in parallel, you usually want to just construct the graph and/or matrix with a row-map, and let it create its own column-map during the FillComplete method.
>
> For a description of the four maps and how they relate to each other, take a look at the doxygen documentation for the Epetra_VbrMatrix (go to trilinos.sandia.gov, go to the epetra package, dive, dive...)
>
> Alan
>
>
>   
>> -----Original Message-----
>> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
>> users-bounces at software.sandia.gov] On Behalf Of John Mitchell
>> Sent: Thursday, June 10, 2010 2:29 PM
>> To: trilinos-users at software.sandia.gov
>> Subject: Re: [Trilinos-Users] Parallel Epetra_LinearProblem
>>
>> After further investigation -- I have uncovered a piece of evidence
>> that
>> I don't understand.
>>
>> I have explicitly constructed an Epetra_CrsGraph using a different
>> rowMap and columnMap:
>> Epetra_CrsGraph *graph = new
>> Epetra_CrsGraph(Copy,rowMap,colMap,numCols.get(),true);
>>
>> Later, I constructed a Epetra_FEVbrMatrix
>>  shared_ptr<Epetra_FEVbrMatrix> mPtr(new
>> Epetra_FEVbrMatrix(Copy,*(graph)));
>>
>> I then used some debug commands to print out the underlying data that
>> each map stores -- this is used in the "CheckInput" of a
>> Epetra_LinearProblem:
>>     cout << "computeJacobian:: mPtr->OperatorDomainMap().DataPtr() = "
>> << mPtr->OperatorDomainMap().DataPtr() << endl;
>>     cout << "computeJacobian:: rowMap.DataPtr() = " << rowMap.DataPtr()
>> << endl;
>>     cout << "computeJacobian::mPtr->OperatorRangeMap().DataPtr() = " <<
>> mPtr->OperatorRangeMap().DataPtr() << endl;
>>     cout << "computeJacobian:: colMap.DataPtr() = " << colMap.DataPtr()
>> << endl;
>>
>> Results of the above print out don't make sense to me?  Notice how the
>> Operator range and domain maps are the same?  Also notice that neither
>> one matches the rowMap or colMap respectively?  I'm not quite sure how
>> the operator domain and range maps are the same since I explicitly
>> constructed the Operator with a different row and col maps.
>>
>> computeJacobian:: mPtr->OperatorDomainMap().DataPtr() = 0x1b123cf0
>> computeJacobian:: rowMap.DataPtr() = 0x1b11ee40
>> computeJacobian::mPtr->OperatorRangeMap().DataPtr() = 0x1b123cf0
>> computeJacobian:: colMap.DataPtr() = 0x1b123460
>>
>> Any comments or suggestions would be appreciated.
>> Thanks,
>> John
>>
>> John Mitchell wrote:
>>     
>>> Hi,
>>>
>>> I am having trouble getting past the "CheckInput" stage for a
>>> Epetra_LinearProblem.  In serial the problem runs fine, but in
>>>       
>> parallel
>>     
>>> I fail 'CheckInput'.
>>>
>>> I successfully constructed and filled a graph checking all error
>>>       
>> flags
>>     
>>> -- no failures or warnings.
>>>
>>> Similarly, I successfully constructed an Epetra_RowMatrix with the
>>>       
>> above
>>     
>>> graph and then filled it checking all error flags -- no failures or
>>> warnings.
>>>
>>> The last step is to create an Epetra_LinearProblem.
>>>
>>> Epetra_RowMatrix *mPtr = ...
>>> Epetra_LinearProblem linProblem;
>>> linProblem.SetOperator(mPtr);
>>> linProblem.AssertSymmetric();
>>>
>>> When I constructed both the Epetra_CrsGraph and Epetra_FEVbrMatrix I
>>> used the following maps.
>>>     const Epetra_BlockMap& rowMap  = jacobian->getRowMap();
>>>     const Epetra_BlockMap& colMap  = jacobian->getColMap();
>>>
>>> Now, I created the RHS and LHS Epetra_Vectors : (this is simplified
>>>       
>> to
>>     
>>> emphasize the maps I used)
>>>     double *u = ...;
>>>     double *f = ...;
>>>     Epetra_Vector rhs(View,rowMap,f);
>>>     Epetra_Vector lhs(View,colMap,u);
>>>     linProblem.SetRHS(&rhs);
>>>     linProblem.SetLHS(&lhs);
>>>     BOOST_CHECK(0==linProblem.CheckInput());
>>>
>>> I am failing the last check at the bottom with the error flag = -5?
>>>
>>> I thought that I was very careful to use the proper maps.  When I run
>>> this in serial it runs correctly.  But when I run it in parallel it
>>> fails the last error flag check?
>>>
>>> Any thoughts/suggestions would be much appreciated.
>>>
>>> Thanks,
>>> John
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Trilinos-Users mailing list
>>> Trilinos-Users at software.sandia.gov
>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>>
>>>       
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>     



More information about the Trilinos-Users mailing list