[mpich-commits] r10624 - mpich2/trunk/src/mpi/debugger
gropp at mcs.anl.gov
gropp at mcs.anl.gov
Mon Nov 19 16:01:02 CST 2012
Author: gropp
Date: 2012-11-19 16:01:02 -0600 (Mon, 19 Nov 2012)
New Revision: 10624
Added:
mpich2/trunk/src/mpi/debugger/allcommdbg.c
Modified:
mpich2/trunk/src/mpi/debugger/Makefile.mk
Log:
Added another test program for debugger interface, in the debugger directory where the other tests live
Modified: mpich2/trunk/src/mpi/debugger/Makefile.mk
===================================================================
--- mpich2/trunk/src/mpi/debugger/Makefile.mk 2012-11-19 20:02:49 UTC (rev 10623)
+++ mpich2/trunk/src/mpi/debugger/Makefile.mk 2012-11-19 22:01:02 UTC (rev 10624)
@@ -44,5 +44,8 @@
src/mpi/debugger/qdemo: src/mpi/debugger/qdemo.c
$(bindir)/mpicc -o $@ $?
+src/mpi/debugger/allcommdbg: src/mpi/debugger/allcommdbg.c
+ $(bindir)/mpicc -o $@ $?
+
endif BUILD_DEBUGGER_DLL
Added: mpich2/trunk/src/mpi/debugger/allcommdbg.c
===================================================================
--- mpich2/trunk/src/mpi/debugger/allcommdbg.c (rev 0)
+++ mpich2/trunk/src/mpi/debugger/allcommdbg.c 2012-11-19 22:01:02 UTC (rev 10624)
@@ -0,0 +1,39 @@
+#include "mpi.h"
+#include <stdio.h>
+
+/* This definition is almost the same as the MPIR_Comm_list in dbginit,
+ except a void * is used instead of MPID_Comm * for head; for the use
+ here, void * is all that is needed */
+typedef struct MPIR_Comm_list {
+ int sequence_number; /* Used to detect changes in the list */
+ void *head; /* Head of the list */
+} MPIR_Comm_list;
+
+extern MPIR_Comm_list MPIR_All_communicators;
+
+int main( int argc, char **argv )
+{
+ int errs = 0;
+ MPI_Init( &argc, &argv );
+
+ printf( "sequence number for communicators is %d\n", MPIR_All_communicators.sequence_number );
+ printf( "head pointer is %p\n", MPIR_All_communicators.head );
+
+ if (MPIR_All_communicators.head == (void *)0) {
+ printf( "ERROR: The communicator list field has a null head pointer\n" );
+ printf( "Either the debugger support is not enabled (--enable-debuginfo)\n\
+or the necessary symbols, including the extern variable\n\
+MPIR_All_communicators, are not properly exported to the main program\n" );
+ errs++;
+ }
+
+ MPI_Finalize( );
+ if (errs) {
+ printf( " Found %d errors\n", errs );
+ }
+ else {
+ printf( " No Errors\n" );
+ }
+
+ return 0;
+}
More information about the commits
mailing list