[Trilinos-Users] aztecOO thyra trouble

Bartlett, Roscoe A rabartl at sandia.gov
Tue Apr 3 10:31:40 MDT 2007


Marco,

If you look at:

  Trilinos/packages/stratimikos/test/definition

you will see that none of these tests or examples actually are run in
parallel (i.e. MPI(1)).

These tests really just check that the Epetra objects are wrapped and
unwrapped correctly which has nothing to do with parallelism.  Perhaps
we should put in the code to distribute the input matrices so that we
can run these examples/tests in parallel, we just have not done so.
However, we should put in error checking to make sure that np == 1 when
MPI is enabled if this is not supposed to run in parallel.

What I would suggest is for you to look at an AztecOO example that runs
in parallel and then copy and paste the code that builds the
Epetra_CrsMatrix and Epetra_Vector RHS and LHS objects and then wrap
these objects as Thyra objects and use Stratimikos.  The example
program:

  Trilinos/packages/aztecoo/example/UG_Ex1/cxx_main.cpp

might be a good place to start.

As a matter of fact, I could just copy and paste this example into
Stratimikos if it would help.

Cheers,

Ross

-----Original Message-----
From: Marco Morandini [mailto:morandini at aero.polimi.it] 
Sent: Tuesday, April 03, 2007 10:16 AM
To: Bartlett, Roscoe A; trilinos-users at software.sandia.gov
Subject: Re: [Trilinos-Users] aztecOO thyra trouble

Bartlett, Roscoe A wrote:
> Hello Marco,
> 
> The AztecOO/Thyra adapters work in parallel (tested in other packages 
> like moocho and rythmos) but the simple test program that you are 
> trying to run has not been run in parallel (see the file 
> Trilinos/packages/aztecoo/test/definition).  To avoid confusion, I 
> really should throw an exception when np > 1.  Basically, as long as 
> you create your Epetra maps correctly (see Epetra documentation) and 
> create the appropriately distributed Epetra_[Multi]Vector and 
> Epetra_CrsMatrix (or other Epetra_Operator) objects correctly, then 
> the AztecOO/Thyra adapters will do the right thing independent of
parallelism.
> 
> Rather coding directly to the AztecOO/Thyra adapters, I might suggest 
> that you use the class Thyra::DefaultRealLinearSolverBuilder in the 
> package Stratimikos to access linear solvers.  See the example at:
> 
>  
> http://software.sandia.gov/Trilinos/packages/docs/r7.0/packages/strati
> mi kos/doc/html/simple__stratimikos__example_8cpp-example.html
> 
> By using this class from Stratimikos, you can access all of the linear

> solver and preconditioner capabilities in Amesos, AztecOO, Belos 
> (Trilinos Dev only), Ifpack and ML through a single parameter list 
> driven interface.  All you do is wrap your Epetra objects and Thyra 
> objects (see above example) and then you can switch back and forth 
> between any of these various solver methods.
> 

I was trying the AztecOO/Thyra adapters test because the stramitikos
example hangs in parallel, but work when run with only one process (it
hangs also with different matrix files, like FourByFour.mtx):

----------------------------------------------
marco at mbdyn-mm:~/Programmi/Trilinos/trilinos-7.0.5/Build/packages/strati
mikos/example>
mpirun -np 2 simple_stratimikos_example.exe
--linear-solver-params-file=aztecoo.ifpack.xml
--matrix-file=../../aztecoo/thyra/test/KheadSorted.mtx
Teuchos::GlobalMPISession::GlobalMPISession(): started processor with
name mbdyn-mm and rank 0!

Reading linear system in Epetra format from the file
'../../aztecoo/thyra/test/KheadSorted.mtx' ...
Teuchos::GlobalMPISession::GlobalMPISession(): started processor with
name mbdyn-mm and rank 1!

Printing statistics of the Epetra linear system ...

   Epetra_CrsMatrix epetra_A of dimension 8 x 8
   ||epetraA||inf = 4.76133e+06
   ||epetra_b||2 = 2.27672e+06
   ||epetra_x||2 = 0

Reading parameters from XML file "aztecoo.ifpack.xml" ...

   Entering
Thyra::AztecOOLinearOpWithSolveFactory::initializeOp_impl(...) ...

----------------------------------------------

and stays there forever.

Thanks,

Marco




More information about the Trilinos-Users mailing list