[Trilinos-Users] Problem with Epetra_FECrsGraph and 64-bit indices

Chetan Jhurani chetan.jhurani at gmail.com
Wed Apr 10 12:33:52 MDT 2013


Hi James,

I am unable to see a segfault with the current repo
(I had the build handy so just tested with it).

Questions:

1. Are you using release 11.0.3?  There have been some
fixes after that release, which will be available in 11.2
shortly and are in the current repo.  It is possible that
your code crashes because of those bugs.  11.2 code is
'frozen' and it is in backward compatibility testing mode.

2. Is the output in the attached files what you expect?
Here is a description of the outputs.

- 32 bit indices when both 32 and 64 bit indices are
available.  Output in 32_when_both.txt

- 64 bit indices when both 32 and 64 bit indices are
available.  Output in 32_when_both.txt

- 32 bit when ONLY 32 bit indices available.  Output
in 32_when_32.txt.  This is if CMake is given the
option -DTrilinos_NO_64BIT_GLOBAL_INDICES

- 64 bit when ONLY 64 bit indices available.  Output
in 64_when_64.txt.  This is if CMake is given the
option -DTrilinos_NO_32BIT_GLOBAL_INDICES

I changed DOF_LONG_LONG macro appropriately and ran
your code after adding some diagnostics.  Each run
is on 4 MPI processes.

Chetan

> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov]
> On Behalf Of Ramsey, James J CIV (US)
> Sent: Wednesday, April 10, 2013 9:55 AM
> To: trilinos-users at software.sandia.gov
> Subject: [Trilinos-Users] Problem with Epetra_FECrsGraph and 64-bit indices
> 
> I seem to have a problem where my program segfaults when I run the GlobalAssemble() method on
> Epetra_FECrsGraph and 64-bit indices are used. This seems to happen in particular when I manually
> specify the rows used on each processor. I have not found it to occur for 32-bit indices, or when the
> number of processors is two or fewer. I have reproduced the crashing with both OpenMPI and IntelMPI.
> Here's a contrived test case that reproduces the problem for me:
> 
> #include <iostream>
> #include <bitset>
> 
> #include "Epetra_ConfigDefs.h"
> 
> #include "mpi.h"
> #include "Epetra_MpiComm.h"
> #include "Epetra_Map.h"
> #include "Epetra_FECrsGraph.h"
> 
> #ifdef DOF_LONG_LONG
> typedef long long DOFnum;
> typedef Epetra_LongLongSerialDenseVector Epetra_DOFVector;
> #else
> typedef int DOFnum;
> typedef Epetra_IntSerialDenseVector Epetra_DOFVector;
> #endif
> 
> int main(int argc, char *argv[]) {
> 
>   MPI_Init(&argc, &argv);
>   Epetra_MpiComm Comm(MPI_COMM_WORLD);
> 
>   int nProcs = Comm.NumProc();
>   int currProc = Comm.MyPID();
> 
>   if (nProcs > 4) {
>     std::cerr << "Must use at most four processes for this test case.!\n" << std::endl;
>     MPI_Abort(MPI_COMM_WORLD, 1);
>   }
> 
>   Epetra_DOFVector elemNodes, myDofVec;
> 
>   switch (currProc) {
>   case 0:
>     elemNodes.Resize(3);
> 
>     elemNodes(0) = 0;
>     elemNodes(1) = 2;
>     elemNodes(2) = 3;
> 
>     myDofVec.Resize(2);
> 
>     myDofVec(0) = 4;
>     myDofVec(1) = 6;
>     break;
>   case 1:
>     elemNodes.Resize(4);
> 
>     elemNodes(0) = 0;
>     elemNodes(1) = 1;
>     elemNodes(2) = 3;
>     elemNodes(3) = 4;
> 
>     myDofVec.Resize(2);
> 
>     myDofVec(0) = 2;
>     myDofVec(1) = 3;
>     break;
>   case 2:
>     elemNodes.Resize(4);
> 
>     elemNodes(0) = 2;
>     elemNodes(1) = 3;
>     elemNodes(2) = 5;
>     elemNodes(3) = 6;
> 
>     myDofVec.Resize(2);
> 
>     myDofVec(0) = 0;
>     myDofVec(1) = 1;
>     break;
>   case 3:
>     elemNodes.Resize(3);
> 
>     elemNodes(0) = 3;
>     elemNodes(1) = 4;
>     elemNodes(2) = 6;
> 
>     myDofVec.Resize(1);
> 
>     myDofVec(0) = 5;
>     break;
>   }
> 
>   Epetra_Map Map(static_cast<DOFnum>(-1), myDofVec.Length(), myDofVec.Values(), 0, Comm);
>   Epetra_FECrsGraph Graph(Copy, Map, 1);
> 
>   Graph.InsertGlobalIndices(elemNodes.Length(), elemNodes.Values(),
> 			    elemNodes.Length(), elemNodes.Values());
> 
>   Graph.GlobalAssemble();
> 
>   std::cout << Graph;
> 
>   MPI_Finalize();
>   return 0;
> }
> 
> Basically, whether the above program crashes on me depends on whether I define DOF_LONG_LONG. I'm not
> sure if this is a bug or me missing something at my end, though.
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 32_when_32.txt
Url: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130410/c28e8659/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 32_when_both.txt
Url: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130410/c28e8659/attachment-0001.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 64_when_64.txt
Url: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130410/c28e8659/attachment-0002.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 64_when_both.txt
Url: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130410/c28e8659/attachment-0003.txt 


More information about the Trilinos-Users mailing list