From bf0cac40808200be9f880a25d2c1b318d07b54e5 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 18 Mar 2021 14:13:08 +0100 Subject: [PATCH] test with leaks: no printf, and run also in MC (that is currently wrong) Currently, the MC test ensures that we still don't detect the leaks, but I don't want to break the builds while I'm working on this. --- teshsuite/smpi/CMakeLists.txt | 7 +++- .../coll-allreduce-with-leaks.c | 9 ----- .../coll-allreduce-with-leaks.tesh | 34 +------------------ .../mc-coll-allreduce-with-leaks.tesh | 14 ++++++++ 4 files changed, 21 insertions(+), 43 deletions(-) create mode 100644 teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index e1e67309f6..c8603d6849 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -15,7 +15,7 @@ if(enable_smpi) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) add_dependencies(tests ${x}) endforeach() - + if(NOT WIN32) foreach(x macro-shared auto-shared macro-partial-shared macro-partial-shared-communication ) add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c) @@ -146,6 +146,11 @@ if(enable_smpi) # Extra allreduce test : with leak : don't run on asan (and ignore leaks on valgrind) if (NOT HAVE_SANITIZER_ADDRESS) ADD_TESH(tesh-smpi-coll-allreduce-with-leaks --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce-with-leaks --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce-with-leaks ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh) + + if(enable_model-checking) + add_dependencies(tests-mc coll-allreduce-with-leaks) + ADD_TESH(tesh-mc-smpi-coll-allreduce-with-leaks --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce-with-leaks --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce-with-leaks ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh) + endif() endif() # Extra pt2pt pingpong test: broken usage ti-tracing diff --git a/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c b/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c index bd2f2a0a7b..41be157874 100644 --- a/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c +++ b/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c @@ -37,17 +37,8 @@ int main(int argc, char *argv[]) rb[i] = 0; } - printf("[%d] sndbuf=[", rank); - for (i = 0; i < size *mult; i++) - printf("%d ", sb[i]); - printf("]\n"); status = MPI_Allreduce(sb, rb, size *maxlen, MPI_INT, MPI_SUM, dup); - printf("[%d] rcvbuf=[", rank); - for (i = 0; i < size *mult; i++)//do not print everything - printf("%d ", rb[i]); - printf("]\n"); - if (rank == 0 && status != MPI_SUCCESS) { printf("all_to_all returned %d\n", status); fflush(stdout); diff --git a/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh b/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh index b41cdc47b8..464280add9 100644 --- a/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh +++ b/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh @@ -25,37 +25,5 @@ $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -map -ho > 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 31 unfreed MPI handles : display types and addresses (n max) with --cfg=smpi/list-leaks:n. > [0.023768] [smpi_utils/INFO] Memory Usage: Simulated application allocated 2048 bytes during its lifetime through malloc/calloc calls. -> [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ] -> [1] sndbuf=[16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ] -> [2] sndbuf=[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ] -> [3] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ] -> [4] sndbuf=[64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 ] -> [5] sndbuf=[80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ] -> [6] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 ] -> [7] sndbuf=[112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 ] -> [8] sndbuf=[128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 ] -> [9] sndbuf=[144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 ] -> [10] sndbuf=[160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 ] -> [11] sndbuf=[176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 ] -> [12] sndbuf=[192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 ] -> [13] sndbuf=[208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 ] -> [14] sndbuf=[224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 ] -> [15] sndbuf=[240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ] -> [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [1] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [2] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [3] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [4] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [5] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [6] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [7] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [8] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [9] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [10] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [11] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [12] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [13] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [14] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> [15] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] -> + diff --git a/teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh b/teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh new file mode 100644 index 0000000000..305b132e71 --- /dev/null +++ b/teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh @@ -0,0 +1,14 @@ +# Smpi Allreduce collectives tests +! output sort + +p Test allreduce +$ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" -map -hostfile ../hostfile_coll -platform ${platfdir:=.}/small_platform.xml -np 4 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce-with-leaks --log=smpi_config.thres:warning --cfg=smpi/display-analysis:yes --cfg=smpi/simulate-computation:no --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error +> [rank 0] -> Tremblay +> [rank 1] -> Tremblay +> [rank 2] -> Tremblay +> [rank 3] -> Tremblay +> [0.000000] [mc_safety/INFO] Check a safety property. Reduction is: dpor. +> [0.000000] [mc_safety/INFO] Executed transitions = 484 +> [0.000000] [mc_safety/INFO] Expanded states = 63 +> [0.000000] [mc_safety/INFO] No property violation found. +> [0.000000] [mc_safety/INFO] Visited states = 500 -- 2.20.1