Changes in / [9155026:99fb52c]
- Files:
-
- 50 deleted
- 2 edited
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Executor/AkkaExecutor.scala (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Executor/application.conf (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Executor/build.sbt (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Matrix/AkkaMatrix.scala (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Matrix/application.conf (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Matrix/build.sbt (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Repeat/AkkaRepeat.scala (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Repeat/application.conf (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/Repeat/build.sbt (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/SendDynamic/AkkaSendDynamic.scala (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/SendDynamic/application.conf (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/SendDynamic/build.sbt (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/SendStatic/AkkaSendStatic.scala (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/SendStatic/application.conf (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/akka/SendStatic/build.sbt (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/caf/CAFExecutor.cpp (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/caf/CAFMatrix.cpp (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/caf/CAFRepeat.cpp (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/caf/CAFSendDynamic.cpp (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/caf/CAFSendStatic.cpp (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/caf/caf-application.conf (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/balance.cfa (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/bench.hfa (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/dynamic.cfa (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/executor.cfa (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/matrix.cfa (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/repeat.cfa (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/static.cfa (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/plotData.py (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Executor/GoExecutor.go (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Executor/go.mod (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Executor/go.sum (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/INSTALL (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Matrix/GoMatrix.go (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Matrix/go.mod (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Matrix/go.sum (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Repeat/GoRepeat.go (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Repeat/go.mod (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/Repeat/go.sum (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/SendDynamic/GoSendDynamic.go (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/SendDynamic/go.mod (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/SendDynamic/go.sum (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/SendStatic/GoSendStatic.go (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/SendStatic/go.mod (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/proto/SendStatic/go.sum (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/run (modified) (10 diffs, 1 prop)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/ucpp/uC++Executor.cc (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/ucpp/uC++Matrix.cc (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/ucpp/uC++Repeat.cc (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/ucpp/uC++SendDynamic.cc (deleted)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/ucpp/uC++SendStatic.cc (deleted)
-
libcfa/src/concurrency/actor.hfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/run
-
Property mode
changed from
100755to100644
r9155026 r99fb52c 85 85 } 86 86 87 numtimes=5 88 89 # bench_cores='1 2 4 8 16 24 32' 90 bench_cores='8 16 24 32 48' 91 # bench_cores='32' 92 93 # toggle benchmarks 94 executor=${true} 95 matrix=${true} 96 repeat=${true} 97 balance=${true} 98 static=${false} 99 dynamic=${false} 100 87 101 # executor config 88 batch='1 00'89 nRounds=' 400' #500102 batch='1' 103 nRounds='500' 90 104 91 105 # matrix config 92 size='30 72'106 size='3000' 93 107 94 108 # repeat config 95 109 messages='100000' 96 n_repeats=' 200' #200110 n_repeats='100' 97 111 98 112 # balance config … … 101 115 102 116 # static config 103 n_static_sends='10000000 0'117 n_static_sends='10000000' 104 118 105 119 # dynamic config 106 n_dynamic_sends='20000000' 107 108 numtimes=5 109 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' 113 114 # toggle benchmarks 115 executor=${false} 116 matrix=${false} 117 repeat=${false} 118 balance=${false} 119 static=${true} 120 dynamic=${true} 121 122 # names=('CFA-LV' 'CFA-NS' 'CFA-R') 123 # var_flags=('-D__STEAL=1 -DSEARCH=1' '' '-D__STEAL=1 -DRAND=1') 124 125 # names=('CFA-NS') 126 # var_flags=('') 127 128 names=('CFA') 120 n_dynamic_sends='10000000' 121 122 # names=('NOSTEAL' 'CLOSE' 'SEARCH') 123 # var_flags=('-D__STEAL=1 -DRAND=1' '-D__STEAL=1 -DCLOSE=1' '-D__STEAL=1 -DSEARCH=1') 124 125 names=('SEARCH') 129 126 var_flags=('-D__STEAL=1 -DSEARCH=1') 130 127 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} 128 129 # names=('NOSTEAL' 'SEARCH' 'RAND' 'SEARCHC' 'RANDC') 130 # var_flags=('' '-D__STEAL=1 -DSEARCH=1' '-D__STEAL=1 -DRAND=1' '-D__STEAL=1 -DSEARCH=1 -DCYCLE' '-D__STEAL=1 -DRAND=1 -DCYCLE') 131 132 # names=('NOSTEAL' 'RAND' 'CLOSE' 'SEARCH') 133 # var_flags=('' '-D__STEAL=1 -DRAND=1' '-D__STEAL=1 -DCLOSE=1' '-D__STEAL=1 -DSEARCH=1') 134 135 cfa_flags='-quiet -O3 -nodebug -DNDEBUG' 145 136 146 137 cfa=~/cfa-cc/driver/cfa 147 138 148 # Helpers to minimize code duplication149 150 # repeats a command ${numtimes}151 139 preprint='' 152 140 repeat_command() { … … 159 147 } 160 148 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 } 190 191 arch # get hostname 192 193 # set up leading info for python script 149 arch nasus 150 194 151 echo $numtimes 195 152 echo $bench_cores … … 198 155 echo -n ${names[$i]}" " 199 156 done 200 if [ ${runCAF} -eq ${true} ] ; then201 echo -n 'CAF '202 fi # done CAF203 if [ ${runAKKA} -eq ${true} ] ; then204 echo -n 'Akka '205 fi # done AKKA206 if [ ${runUCPP} -eq ${true} ] ; then207 echo -n 'uC++ '208 fi # done UCPP209 if [ ${runPROTO} -eq ${true} ] ; then210 echo -n 'ProtoActor '211 fi212 157 echo "" 213 158 214 # done printing header info for output215 216 # cfa flags217 cfa_flags='-quiet -O3 -nodebug -DNDEBUG'218 219 # CAF flags220 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 flags224 sbtflags="--warn -J-Xmx32g"225 226 # UCPP flags227 UCPPflags="-quiet -g -Wall -Wextra -O3 -nodebug -DNDEBUG -multi"228 UCPP=~/ucpp/u++-7.0.0/bin/u++229 230 # run the benchmarks231 232 159 # /usr/bin/time -f "%Uu %Ss %Er %Mkb" 160 233 161 if [ ${executor} -eq ${true} ] ; then 234 162 echo "executor" 235 pre_args="40000 100 ${nRounds}" 236 post_args="${batch}" 237 cd cfa # CFA RUN 238 for i in ${!names[@]}; do 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 163 for i in ${!names[@]}; do 164 echo ${names[$i]}':' 165 echo -e "proc\ttime (s)" 166 ${cfa} ${cfa_flags} ${var_flags[$i]} executor.cfa > /dev/null 2>&1 249 167 for p in ${bench_cores} ; do 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} 264 affinity ${p} 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 267 done 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 168 affinity ${p} 169 # echo "taskset -c ${startcore}-`expr ${startcore} + ${p} - 1` ./a.out 40000 100 ${nRounds} ${p} ${batch}" 170 preprint="${p}\t" 171 repeat_command taskset -c ${taskset} ./a.out 40000 100 ${nRounds} ${p} ${batch} 172 done 173 rm a.out 174 done 288 175 echo "" 289 176 fi … … 291 178 if [ ${matrix} -eq ${true} ] ; then 292 179 echo "matrix" 293 pre_args="${size} ${size} ${size}" 294 post_args="" 295 cd cfa 296 for i in ${!names[@]}; do 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 180 for i in ${!names[@]}; do 181 echo ${names[$i]} 182 echo -e "proc\ttime (s)" 183 ${cfa} ${cfa_flags} ${var_flags[$i]} matrix.cfa > /dev/null 2>&1 307 184 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' 321 for p in ${bench_cores} ; do 322 set_akka_parallelism ${p} 323 affinity ${p} 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 326 done 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 185 affinity ${p} 186 preprint="${p}\t" 187 repeat_command taskset -c ${taskset} ./a.out ${size} ${size} ${size} ${p} 188 done 189 rm a.out 190 done 347 191 echo "" 348 192 fi … … 350 194 if [ ${repeat} -eq ${true} ] ; then 351 195 echo "repeat" 352 pre_args="${messages}" 353 post_args="${n_repeats}" 354 cd cfa 355 for i in ${!names[@]}; do 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} 382 affinity ${p} 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 385 done 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 196 echo -e "proc\ttime (s)" 197 for i in ${!names[@]}; do 198 echo ${names[$i]} 199 ${cfa} ${cfa_flags} ${var_flags[$i]} repeat.cfa > /dev/null 2>&1 200 for p in ${bench_cores} ; do 201 affinity ${p} 202 preprint="${p}\t" 203 repeat_command taskset -c ${taskset} ./a.out ${messages} ${p} 256 ${n_repeats} 204 done 205 rm a.out 206 done 406 207 echo "" 407 208 fi … … 410 211 if [ ${static} -eq ${true} ] ; then 411 212 echo "static" 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 213 for i in ${!names[@]}; do 214 echo ${names[$i]} 215 ${cfa} ${cfa_flags} ${var_flags[$i]} static.cfa > /dev/null 2>&1 216 repeat_command taskset -c ${startcore} ./a.out ${n_static_sends} 217 rm a.out 218 done 454 219 echo "" 455 220 fi … … 457 222 if [ ${dynamic} -eq ${true} ] ; then 458 223 echo "dynamic" 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 224 for i in ${!names[@]}; do 225 echo ${names[$i]} 226 ${cfa} ${cfa_flags} ${var_flags[$i]} dynamic.cfa > /dev/null 2>&1 227 repeat_command taskset -c ${startcore} ./a.out ${n_dynamic_sends} 228 done 500 229 echo "" 501 230 fi … … 503 232 504 233 if [ ${balance} -eq ${true} ] ; then 505 cd cfa506 234 echo "balance_one" 507 235 for i in ${!names[@]}; do 508 236 echo ${names[$i]}':' 509 237 echo -e "proc\ttime (s)" 510 ${cfa} ${cfa_flags} ${var_flags[$i]} balance.cfa -o a.${hostname}> /dev/null 2>&1238 ${cfa} ${cfa_flags} ${var_flags[$i]} balance.cfa > /dev/null 2>&1 511 239 for p in ${bench_cores} ; do 512 240 affinity ${p} 513 241 preprint="${p}\t" 514 repeat_command taskset -c ${taskset} ./a. ${hostname}32 32 ${nOneRounds} ${p}515 done 516 rm a. ${hostname}242 repeat_command taskset -c ${taskset} ./a.out 32 32 ${nOneRounds} ${p} 243 done 244 rm a.out 517 245 done 518 246 echo "" … … 521 249 echo ${names[$i]}':' 522 250 echo -e "proc\ttime (s)" 523 ${cfa} ${cfa_flags} ${var_flags[$i]} -DMULTI balance.cfa -o a.${hostname}> /dev/null 2>&1251 ${cfa} ${cfa_flags} ${var_flags[$i]} -DMULTI balance.cfa > /dev/null 2>&1 524 252 for p in ${bench_cores} ; do 525 253 affinity ${p} 526 254 preprint="${p}\t" 527 repeat_command taskset -c ${taskset} ./a.${hostname} 32 32 ${nMultiRounds} ${p} 528 done 529 rm a.${hostname} 530 done 531 echo "" 532 cd - > /dev/null 533 fi 534 255 repeat_command taskset -c ${taskset} ./a.out 32 32 ${nMultiRounds} ${p} 256 done 257 rm a.out 258 done 259 echo "" 260 fi 261 -
Property mode
changed from
-
libcfa/src/concurrency/actor.hfa
r9155026 r99fb52c 371 371 372 372 // this is a static field of executor but have to forward decl for get_next_ticket 373 static size_t __next_ticket = 0; 374 375 static inline size_t __get_next_ticket( executor & this ) with(this) { 376 #ifdef __CFA_DEBUG__ 377 size_t temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues; 373 static unsigned long int __next_ticket = 0; 374 375 static inline unsigned long int __get_next_ticket( executor & this ) with(this) { 376 unsigned long int temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues; 378 377 379 378 // reserve MAX for dead actors 380 if ( unlikely( temp == MAX )) temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues;379 if ( temp == MAX ) temp = __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_SEQ_CST) % nrqueues; 381 380 return temp; 382 #else383 return __atomic_fetch_add( &__next_ticket, 1, __ATOMIC_RELAXED) % nrqueues;384 #endif385 381 } // tickets 386 382 … … 388 384 static executor * __actor_executor_ = 0p; 389 385 static bool __actor_executor_passed = false; // was an executor passed to start_actor_system 390 static size_t __num_actors_ = 0; // number of actor objects in system386 static unsigned long int __num_actors_ = 0; // number of actor objects in system 391 387 static struct thread$ * __actor_executor_thd = 0p; // used to wake executor after actors finish 392 388 struct actor { 393 size_t ticket; // executor-queue handle389 unsigned long int ticket; // executor-queue handle 394 390 Allocation allocation_; // allocation action 395 391 }; 396 392 397 static inline void ?{}( actor & this ) with(this){393 static inline void ?{}( actor & this ) { 398 394 // Once an actor is allocated it must be sent a message or the actor system cannot stop. Hence, its receive 399 395 // member must be called to end it 400 396 verifyf( __actor_executor_, "Creating actor before calling start_actor_system() can cause undefined behaviour.\n" ); 401 allocation_ = Nodelete;402 t icket = __get_next_ticket( *__actor_executor_ );403 __atomic_fetch_add( &__num_actors_, 1, __ATOMIC_ RELAXED);397 this.allocation_ = Nodelete; 398 this.ticket = __get_next_ticket( *__actor_executor_ ); 399 __atomic_fetch_add( &__num_actors_, 1, __ATOMIC_SEQ_CST ); 404 400 #ifdef STATS 405 401 __atomic_fetch_add( &__num_actors_stats, 1, __ATOMIC_SEQ_CST ); … … 422 418 } 423 419 424 if ( unlikely( __atomic_add_fetch( &__num_actors_, -1, __ATOMIC_ RELAXED) == 0 ) ) { // all actors have terminated420 if ( unlikely( __atomic_add_fetch( &__num_actors_, -1, __ATOMIC_SEQ_CST ) == 0 ) ) { // all actors have terminated 425 421 unpark( __actor_executor_thd ); 426 422 } … … 434 430 static inline void ?{}( message & this ) { this.allocation_ = Nodelete; } 435 431 static inline void ?{}( message & this, Allocation allocation ) { 436 memcpy( &this.allocation_, &allocation, sizeof(allocation) ); // optimization to elide ctor432 this.allocation_ = allocation; 437 433 verifyf( this.allocation_ != Finished, "The Finished Allocation status is not supported for message types.\n"); 438 434 } … … 459 455 460 456 static inline void deliver_request( request & this ) { 461 this.receiver->allocation_ = this.fn( *this.receiver, *this.msg ); 457 Allocation actor_allocation = this.fn( *this.receiver, *this.msg ); 458 this.receiver->allocation_ = actor_allocation; 462 459 check_actor( *this.receiver ); 463 460 check_message( *this.msg ); … … 572 569 unsigned int empty_count = 0; 573 570 request & req; 571 unsigned int curr_idx; 574 572 work_queue * curr_work_queue; 575 573 576 574 Exit: 577 575 for ( unsigned int i = 0;; i = (i + 1) % range ) { // cycle through set of request buffers 578 curr_work_queue = request_queues[i + start]; 576 curr_idx = i + start; 577 curr_work_queue = request_queues[curr_idx]; 579 578 580 579 // check if queue is empty before trying to gulp it
Note:
See TracChangeset
for help on using the changeset viewer.