[601bd9e] | 1 | #!/bin/bash - |
---|
| 2 | |
---|
| 3 | false=0; true=1 |
---|
| 4 | |
---|
| 5 | # Usage: arch [ hostname ] returns hostname, cores, startcore |
---|
| 6 | # |
---|
| 7 | # Define machine architecture based on starting socket, CPUs (cores) per socket, number of |
---|
| 8 | # sockets, has hyperthreading. |
---|
| 9 | |
---|
| 10 | start=0 |
---|
| 11 | |
---|
| 12 | arch() { |
---|
| 13 | hostname=${1:-`hostname`} # return value |
---|
| 14 | hashyper=${true} # assume machine has hyperthreads |
---|
| 15 | if [ "${hostname}" = "plg2" ] ; then |
---|
| 16 | startsocket=${start} |
---|
| 17 | cps=16 # coresPerSocket |
---|
| 18 | sockets=2 |
---|
| 19 | hashyper=${false} # has no hyperthreads |
---|
| 20 | elif [ "${hostname}" = "nasus" ] ; then |
---|
| 21 | startsocket=${start} |
---|
| 22 | cps=64 # coresPerSocket |
---|
| 23 | sockets=2 |
---|
| 24 | elif [ "${hostname}" = "pyke" ] ; then |
---|
| 25 | startsocket=${start} |
---|
| 26 | cps=24 # coresPerSocket |
---|
| 27 | sockets=2 |
---|
| 28 | elif [ "${hostname}" = "jax" ] ; then |
---|
| 29 | startsocket=${start} |
---|
| 30 | cps=24 # coresPerSocket |
---|
| 31 | sockets=4 |
---|
| 32 | else |
---|
| 33 | echo "unsupported host" ${hostname} |
---|
| 34 | exit 1 |
---|
| 35 | fi |
---|
| 36 | cores=$(( ${cps} * ${sockets} )) |
---|
| 37 | startcore=$(( ${startsocket} * ${cps} )) |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | # Usage: affinity (global cps, sockets, startsocket, hashyper, cores, startcore, wrap) |
---|
| 41 | # returns taskset argument |
---|
| 42 | # |
---|
| 43 | # This routine assumes hyperthreading has only 2 hyperthreads per core. |
---|
| 44 | # |
---|
| 45 | # If hyperthread scanning is used: processor units are assigned across the low-number hyperthreads |
---|
| 46 | # of the socket's cores. When the low-number hyperthreads are filled, the high-number hyperhtreads |
---|
| 47 | # are assigned across the socket's cores. Then the next socket is assigned. |
---|
| 48 | # |
---|
| 49 | # If hyperthread wrapping is used: processor units are assigned in low/high-number pairs of |
---|
| 50 | # hyperthreads across the socket's cores. Then the next socket is assigned. |
---|
| 51 | |
---|
| 52 | wrap=${false} # set to control hyperthread assignment across socket cores |
---|
| 53 | |
---|
| 54 | affinity() { |
---|
| 55 | if [ ${wrap} -eq ${true} -a ${hashyper} -eq ${false} ] ; then |
---|
| 56 | echo "architecture does not support hyperthreading for wrapping" |
---|
| 57 | exit 1 |
---|
| 58 | fi |
---|
| 59 | taskset="" # return value |
---|
| 60 | set -- $(( ${1} - 1 )) # decrement $1 |
---|
| 61 | if [ ${1} -eq 0 ] ; then taskset="${startcore}-${startcore}"; return; fi |
---|
| 62 | if [ ${1} -ge $(( ${cps} * ( ${sockets} - ${startsocket} ) * ( ${hashyper} + 1 ) )) ] ; then # error |
---|
| 63 | echo "not enough cores $(( ${cores} * ${sockets} )) for $(( ${1} + 1 )) starting at ${startcore}" |
---|
| 64 | exit 1 |
---|
| 65 | fi |
---|
| 66 | if [ ${hashyper} -eq ${false} ] ; then taskset="${startcore}-$(( ${1} + ${startcore} ))"; return; fi # no hyperthreads |
---|
| 67 | start2=$(( ${startcore} + ${cores} )) |
---|
| 68 | if [ ${wrap} -eq ${true} ] ; then # hyperthread wrapping |
---|
| 69 | end1=$(( ${1} / 2 + ${startcore} )) |
---|
| 70 | end2=$(( ${end1} + ${cores} )) |
---|
| 71 | if [ $(( ${1} % 2 )) -eq 0 ] ; then |
---|
| 72 | end2=$(( ${end2} - 1 )) |
---|
| 73 | fi |
---|
| 74 | taskset="${startcore}-${end1},${start2}-${end2}" |
---|
| 75 | else # hyperthread scanning |
---|
| 76 | if [ ${1} -lt ${cps} ] ; then taskset="${startcore}-$(( ${1} + ${startcore} ))"; return; fi |
---|
| 77 | filled=$(( ${1} / ( ${cps} * 2 ) * ${cps} )) |
---|
| 78 | modulus=$(( ${1} % ( ${cps} * 2 ) )) # leftover cores added to saturated sockets |
---|
| 79 | if [ ${modulus} -gt ${cps} ] ; then |
---|
| 80 | taskset="${startcore}-$(( ${startcore} + ${filled} + ${cps} - 1 )),${start2}-$(( ${start2} + ${filled} + ${modulus} % ${cps} ))" |
---|
| 81 | else |
---|
| 82 | taskset="${startcore}-$(( ${startcore} + ${filled} + ${modulus} )),${start2}-$(( ${start2} + ${filled} - 1 ))" |
---|
| 83 | fi |
---|
| 84 | fi |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | # executor config |
---|
[ab81e3b] | 88 | batch='100' |
---|
| 89 | nRounds='400' #500 |
---|
[601bd9e] | 90 | |
---|
| 91 | # matrix config |
---|
[ab81e3b] | 92 | size='3072' |
---|
[601bd9e] | 93 | |
---|
| 94 | # repeat config |
---|
| 95 | messages='100000' |
---|
[ab81e3b] | 96 | n_repeats='200' #200 |
---|
[601bd9e] | 97 | |
---|
| 98 | # balance config |
---|
| 99 | nOneRounds='2000' |
---|
| 100 | nMultiRounds='800' |
---|
| 101 | |
---|
| 102 | # static config |
---|
[ab81e3b] | 103 | n_static_sends='100000000' |
---|
[601bd9e] | 104 | |
---|
| 105 | # dynamic config |
---|
[ab81e3b] | 106 | n_dynamic_sends='20000000' |
---|
[601bd9e] | 107 | |
---|
[ab81e3b] | 108 | numtimes=5 |
---|
[601bd9e] | 109 | |
---|
[ab81e3b] | 110 | # bench_cores='1 2 4 8 16 24 32' |
---|
| 111 | # bench_cores='1 2 4 8 16 24 32 48' |
---|
| 112 | bench_cores='48' |
---|
[601bd9e] | 113 | |
---|
[ab81e3b] | 114 | # toggle benchmarks |
---|
| 115 | executor=${false} |
---|
| 116 | matrix=${false} |
---|
| 117 | repeat=${false} |
---|
| 118 | balance=${false} |
---|
| 119 | static=${true} |
---|
| 120 | dynamic=${true} |
---|
[601bd9e] | 121 | |
---|
[ab81e3b] | 122 | # names=('CFA-LV' 'CFA-NS' 'CFA-R') |
---|
| 123 | # var_flags=('-D__STEAL=1 -DSEARCH=1' '' '-D__STEAL=1 -DRAND=1') |
---|
[601bd9e] | 124 | |
---|
[ab81e3b] | 125 | # names=('CFA-NS') |
---|
| 126 | # var_flags=('') |
---|
[601bd9e] | 127 | |
---|
[ab81e3b] | 128 | names=('CFA') |
---|
| 129 | var_flags=('-D__STEAL=1 -DSEARCH=1') |
---|
| 130 | |
---|
| 131 | # names=('CFA' 'CFA-STAT') |
---|
| 132 | # var_flags=('-D__STEAL=1 -DSEARCH=1' '-D__STEAL=1 -DSTATS') |
---|
| 133 | |
---|
| 134 | # names=() |
---|
| 135 | # var_flags=() |
---|
| 136 | |
---|
| 137 | runCAF=${true} |
---|
| 138 | runUCPP=${true} |
---|
| 139 | runPROTO=${true} |
---|
| 140 | runAKKA=${true} |
---|
| 141 | # runCAF=${false} |
---|
| 142 | # runUCPP=${false} |
---|
| 143 | # runPROTO=${false} |
---|
| 144 | # runAKKA=${false} |
---|
[601bd9e] | 145 | |
---|
| 146 | cfa=~/cfa-cc/driver/cfa |
---|
| 147 | |
---|
[ab81e3b] | 148 | # Helpers to minimize code duplication |
---|
| 149 | |
---|
| 150 | # repeats a command ${numtimes} |
---|
[601bd9e] | 151 | preprint='' |
---|
| 152 | repeat_command() { |
---|
| 153 | t=1 |
---|
| 154 | while [ ${t} -le ${numtimes} ] ; do |
---|
| 155 | echo -n -e ${preprint} |
---|
| 156 | "${@}" |
---|
| 157 | t=`expr ${t} + 1` |
---|
| 158 | done |
---|
| 159 | } |
---|
| 160 | |
---|
[ab81e3b] | 161 | # prints the leading info for a given run of a variant |
---|
| 162 | print_header() { |
---|
| 163 | echo ${1}':' |
---|
| 164 | echo -e "proc\ttime (s)" |
---|
| 165 | } |
---|
| 166 | |
---|
| 167 | # runs the current benchmark with provided args |
---|
| 168 | # only works for standard-run benchmarks (not Akka) |
---|
| 169 | # must split into pre and post args to be able to supply val of p |
---|
| 170 | pre_args='' |
---|
| 171 | post_args='' |
---|
| 172 | single_run() { |
---|
| 173 | affinity ${1} |
---|
| 174 | preprint="${1}\t" |
---|
| 175 | repeat_command taskset -c ${taskset} ./a.${hostname} ${pre_args} ${1} ${post_args} |
---|
| 176 | } |
---|
| 177 | |
---|
| 178 | # runs the current bench for all processor vals |
---|
| 179 | # works for standard benchs that dont need to set a config file (not Akka or CAF) |
---|
| 180 | run_bench() { |
---|
| 181 | for p in ${bench_cores} ; do |
---|
| 182 | single_run ${p} |
---|
| 183 | done |
---|
| 184 | } |
---|
| 185 | |
---|
| 186 | set_akka_parallelism() { |
---|
| 187 | sed -i "s/parallelism-min = .*/parallelism-min = ${1}/g" application.conf |
---|
| 188 | sed -i "s/parallelism-max = .*/parallelism-max = ${1}/g" application.conf |
---|
| 189 | } |
---|
[601bd9e] | 190 | |
---|
[ab81e3b] | 191 | arch # get hostname |
---|
| 192 | |
---|
| 193 | # set up leading info for python script |
---|
[601bd9e] | 194 | echo $numtimes |
---|
| 195 | echo $bench_cores |
---|
| 196 | |
---|
| 197 | for i in ${!names[@]}; do |
---|
| 198 | echo -n ${names[$i]}" " |
---|
| 199 | done |
---|
[ab81e3b] | 200 | if [ ${runCAF} -eq ${true} ] ; then |
---|
| 201 | echo -n 'CAF ' |
---|
| 202 | fi # done CAF |
---|
| 203 | if [ ${runAKKA} -eq ${true} ] ; then |
---|
| 204 | echo -n 'Akka ' |
---|
| 205 | fi # done AKKA |
---|
| 206 | if [ ${runUCPP} -eq ${true} ] ; then |
---|
| 207 | echo -n 'uC++ ' |
---|
| 208 | fi # done UCPP |
---|
| 209 | if [ ${runPROTO} -eq ${true} ] ; then |
---|
| 210 | echo -n 'ProtoActor ' |
---|
| 211 | fi |
---|
[601bd9e] | 212 | echo "" |
---|
| 213 | |
---|
[ab81e3b] | 214 | # done printing header info for output |
---|
| 215 | |
---|
| 216 | # cfa flags |
---|
| 217 | cfa_flags='-quiet -O3 -nodebug -DNDEBUG' |
---|
| 218 | |
---|
| 219 | # CAF flags |
---|
| 220 | prefixCAF='-O3 -Wall -std=c++17 -I/home/pabuhr/software/nasus/Actors/experiments/CAF/actor-framework/libcaf_core -I/home/pabuhr/software/nasus/Actors/experiments/CAF/actor-framework/libcaf_core/caf -I/home/pabuhr/software/nasus/Actors/experiments/CAF/actor-framework/build/libcaf_core -L/home/pabuhr/software/nasus/Actors/experiments/CAF/actor-framework/build/libcaf_core -L/home/pabuhr/software/nasus/Actors/experiments/CAF/actor-framework/build/libcaf_io' |
---|
| 221 | suffixCAF='-lcaf_io -lcaf_core -Wl,-rpath=CAF/actor-framework/build/libcaf_core' |
---|
| 222 | |
---|
| 223 | # AKKA flags |
---|
| 224 | sbtflags="--warn -J-Xmx32g" |
---|
| 225 | |
---|
| 226 | # UCPP flags |
---|
| 227 | UCPPflags="-quiet -g -Wall -Wextra -O3 -nodebug -DNDEBUG -multi" |
---|
| 228 | UCPP=~/ucpp/u++-7.0.0/bin/u++ |
---|
[601bd9e] | 229 | |
---|
[ab81e3b] | 230 | # run the benchmarks |
---|
| 231 | |
---|
| 232 | # /usr/bin/time -f "%Uu %Ss %Er %Mkb" |
---|
[601bd9e] | 233 | if [ ${executor} -eq ${true} ] ; then |
---|
| 234 | echo "executor" |
---|
[ab81e3b] | 235 | pre_args="40000 100 ${nRounds}" |
---|
| 236 | post_args="${batch}" |
---|
| 237 | cd cfa # CFA RUN |
---|
[601bd9e] | 238 | for i in ${!names[@]}; do |
---|
[ab81e3b] | 239 | print_header ${names[$i]} |
---|
| 240 | ${cfa} ${cfa_flags} ${var_flags[$i]} executor.cfa -o a.${hostname} > /dev/null 2>&1 |
---|
| 241 | run_bench |
---|
| 242 | rm a.${hostname} |
---|
| 243 | done |
---|
| 244 | cd - > /dev/null # done CFA |
---|
| 245 | if [ ${runCAF} -eq ${true} ] ; then # CAF RUN |
---|
| 246 | cd caf |
---|
| 247 | print_header 'CAF' |
---|
| 248 | g++ ${prefixCAF} CAFExecutor.cpp ${suffixCAF} -o a.${hostname} > /dev/null 2>&1 |
---|
[601bd9e] | 249 | for p in ${bench_cores} ; do |
---|
[ab81e3b] | 250 | sed -i "s/max-threads = .*/max-threads = ${p}/g" caf-application.conf # set CAF parallelism |
---|
| 251 | single_run ${p} |
---|
| 252 | done |
---|
| 253 | rm a.${hostname} |
---|
| 254 | # set back parallelism |
---|
| 255 | sed -i "s/max-threads = .*/max-threads = 1/g" caf-application.conf |
---|
| 256 | cd - > /dev/null |
---|
| 257 | fi # done CAF |
---|
| 258 | if [ ${runAKKA} -eq ${true} ] ; then # AKKA RUN |
---|
| 259 | cd akka/Executor |
---|
| 260 | rm -rf project target # random out of memory errors without this |
---|
| 261 | print_header 'Akka' |
---|
| 262 | for p in ${bench_cores} ; do |
---|
| 263 | set_akka_parallelism ${p} |
---|
[601bd9e] | 264 | affinity ${p} |
---|
[ab81e3b] | 265 | taskset -c ${taskset} sbt ${sbtflags} "run ${pre_args} ${p} ${post_args} ${numtimes}" 2>&1 | grep -v "SLF4J:" | grep -v "Slf4jLogger started" | sed -e "s/\x1b\[0J//" |
---|
| 266 | sbt clean > /dev/null |
---|
[601bd9e] | 267 | done |
---|
[ab81e3b] | 268 | # set back parallelism |
---|
| 269 | set_akka_parallelism 1 |
---|
| 270 | cd - > /dev/null |
---|
| 271 | fi # done AKKA |
---|
| 272 | if [ ${runUCPP} -eq ${true} ] ; then # UCPP RUN |
---|
| 273 | cd ucpp |
---|
| 274 | print_header 'uC++' |
---|
| 275 | ${UCPP} ${UCPPflags} uC++Executor.cc -o a.${hostname} > /dev/null 2>&1 |
---|
| 276 | run_bench |
---|
| 277 | rm a.${hostname} |
---|
| 278 | cd - > /dev/null |
---|
| 279 | fi # done UCPP |
---|
| 280 | if [ ${runPROTO} -eq ${true} ] ; then # PROTO RUN |
---|
| 281 | print_header 'ProtoActor' |
---|
| 282 | cd proto/Executor |
---|
| 283 | go build -o a.${hostname} > /dev/null 2>&1 |
---|
| 284 | run_bench |
---|
| 285 | rm a.${hostname} |
---|
| 286 | cd - > /dev/null |
---|
| 287 | fi # done PROTO |
---|
[601bd9e] | 288 | echo "" |
---|
| 289 | fi |
---|
| 290 | |
---|
| 291 | if [ ${matrix} -eq ${true} ] ; then |
---|
| 292 | echo "matrix" |
---|
[ab81e3b] | 293 | pre_args="${size} ${size} ${size}" |
---|
| 294 | post_args="" |
---|
| 295 | cd cfa |
---|
[601bd9e] | 296 | for i in ${!names[@]}; do |
---|
[ab81e3b] | 297 | print_header ${names[$i]} |
---|
| 298 | ${cfa} ${cfa_flags} ${var_flags[$i]} matrix.cfa -o a.${hostname} > /dev/null 2>&1 |
---|
| 299 | run_bench |
---|
| 300 | rm a.${hostname} |
---|
| 301 | done |
---|
| 302 | cd - > /dev/null |
---|
| 303 | if [ ${runCAF} -eq ${true} ] ; then # CAF RUN |
---|
| 304 | cd caf |
---|
| 305 | print_header 'CAF' |
---|
| 306 | g++ ${prefixCAF} CAFMatrix.cpp ${suffixCAF} -o a.${hostname} > /dev/null 2>&1 |
---|
| 307 | for p in ${bench_cores} ; do |
---|
| 308 | sed -i "s/max-threads = .*/max-threads = ${p}/g" caf-application.conf # set CAF parallelism |
---|
| 309 | single_run ${p} |
---|
| 310 | done |
---|
| 311 | rm a.${hostname} |
---|
| 312 | |
---|
| 313 | # set back parallelism |
---|
| 314 | sed -i "s/max-threads = .*/max-threads = 1/g" caf-application.conf |
---|
| 315 | cd - > /dev/null |
---|
| 316 | fi # done CAF |
---|
| 317 | if [ ${runAKKA} -eq ${true} ] ; then # AKKA RUN |
---|
| 318 | cd akka/Matrix |
---|
| 319 | rm -rf project target # random out of memory errors without this |
---|
| 320 | print_header 'Akka' |
---|
[601bd9e] | 321 | for p in ${bench_cores} ; do |
---|
[ab81e3b] | 322 | set_akka_parallelism ${p} |
---|
[601bd9e] | 323 | affinity ${p} |
---|
[ab81e3b] | 324 | repeat_command taskset -c ${taskset} sbt ${sbtflags} "run ${pre_args} ${p}" 2>&1 | grep -v "SLF4J:" | grep -v "Slf4jLogger started" | sed -e "s/\x1b\[0J//" |
---|
| 325 | sbt clean > /dev/null |
---|
[601bd9e] | 326 | done |
---|
[ab81e3b] | 327 | # set back parallelism |
---|
| 328 | set_akka_parallelism 1 |
---|
| 329 | cd - > /dev/null |
---|
| 330 | fi # done AKKA |
---|
| 331 | if [ ${runUCPP} -eq ${true} ] ; then # UCPP RUN |
---|
| 332 | cd ucpp |
---|
| 333 | print_header 'uC++' |
---|
| 334 | ${UCPP} ${UCPPflags} uC++Matrix.cc -o a.${hostname} > /dev/null 2>&1 |
---|
| 335 | run_bench |
---|
| 336 | rm a.${hostname} |
---|
| 337 | cd - > /dev/null |
---|
| 338 | fi # done UCPP |
---|
| 339 | if [ ${runPROTO} -eq ${true} ] ; then # PROTO RUN |
---|
| 340 | cd proto/Matrix |
---|
| 341 | print_header 'ProtoActor' |
---|
| 342 | go build -o a.${hostname} > /dev/null 2>&1 |
---|
| 343 | run_bench |
---|
| 344 | rm a.${hostname} |
---|
| 345 | cd - > /dev/null |
---|
| 346 | fi # done PROTO |
---|
[601bd9e] | 347 | echo "" |
---|
| 348 | fi |
---|
| 349 | |
---|
| 350 | if [ ${repeat} -eq ${true} ] ; then |
---|
| 351 | echo "repeat" |
---|
[ab81e3b] | 352 | pre_args="${messages}" |
---|
| 353 | post_args="${n_repeats}" |
---|
| 354 | cd cfa |
---|
[601bd9e] | 355 | for i in ${!names[@]}; do |
---|
[ab81e3b] | 356 | print_header ${names[$i]} |
---|
| 357 | ${cfa} ${cfa_flags} ${var_flags[$i]} repeat.cfa -o a.${hostname} > /dev/null 2>&1 |
---|
| 358 | run_bench |
---|
| 359 | rm a.${hostname} |
---|
| 360 | done |
---|
| 361 | cd - > /dev/null |
---|
| 362 | if [ ${runCAF} -eq ${true} ] ; then # CAF RUN |
---|
| 363 | cd caf |
---|
| 364 | print_header 'CAF' |
---|
| 365 | g++ ${prefixCAF} CAFRepeat.cpp ${suffixCAF} -o a.${hostname} > /dev/null 2>&1 |
---|
| 366 | for p in ${bench_cores} ; do |
---|
| 367 | sed -i "s/max-threads = .*/max-threads = ${p}/g" caf-application.conf # set CAF parallelism |
---|
| 368 | single_run ${p} |
---|
| 369 | done |
---|
| 370 | rm a.${hostname} |
---|
| 371 | |
---|
| 372 | # set back parallelism |
---|
| 373 | sed -i "s/max-threads = .*/max-threads = 1/g" caf-application.conf |
---|
| 374 | cd - > /dev/null |
---|
| 375 | fi # done CAF |
---|
| 376 | if [ ${runAKKA} -eq ${true} ] ; then # AKKA RUN |
---|
| 377 | cd akka/Repeat |
---|
| 378 | rm -rf project target # random out of memory errors without this |
---|
| 379 | print_header 'Akka' |
---|
| 380 | for p in ${bench_cores} ; do |
---|
| 381 | set_akka_parallelism ${p} |
---|
[601bd9e] | 382 | affinity ${p} |
---|
[ab81e3b] | 383 | repeat_command taskset -c ${taskset} sbt ${sbtflags} "run ${pre_args} ${p} ${post_args}" 2>&1 | grep -v "SLF4J:" | grep -v "Slf4jLogger started" | sed -e "s/\x1b\[0J//" |
---|
| 384 | sbt clean > /dev/null |
---|
[601bd9e] | 385 | done |
---|
[ab81e3b] | 386 | # set back parallelism |
---|
| 387 | set_akka_parallelism 1 |
---|
| 388 | cd - > /dev/null |
---|
| 389 | fi # done AKKA |
---|
| 390 | if [ ${runUCPP} -eq ${true} ] ; then # UCPP RUN |
---|
| 391 | cd ucpp |
---|
| 392 | print_header 'uC++' |
---|
| 393 | ${UCPP} ${UCPPflags} uC++Repeat.cc -o a.${hostname} > /dev/null 2>&1 |
---|
| 394 | run_bench |
---|
| 395 | rm a.${hostname} |
---|
| 396 | cd - > /dev/null |
---|
| 397 | fi # done UCPP |
---|
| 398 | if [ ${runPROTO} -eq ${true} ] ; then # PROTO RUN |
---|
| 399 | print_header 'ProtoActor' |
---|
| 400 | cd proto/Repeat |
---|
| 401 | go build -o a.${hostname} > /dev/null 2>&1 |
---|
| 402 | run_bench |
---|
| 403 | rm a.${hostname} |
---|
| 404 | cd - > /dev/null |
---|
| 405 | fi # done PROTO |
---|
[601bd9e] | 406 | echo "" |
---|
| 407 | fi |
---|
| 408 | |
---|
| 409 | |
---|
| 410 | if [ ${static} -eq ${true} ] ; then |
---|
| 411 | echo "static" |
---|
[ab81e3b] | 412 | preprint='' |
---|
| 413 | cd cfa |
---|
| 414 | for i in ${!names[@]}; do |
---|
| 415 | echo ${names[$i]} |
---|
| 416 | ${cfa} ${cfa_flags} ${var_flags[$i]} static.cfa -o a.${hostname} > /dev/null 2>&1 |
---|
| 417 | repeat_command taskset -c ${startcore} ./a.${hostname} ${n_static_sends} |
---|
| 418 | rm a.${hostname} |
---|
| 419 | done |
---|
| 420 | cd - > /dev/null |
---|
| 421 | if [ ${runCAF} -eq ${true} ] ; then # CAF RUN |
---|
| 422 | cd caf |
---|
| 423 | echo 'CAF:' |
---|
| 424 | g++ ${prefixCAF} CAFSendStatic.cpp ${suffixCAF} -o a.${hostname} > /dev/null 2>&1 |
---|
| 425 | sed -i "s/max-threads = .*/max-threads = 1/g" caf-application.conf # set CAF parallelism |
---|
| 426 | repeat_command taskset -c ${startcore} ./a.${hostname} 'd' |
---|
| 427 | rm a.${hostname} |
---|
| 428 | cd - > /dev/null |
---|
| 429 | fi # done CAF |
---|
| 430 | if [ ${runAKKA} -eq ${true} ] ; then # AKKA RUN |
---|
| 431 | cd akka/SendStatic |
---|
| 432 | rm -rf project target # random out of memory errors without this |
---|
| 433 | echo 'Akka:' |
---|
| 434 | set_akka_parallelism 1 |
---|
| 435 | taskset -c ${startcore} sbt ${sbtflags} "run ${n_static_sends} ${numtimes}" 2>&1 | grep -v "SLF4J:" | grep -v "Slf4jLogger started" | sed -e "s/\x1b\[0J//" |
---|
| 436 | cd - > /dev/null |
---|
| 437 | fi # done AKKA |
---|
| 438 | if [ ${runUCPP} -eq ${true} ] ; then # UCPP RUN |
---|
| 439 | cd ucpp |
---|
| 440 | echo 'uC++:' |
---|
| 441 | ${UCPP} ${UCPPflags} uC++SendStatic.cc -o a.${hostname} > /dev/null 2>&1 |
---|
| 442 | repeat_command taskset -c ${startcore} ./a.${hostname} ${n_static_sends} |
---|
| 443 | rm a.${hostname} |
---|
| 444 | cd - > /dev/null |
---|
| 445 | fi # done UCPP |
---|
| 446 | if [ ${runPROTO} -eq ${true} ] ; then # PROTO RUN |
---|
| 447 | cd proto/SendStatic |
---|
| 448 | echo 'ProtoActor:' |
---|
| 449 | go build -o a.${hostname} > /dev/null 2>&1 |
---|
| 450 | repeat_command taskset -c ${startcore} ./a.${hostname} ${n_static_sends} |
---|
| 451 | rm a.${hostname} |
---|
| 452 | cd - > /dev/null |
---|
| 453 | fi # done PROTO |
---|
[601bd9e] | 454 | echo "" |
---|
| 455 | fi |
---|
| 456 | |
---|
| 457 | if [ ${dynamic} -eq ${true} ] ; then |
---|
| 458 | echo "dynamic" |
---|
[ab81e3b] | 459 | cd cfa |
---|
| 460 | for i in ${!names[@]}; do |
---|
| 461 | echo ${names[$i]} |
---|
| 462 | ${cfa} ${cfa_flags} ${var_flags[$i]} dynamic.cfa -o a.${hostname} > /dev/null 2>&1 |
---|
| 463 | repeat_command taskset -c ${startcore} ./a.${hostname} ${n_dynamic_sends} |
---|
| 464 | rm a.${hostname} |
---|
| 465 | done |
---|
| 466 | cd - > /dev/null |
---|
| 467 | if [ ${runCAF} -eq ${true} ] ; then # CAF RUN |
---|
| 468 | cd caf |
---|
| 469 | echo 'CAF:' |
---|
| 470 | g++ ${prefixCAF} CAFSendDynamic.cpp ${suffixCAF} -o a.${hostname} > /dev/null 2>&1 |
---|
| 471 | sed -i "s/max-threads = .*/max-threads = 1/g" caf-application.conf # set CAF parallelism |
---|
| 472 | repeat_command taskset -c ${startcore} ./a.${hostname} 'd' |
---|
| 473 | rm a.${hostname} |
---|
| 474 | cd - > /dev/null |
---|
| 475 | fi # done CAF |
---|
| 476 | if [ ${runAKKA} -eq ${true} ] ; then # AKKA RUN |
---|
| 477 | cd akka/SendDynamic |
---|
| 478 | rm -rf project target # random out of memory errors without this |
---|
| 479 | echo 'Akka:' |
---|
| 480 | set_akka_parallelism 1 |
---|
| 481 | taskset -c ${startcore} sbt ${sbtflags} "run d ${numtimes}" 2>&1 | grep -v "SLF4J:" | grep -v "Slf4jLogger started" | sed -e "s/\x1b\[0J//" |
---|
| 482 | cd - > /dev/null |
---|
| 483 | fi # done AKKA |
---|
| 484 | if [ ${runUCPP} -eq ${true} ] ; then # UCPP RUN |
---|
| 485 | cd ucpp |
---|
| 486 | echo 'uC++:' |
---|
| 487 | ${UCPP} ${UCPPflags} uC++SendDynamic.cc -o a.${hostname} > /dev/null 2>&1 |
---|
| 488 | repeat_command taskset -c ${startcore} ./a.${hostname} ${n_dynamic_sends} |
---|
| 489 | rm a.${hostname} |
---|
| 490 | cd - > /dev/null |
---|
| 491 | fi # done UCPP |
---|
| 492 | if [ ${runPROTO} -eq ${true} ] ; then # PROTO RUN |
---|
| 493 | cd proto/SendDynamic |
---|
| 494 | echo 'ProtoActor:' |
---|
| 495 | go build -o a.${hostname} > /dev/null 2>&1 |
---|
| 496 | repeat_command taskset -c ${startcore} ./a.${hostname} 'd' |
---|
| 497 | rm a.${hostname} |
---|
| 498 | cd - > /dev/null |
---|
| 499 | fi # done PROTO |
---|
[601bd9e] | 500 | echo "" |
---|
| 501 | fi |
---|
| 502 | |
---|
| 503 | |
---|
| 504 | if [ ${balance} -eq ${true} ] ; then |
---|
[ab81e3b] | 505 | cd cfa |
---|
[601bd9e] | 506 | echo "balance_one" |
---|
| 507 | for i in ${!names[@]}; do |
---|
| 508 | echo ${names[$i]}':' |
---|
| 509 | echo -e "proc\ttime (s)" |
---|
[ab81e3b] | 510 | ${cfa} ${cfa_flags} ${var_flags[$i]} balance.cfa -o a.${hostname} > /dev/null 2>&1 |
---|
[601bd9e] | 511 | for p in ${bench_cores} ; do |
---|
| 512 | affinity ${p} |
---|
| 513 | preprint="${p}\t" |
---|
[ab81e3b] | 514 | repeat_command taskset -c ${taskset} ./a.${hostname} 32 32 ${nOneRounds} ${p} |
---|
[601bd9e] | 515 | done |
---|
[ab81e3b] | 516 | rm a.${hostname} |
---|
[601bd9e] | 517 | done |
---|
| 518 | echo "" |
---|
| 519 | echo "balance_multi" |
---|
| 520 | for i in ${!names[@]}; do |
---|
| 521 | echo ${names[$i]}':' |
---|
| 522 | echo -e "proc\ttime (s)" |
---|
[ab81e3b] | 523 | ${cfa} ${cfa_flags} ${var_flags[$i]} -DMULTI balance.cfa -o a.${hostname} > /dev/null 2>&1 |
---|
[601bd9e] | 524 | for p in ${bench_cores} ; do |
---|
| 525 | affinity ${p} |
---|
| 526 | preprint="${p}\t" |
---|
[ab81e3b] | 527 | repeat_command taskset -c ${taskset} ./a.${hostname} 32 32 ${nMultiRounds} ${p} |
---|
[601bd9e] | 528 | done |
---|
[ab81e3b] | 529 | rm a.${hostname} |
---|
[601bd9e] | 530 | done |
---|
| 531 | echo "" |
---|
[ab81e3b] | 532 | cd - > /dev/null |
---|
[601bd9e] | 533 | fi |
---|
| 534 | |
---|