diff --git a/.gitignore b/.gitignore index c653415..f75b796 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ vignettes/*.pdf .httr-oauth cpuinfo +hosts-list.txt +ssh/rsa.key diff --git a/README.md b/README.md index da619d2..6774470 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# blas-lapack-benchmark +# blasbenchmarks diff --git a/master-ctrl-slaves.sh b/master-ctrl-slaves.sh new file mode 100644 index 0000000..f3053a1 --- /dev/null +++ b/master-ctrl-slaves.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +SSH_OPTIONS="-o ConnectTimeout=5 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -q" +SSH_KEY_PRIV="rsa.key" +BENCHMARK_TEST="sample" + +function configure_hosts { + + echo "* Configuring hosts:" + + for host in `cat hosts-list.txt` + do + echo -n "${host} ... " + + echo -n "config-push " + scp ${SSH_OPTIONS} -i ssh/${SSH_KEY_PRIV} slave-cmds.sh cpuinfo sample-benchmark.R R-benchmark-25.R revolution-benchmark.R root@${host}:/root + ret=$? + if [ $ret -ne 0 ] ; then + echo "error $ret"; continue + fi + + echo "config-run " + { ssh ${SSH_OPTIONS} -i ssh/${SSH_KEY_PRIV} root@${host} 'bash slave-cmds.sh mro_install netlib_install atlas_st_install openblas_install atlas_mt_install gotoblas2_install mkl_install blis_install cublas_install > install.log 2>&1' ; + scp ${SSH_OPTIONS} -i ssh/${SSH_KEY_PRIV} root@${host}:/root/install.log install-${host}.log; + echo "${host} finished" ; } & + + done + + while true + do + runningjobs=$(jobs -rp | wc -l) + if [ $runningjobs -eq 0 ] ; then + break + fi + curtim=`date +"%T"` + echo "* [$curtim] Waiting for $runningjobs hosts..." + sleep 5 + done + + echo "* All hosts configured" + +} + +function benchmark { + + echo "* Benchmark: ${BENCHMARK_TEST}" + + for host in `cat hosts-list.txt` + do + echo -n "${host} ... " + + echo "benchmark-run " + { ssh ${SSH_OPTIONS} -i ssh/${SSH_KEY_PRIV} root@${host} "bash slave-cmds.sh test_${BENCHMARK_TEST} netlib_check atlas_st_check openblas_check atlas_mt_check gotoblas2_check mkl_check blis_check cublas_check > test-${BENCHMARK_TEST}.log 2>&1" ; + scp ${SSH_OPTIONS} -i ssh/${SSH_KEY_PRIV} root@${host}:/root/test-${BENCHMARK_TEST}.log test-${BENCHMARK_TEST}-${host}.log; + echo "${host} finished" ; } & + done + + while true + do + runningjobs=$(jobs -rp | wc -l) + if [ $runningjobs -eq 0 ] ; then + break + fi + curtim=`date +"%T"` + echo "* [$curtim] Waiting for $runningjobs hosts..." + sleep 5 + done + + echo "* All hosts finished benchmark ${BENCHMARK_TEST}" + +} + +############################################################## +############################################################## + +if [ $# -eq 0 ]; then + echo "No arguments supplied" +else + for i in "$@" + do + case "$i" in + configure_hosts) + configure_hosts + ;; + test_sample) + BENCHMARK_TEST="sample" + benchmark + ;; + test_urbanek) + BENCHMARK_TEST="urbanek" + benchmark + ;; + test_revolution) + BENCHMARK_TEST="revolution" + benchmark + ;; + *) + echo "unknown command" + esac + done +fi diff --git a/install-env.sh b/slave-cmds.sh similarity index 100% rename from install-env.sh rename to slave-cmds.sh