Hi,

I'm using valgrind 3.12 with openmpi 2.0.1.
The code simply send an integer to another process with :
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>

int main (int argc, char **argv) {
  const int tag = 13;
  int size, rank;

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &size);

  if (size < 2) {
      fprintf(stderr,"Requires at least two processes.\n");
      exit(-1);
  }

  MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  if (rank == 0) {
    int i=3;
    const int dest = 1;

    MPI_Send(&i,   1, MPI_INT, dest, tag, MPI_COMM_WORLD);

    printf("Rank %d: sent int\n", rank);
  }
  if (rank == 1) {
    int j;
    const int src=0;
    MPI_Status status;

    MPI_Recv(&j,   1, MPI_INT, src, tag, MPI_COMM_WORLD, &status);
    printf("Rank %d: Received: int = %d\n", rank,j);
  }

  MPI_Finalize();

  return 0;
}


I'm getting the error :
valgrind MPI wrappers 46313: Active for pid 46313
valgrind MPI wrappers 46313: Try MPIWRAP_DEBUG=help for possible options
valgrind MPI wrappers 46314: Active for pid 46314
valgrind MPI wrappers 46314: Try MPIWRAP_DEBUG=help for possible options
Rank 0: sent int
==46314== Invalid read of size 4
==46314==    at 0x400A3D: main (basic.c:33)
==46314==  Address 0xffefff594 is on thread 1's stack
==46314==  in frame #0, created by main (basic.c:5)
==46314==
Rank 1: Received: int = 3

The invalid read is at the printf line.

Do you have any clue of why am i getting it ?

I ran the code with :
LD_PRELOAD=$prefix/lib/valgrind/libmpiwrap-amd64-linux.so mpirun -np 2 $prefix/bin/valgrind ./exe

Thanks in advance,

Yann

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users

Reply via email to