[Trilinos-Users] Ifpack2: GlobalMPISession Error

V M Krushnarao Kotteda kvmkrao at gmail.com
Tue Jul 26 13:04:55 EDT 2016


On Tue, Jul 26, 2016 at 10:14 AM, Hoemmen, Mark <mhoemme at sandia.gov> wrote:

>
>
> On 7/26/16, 7:50 AM, "Trilinos-Users on behalf of
> trilinos-users-request at trilinos.org" <trilinos-users-bounces at trilinos.org
> on behalf of trilinos-users-request at trilinos.org> wrote:
> >Date: Mon, 25 Jul 2016 20:02:38 -0600
> >From: V M Krushnarao Kotteda <kvmkrao at gmail.com>
> >To: trilinos-users at trilinos.org,
> >       trilinos-framework at software.sandia.gov
> >Subject: [Trilinos-Users] Ifpack2: GlobalMPISession Error
> >
> >I initialized MPI in my program and calling a program (Test.cpp)
> >in the following directory to solve the linear system of equations:
> >
> >src/packages/ifpack2/test/belos/AdditiveSchwarzRILUK
> >
> >I am able to compile my program with Ifpack2 test program.
> >However, I got GlobalMPISession Error when I ran the executable using the
> >following command:
> >
> >mpirun -np 2 ./example
> >
> >I am new to Trilinos and could you please tell me how to fix this error.
> >
> > …
> >
> >   Teuchos::oblackholestream blackHole;
> >//Teuchos::GlobalMPISession mpiSession (&argc, &argv, &blackHole);
> >  Teuchos::GlobalMPISession mpiSession (NULL, NULL, NULL);
>
> That’s the problem.  The main() function lives in belos_solve.cpp.  It
> already invokes Teuchos::GlobalMPISession, and thus already initializes
> MPI.  You’re not allowed to initialize MPI twice in the same executable.
> This explains the error you observed:
>

Thank you.
Yes sir.  I am not allowed to reinitialize MPI in the same executable.
As per your suggestion,  I removed GlobalMPISession  lines in the code and
compiled the program.
Therefore, it is working now.


>
> >*Error: *
> > rank           0
> >GlobalMPISession(): Error, MPI_Intialized() return true, calling
> >std::terminate()!
>
> Remove the GlobalMPISession lines and try again.
>

I removed GlobalMPISession lines and compiled the code. Therefore, it is
working now.

mfh
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at trilinos.org
> https://trilinos.org/mailman/listinfo/trilinos-users
>

Ifpack2 provides various solvers and pre-conditioners.
Please let me know if there is a way to choose proper pre-conditioner and
solver for the given system of equations?
I provide banded (penta/septa-diagonal) matrix and the right hand side
vector to Ifpack2 to get the solution.

Thank you.

Best regards,
V M Krushnarao Kotteda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20160726/a5081ff2/attachment.html>


More information about the Trilinos-Users mailing list