[Trilinos-Users] Ifpack2: GlobalMPISession Error

Hoemmen, Mark mhoemme at sandia.gov
Tue Jul 26 12:14:20 EDT 2016



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:

>*Error: *
> rank           0
>GlobalMPISession(): Error, MPI_Intialized() return true, calling
>std::terminate()!

Remove the GlobalMPISession lines and try again.
mfh



More information about the Trilinos-Users mailing list