I was wondering if anyone has successfully used valgrind with MPI
applications on SGI systems with MPT?

 

I am trying to track some memory errors (and possibly threading errors) in
an MPI application in the following environment:

 

SGI Ice cluster with Westmere processors and Infiniband network.

Running RHEL.

Intel FORTRAN and C compilers.

Using SGI MPT for MPI.

 

Using a non-MPI program (the simple example from the valgrind website
tutorial) works exactly as documented.  However, an MPI hello world example
with the same error does not point out the error, even though there are
messages from the MPI wrappers.

 

The code that was used and the output generated are included below.  The
code was compiled using the following compilation line:

 

mpicc -DBUG -g -O0 -o hello_mpi_c hello_mpi_c.c
/contrib/valgrind/valgrind-3.8.1/lib/valgrind/libmpiwrap-amd64-linux.so

 

The code was executed using the following line:

 

mpiexec_mpt -np 2 /contrib/valgrind/valgrind-3.8.1/bin/valgrind hello_mpi_c

 

Any suggestions on what may be missing or what I'm doing wrong?  Has anyone
used valgrind with MPI applications?

 

Thanks,

 

--Raghu

 

The code:

#include <stdio.h>

#include <mpi.h>

 

int main(int argc, char **argv)

{

   int ierr, myid, npes;

   int len;

   char name[MPI_MAX_PROCESSOR_NAME];

 

   ierr = MPI_Init(&argc, &argv);

   ierr = MPI_Comm_rank(MPI_COMM_WORLD, &myid);

   ierr = MPI_Comm_size(MPI_COMM_WORLD, &npes);

   ierr = MPI_Get_processor_name( name, &len );

 

     printf("Hello from rank %d out of %d; procname = %s\n", myid, npes,
name);

 

#ifdef BUG

     {

       int* x = (int*)malloc(10 * sizeof(int));

       x[10] = 0;        // problem 1: heap block overrun

       printf("Print something %d\n",x[10]);

     }                    // problem 2: memory leak -- x not freed

#endif

 

   ierr = MPI_Finalize();

 

}

 

The output:

+ np=2

+ export MPIWRAP_DEBUG=verbose

+ MPIWRAP_DEBUG=verbose

+ mpiexec_mpt -np 2 /contrib/valgrind/valgrind-3.8.1/bin/valgrind
hello_mpi_c

valgrind MPI wrappers  5398: Active for pid 5398

valgrind MPI wrappers  5398: Try MPIWRAP_DEBUG=help for possible options

valgrind MPI wrappers  5398: enter PMPI_Init

valgrind MPI wrappers  5397: Active for pid 5397

valgrind MPI wrappers  5397: Try MPIWRAP_DEBUG=help for possible options

valgrind MPI wrappers  5397: enter PMPI_Init

valgrind MPI wrappers  5397: enter PMPI_Init_thread

valgrind MPI wrappers  5398: enter PMPI_Init_thread

valgrind MPI wrappers  5398:  exit PMPI_Init (err = 0)

valgrind MPI wrappers  5398: enter PMPI_Comm_rank

valgrind MPI wrappers  5398:  exit PMPI_Comm_rank (err = 0)

valgrind MPI wrappers  5398: enter PMPI_Comm_size

valgrind MPI wrappers  5397:  exit PMPI_Init (err = 0)

valgrind MPI wrappers  5398:  exit PMPI_Comm_size (err = 0)

valgrind MPI wrappers  5397: enter PMPI_Comm_rank

valgrind MPI wrappers  5398: enter PMPI_Get_processor_name

valgrind MPI wrappers  5397:  exit PMPI_Comm_rank (err = 0)

valgrind MPI wrappers  5397: enter PMPI_Comm_size

Hello from rank 1 out of 2; procname = r7i0n0

valgrind MPI wrappers  5397:  exit PMPI_Comm_size (err = 0)

valgrind MPI wrappers  5397: enter PMPI_Get_processor_name

Hello from rank 0 out of 2; procname = r7i0n0

Print something 0

valgrind MPI wrappers  5398: enter PMPI_Finalize

Print something 0

valgrind MPI wrappers  5397: enter PMPI_Finalize

valgrind MPI wrappers  5398:  exit PMPI_Finalize (err = 0)

valgrind MPI wrappers  5397:  exit PMPI_Finalize (err = 0)

+ env

+ grep MPIWRAP

MPIWRAP_DEBUG=verbose

 

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to