[Trilinos-Users] ForTrilinos: Problems with Epetra_Vector

Dominic Kedelty dkedelty at asu.edu
Wed Dec 9 16:46:11 EST 2015


Mike,

Thanks for the info. Actually, I have sort of figured out how to fix my
problem, but I still need assistance in doing so.

Trilinos Users,

Does anyone know how to clear/delete epetra structures in
Fortrilinos/Ctrilinos? (i.e. Say I have a CrsMatrix A, and later the number
of elements change. I need to delete A and rewrite A.)

On Tue, Dec 1, 2015 at 9:31 AM, Heroux, Mike <MHeroux at csbsju.edu> wrote:

> Dominic,
>
> The ForTrilinos package is not a well supported package at this time.  I
> don’t have a good answer for you regarding your specific problem.  A big
> part of why ForTrilinos is not well supported is that we have had
> persistent portability issues with modern Fortran features.  There is some
> discussion of reviving the effort to develop ForTrilinos again, but nothing
> certain.  If you have interest in contributing to it, please let us know.
>
> Thanks.
>
> Mike
>
> From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of
> Dominic Kedelty <dkedelty at asu.edu>
> Date: Monday, November 30, 2015 at 2:47 PM
> To: Trilinos Users <trilinos-users at trilinos.org>
> Subject: [Trilinos-Users] ForTrilinos: Problems with Epetra_Vector
>
> I am having a problem with Epetra_Vectors inside of  ForTrilinos.
> Currently I have a parallel CFD code set up that constructs a CRS sparse A
> matrix and a B vector for the discretization that I am dealing with. What I
> would like to do is have a subroutine that I pass in the row_pointer for a
> A, column indices for A, and the B vector and get an X vector as an output.
> Initially, what I wanted to do was have A_ B_ and X_ be epetra_crsmatrix
> and epetra_vectors that are defined within the scope of a subroutine.
>
> subroutine solve_problem( rowptr_A, colidx_A, values_A, values_B, values_X
> )
>   type(Epetra_MpiComm) :: comm
>   type(Epetra_Map) :: map
>   type(Epetra_CrsMatrix) :: A_
>   type(Epetra_Vector) :: X_,B_
>   type(AztecOO) :: Solver
>
>   comm = Epetra_MpiComm(MPI_COMM_WORLD)
>
>   map = Epetra_Map(-1_c_int,MyGlobalCVs,1_c_int,comm)
>
>   A_ = Epetra_CrsMatrix(FT_Epetra_DataAccess_E_Copy,map,NumNonZero)
>
>   [... Fill A ...]
>
>   B_=Epetra_Vector(map,.true.)
>   X_=Epetra_Vector(map,.true.)
>
>   [... solve here ...]
>
>   call Solver%force_finalize
>   call X_%force_finalize()
>   call B_%force_finalize()
>   call A_%force_finalize()
>   call map%force_finalize()
>   call comm%force_finalize()
>
> end subroutine
>
> When I coded this approach, it worked for my first timestep (I verified
> the values_X solution and it was correct)... But, for whatever reason, when
> the subroutine is called a second time I get random errors (mostly
> SIGSEGV). After some debugging, I have found that the problem lies when I
> call B_=Epetra_Vector(map,.true.) or any Epetra_Vector for that matter. The
> problem does not happen during the call however, it happens when I leave
> the subroutine.
>
> I've read that the force_finalize calls are only needed with certain
> compilers, is this true? and do I need to call force_finalize. Second, I am
> using an arbitrary map for CVs that I have partitioned across multiple
> processors. Am I doing anything wrong with how I am declaring my map, or
> how I am using it? And is there any information that would be useful in
> figuring out why I am having issues with the Epetra Vectors. Thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20151209/9198f14e/attachment.html>


More information about the Trilinos-Users mailing list