Commit 85916af6 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Implemented attachement to MPI processes from gdb.

parent 6db945fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
ADD_SUBDIRECTORY( Python )
#ADD_SUBDIRECTORY( Python )
ADD_SUBDIRECTORY( TNL )
ADD_SUBDIRECTORY( Tools )
ADD_SUBDIRECTORY( UnitTests )
+14 −10
Original line number Diff line number Diff line
@@ -106,8 +106,10 @@ class MpiCommunicator
                              
               volatile int tnlMPIDebugAttached = 0;
               MPI_Send( &pid, 1, MPI_INT, 0, 0, MPI_COMM_WORLD );
               MPI_Barrier( MPI_COMM_WORLD );
               if( rank == 0 )
                  std::cerr << "Attach GDB to MPI process(es) by entering:" << std::endl;
               {
                  std::cout << "Attach GDB to MPI process(es) by entering:" << std::endl;
                  for( int i = 0; i < GetSize( MPI_COMM_WORLD ); i++ )
                  {
                     MPI_Status status;
@@ -116,11 +118,13 @@ class MpiCommunicator

                     if( i == processToAttach || processToAttach == -1 )
                     {
                     std::cerr << "  For MPI process " << i << ": gdb -q -ex \"attach " << recvPid << "\"" 
                        std::cout << "  For MPI process " << i << ": gdb -q -ex \"attach " << recvPid << "\"" 
                                  << " -ex \"set variable tnlMPIDebugAttached=1\"" 
                                  << " -ex \"finish\"" << std::endl;
                     }
                  }
                  std::cout << std::flush;
               }
               if( rank == processToAttach || processToAttach == -1 )
                  while( ! tnlMPIDebugAttached );
               MPI_Barrier( MPI_COMM_WORLD );
+2 −1
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@ printStackBacktraceAndAbort( int sig = 0 )
   else
      fprintf( stderr, "Aborting due to signal %d...\n", sig );
   printStackBacktrace();
   abort();
   throw( 0 );
   //abort();
}

/*