[Trilinos-Users] Error: "AZ_extract_comm_info: Received elements must be stored after all local elements"

Heroux, Michael A maherou at sandia.gov
Wed Mar 30 13:56:50 MDT 2011


Henian,

Given the difficulties you are having, you might consider going back to your original approach of using Copy mode.  Only this time, insert a whole row of values at once, not just one at a time.  This would reduce your construction cost a lot.

View mode is great, but we recommend using it as an ‘expert mode’ optimization, after you gain some experience with Epetra.

>From your original post, you would replace:

              for( j = Matrix_ia[ i ] ; j < Matrix_ia[ i + 1 ] ; j ++ )  {
                    (*equA).InsertGlobalValues( GlobalRow , 1 , Matrix_a + j , Matrix_ja + j );

With something like this:

      int numEntries = Matrix_ia[i+1] - Matrix_ia[i];
     (*equA).InsertGlobalValues (GlobalRow, numEntries, Matrix_a+Matrix_ia[i], Matrix_ja+Matrix_ia[i];

This should greatly improve the fill performance.  Once you have that debugged you can look at optimizing with View mode.

Mike


On 3/30/11 2:29 PM, "Alan Williams" <william at sandia.gov> wrote:

It may be possible that in “View” mode, A->FillComplete() is changing the indices in your Matrix_ia structure. If that’s the case, then those indices are wrong when the second call happens and A->FillComplete() is called again.

I think your options are to either not call FillComplete on the second time (only call it during the first call), or alternatively only use “Copy” mode.

Alan



From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of Henian Xia
Sent: Wednesday, March 30, 2011 11:53 AM
To: Williams, Alan B
Cc: trilinos-users
Subject: Re: [Trilinos-Users] Error: "AZ_extract_comm_info: Received elements must be stored after all local elements"

Hi Alan,
Thank you. If that's the case, do you have any suggestions please? Also I'm confused that since I have already released the memory for A in the end of the first call, why should the second call be affected?

Thank you,
Henian

On Wed, Mar 30, 2011 at 1:26 PM, Williams, Alan B <william at sandia.gov> wrote:

If it works correctly in “Copy” mode but not in “View” mode, then perhaps the call to A->FillComplete() is messing with the indices in your Matrix_ia structure, causing them to be wrong for the second call. Mike Heroux might know whether that could be the case.
Alan



From: Henian Xia [mailto:xiahenian at gmail.com]
Sent: Wednesday, March 30, 2011 11:17 AM
To: Williams, Alan B
Cc: trilinos-users
Subject: Re: [Trilinos-Users] Error: "AZ_extract_comm_info: Received elements must be stored after all local elements"


Hi,
Thank you very much for your reply. I created A by "A = new Epetra_CrsMatrix(View, *Map, 3);". It's in a function called solveEqu() as following. When I call solveEqu() at the first time, it works, but when I call the function again, it reports that error. The objects "solver", "A", "x", and "b" are all defined inside the function solveEqu() and are deleted before returning from the function. So it's very strange that it works at the first time while doesn't work later. In addition, if I use "Copy" mode, it works perfectly.

void solveEqu()      {
Epetra_CrsMatrix * A;
   A = new Epetra_CrsMatrix(View, *Map, 3);
    for( i = 0 ; i < NumMyElementsForTRILI ; i++ )
    {
        (*A).InsertGlobalValues( (*A).GRID( i ) , Matrix_ia[ i + 1 ] - Matrix_ia[ i ] ,
                                 Matrix_a + Matrix_ia[ i ] , Matrix_ja + Matrix_ia[ i ] );
    }
    (*A).FillComplete();
    AztecOO * solver;
    Epetra_Vector * x = new Epetra_Vector(*Map);
    Epetra_Vector * b = new Epetra_Vector(*Map);
    for( i = 0 ; i < 4 * localNodesNumber ; i ++ ) (*b)[i] = 1;
    solver = new AztecOO(A, x, b);
    (*solver).SetAztecOption(AZ_precond, AZ_Jacobi);
    (*solver).Iterate(1000, 1.0E-8);
   delete solver;
   delete b;
   delete x;
   delete A;
}

Thank you very much,
Henian

On Wed, Mar 30, 2011 at 1:04 PM, Williams, Alan B <william at sandia.gov> wrote:

It is referring to elements of the matrix ‘A’.
How did you create A?
Aaln



From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of Henian Xia
Sent: Wednesday, March 30, 2011 10:56 AM
To: trilinos-users
Subject: [Trilinos-Users] Error: "AZ_extract_comm_info: Received elements must be stored after all local elements"


Hi everyone,
I encountered this error "AZ_extract_comm_info: Received elements must be stored after all local elements" when I call the method "solver = new AztecOO(A, x, b);". Does anyone know what this means please?

Thank you very much,
Henian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20110330/77b05f12/attachment-0001.html 


More information about the Trilinos-Users mailing list