Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
adapt test for leak check
authorAugustin Degomme <adegomme@users.noreply.github.com>
Fri, 9 Apr 2021 01:35:35 +0000 (03:35 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Fri, 9 Apr 2021 09:10:25 +0000 (11:10 +0200)
teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c
teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh
teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh

index c9b9bcb..c67de82 100644 (file)
@@ -24,8 +24,8 @@ int main(int argc, char *argv[])
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   MPI_Comm_set_errhandler(dup, MPI_ERRORS_RETURN);
 
-  int* sb = xbt_new0(int, size * maxlen);
-  int* rb = xbt_new0(int, size * maxlen);
+  int* sb = (int*)calloc(size * maxlen, sizeof(int));
+  int* rb = (int*)calloc(size * maxlen, sizeof(int));
 
   for (int i = 0; i < size * maxlen; ++i) {
     sb[i] = rank*size + i;
@@ -38,9 +38,8 @@ int main(int argc, char *argv[])
     printf("all_to_all returned %d\n", status);
     fflush(stdout);
   }
-  //Do not free dup
-  xbt_free(sb);
-  xbt_free(rb);
+  //Do not free dup and rb
+  free(sb);
   MPI_Finalize();
   return (EXIT_SUCCESS);
 }
index ab2c29a..d4f8228 100644 (file)
@@ -20,7 +20,7 @@ $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -map -ho
 > [rank 14] -> Ginette
 > [rank 15] -> Ginette
 > If this is too much, consider sharing allocations for computation buffers.
-> Largest allocation at once from a single process was 64 bytes, at sysdep.h:59. It was called 32 times during the whole simulation.
+> Largest allocation at once from a single process was 64 bytes, at coll-allreduce-with-leaks.c:27. It was called 16 times during the whole simulation.
 > Running smpirun with -wrapper "valgrind --leak-check=full" can provide more information
 > This can be done automatically by setting --cfg=smpi/auto-shared-malloc-thresh to the minimum size wanted size (this can alter execution if data content is necessary)
 > [0.023768] [smpi_utils/INFO] Probable memory leaks in your code: SMPI detected 32 unfreed MPI handles : display types and addresses (n max) with --cfg=smpi/list-leaks:n.
@@ -35,6 +35,18 @@ $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -map -ho
 > [0.023768] [smpi_utils/INFO] Leaked handle of type MPI_Group at coll-allreduce-with-leaks.c:23
 > [0.023768] [smpi_utils/INFO] Leaked handle of type MPI_Comm at coll-allreduce-with-leaks.c:23
 > [0.023768] [smpi_utils/INFO] (more handle leaks hidden as you wanted to see only 10 of them)
+> [0.023768] [smpi_utils/INFO] Probable memory leaks in your code: SMPI detected 16 unfreed buffers : display types and addresses (n max) with --cfg=smpi/list-leaks:n.
+> Running smpirun with -wrapper "valgrind --leak-check=full" can provide more information
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] Leaked buffer of size 64, allocated in file coll-allreduce-with-leaks.c at line 28
+> [0.023768] [smpi_utils/INFO] (more buffer leaks hidden as you wanted to see only 10 of them)
 > [0.023768] [smpi_utils/INFO] Memory Usage: Simulated application allocated 2048 bytes during its lifetime through malloc/calloc calls.
 
-
index 51f0f52..7d60136 100644 (file)
@@ -18,8 +18,14 @@ $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -wrapper
 > [0.000000] [smpi_utils/INFO] Leaked handle of type MPI_Group
 > [0.000000] [smpi_utils/INFO] Leaked handle of type MPI_Comm
 > [0.000000] [smpi_utils/INFO] Leaked handle of type MPI_Group
+> [0.000000] [smpi_utils/INFO] Probable memory leaks in your code: SMPI detected 4 unfreed buffers : display types and addresses (n max) with --cfg=smpi/list-leaks:n.
+> Running smpirun with -wrapper "valgrind --leak-check=full" can provide more information
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
 > [0.000000] [smpi_utils/INFO] Memory Usage: Simulated application allocated 128 bytes during its lifetime through malloc/calloc calls.
-> Largest allocation at once from a single process was 16 bytes, at sysdep.h:59. It was called 8 times during the whole simulation.
+> Largest allocation at once from a single process was 16 bytes, at coll-allreduce-with-leaks.c:27. It was called 4 times during the whole simulation.
 > If this is too much, consider sharing allocations for computation buffers.
 > This can be done automatically by setting --cfg=smpi/auto-shared-malloc-thresh to the minimum size wanted size (this can alter execution if data content is necessary)
 > 
@@ -34,8 +40,14 @@ $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -wrapper
 > [0.000000] [smpi_utils/INFO] Leaked handle of type MPI_Group
 > [0.000000] [smpi_utils/INFO] Leaked handle of type MPI_Comm
 > [0.000000] [smpi_utils/INFO] Leaked handle of type MPI_Group
+> [0.000000] [smpi_utils/INFO] Probable memory leaks in your code: SMPI detected 4 unfreed buffers : display types and addresses (n max) with --cfg=smpi/list-leaks:n.
+> Running smpirun with -wrapper "valgrind --leak-check=full" can provide more information
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
+> [0.000000] [smpi_utils/INFO] Leaked buffer of size 16
 > [0.000000] [smpi_utils/INFO] Memory Usage: Simulated application allocated 128 bytes during its lifetime through malloc/calloc calls.
-> Largest allocation at once from a single process was 16 bytes, at sysdep.h:59. It was called 8 times during the whole simulation.
+> Largest allocation at once from a single process was 16 bytes, at coll-allreduce-with-leaks.c:27. It was called 4 times during the whole simulation.
 > If this is too much, consider sharing allocations for computation buffers.
 > This can be done automatically by setting --cfg=smpi/auto-shared-malloc-thresh to the minimum size wanted size (this can alter execution if data content is necessary)
 >