diff --git a/lhc/simpletrack/.simpletrack-ci.yml b/lhc/simpletrack/.simpletrack-ci.yml index 03790950ec9e59c753189fdd784be2fc3566d23b..b9266f6da68652e51b7461f47e90a5787cdef0ef 100644 --- a/lhc/simpletrack/.simpletrack-ci.yml +++ b/lhc/simpletrack/.simpletrack-ci.yml @@ -27,7 +27,7 @@ stages: name: test/$CI_COMMIT_REF_NAME script: [ "echo test" ] variables: - BENCHMARK: "device" + BENCHMARK: "all" artifacts: paths: - jobs/ diff --git a/lhc/simpletrack/CHANGELOG.md b/lhc/simpletrack/CHANGELOG.md index 89edc7ae064919340f61593d814bbed8eaffef70..bc0c5174076e1606ccd30c5ba22f22698e2746ef 100644 --- a/lhc/simpletrack/CHANGELOG.md +++ b/lhc/simpletrack/CHANGELOG.md @@ -1,7 +1,11 @@ # 0.2.0 (June 16th 2020) +FIXES: +* Using simpletrack device lists instead of clinfo. + FEATURES: * Added "benchmark" mode to run and generate json output for the runs. +* Generate yaml alongside the json summary. # 0.1.0 (June 13th 2020) diff --git a/lhc/simpletrack/README.md b/lhc/simpletrack/README.md index ce1e02534723fd9fa620d5480d056276563e0f6f..0d53384088105ffa918a053e57473b1bdcdebab1 100644 --- a/lhc/simpletrack/README.md +++ b/lhc/simpletrack/README.md @@ -1,6 +1,6 @@ # Overview -Docker images containing Simpletrack benchmark built a selection of GPU/CPU targets: +Docker images containing Simpletrack benchmark built for a selection of GPU/CPU targets: - __Intel__: contains [GPU NEO runtime](https://github.com/intel/compute-runtime) and OneAPI version i.e. DPC++ and SYCL support contains only the [OpenCL CPU runtimes](https://software.intel.com/content/www/us/en/develop/articles/opencl-drivers.html). - __Nvidia__: contains OpenCL runtime from [this](https://nvidia.github.io/nvidia-container-runtime/) repository. diff --git a/lhc/simpletrack/lhc-simpletrack.sh b/lhc/simpletrack/lhc-simpletrack.sh index 5e20cdbf1030a299ef1cc599b873ccc916e53660..98e1490610f6133a970bc9a37313156f30ddce23 100755 --- a/lhc/simpletrack/lhc-simpletrack.sh +++ b/lhc/simpletrack/lhc-simpletrack.sh @@ -23,6 +23,21 @@ function gen_devices() { done } +######################### +function get_devices() { +######################### + info="$(python3 benchmark_opencl.py -s)" + devices=`echo "$info" | grep "Device" | cut -d"'" -f2` + + for dev_id in $(seq 1 $(echo "$devices" | wc -l)) + do + id=`echo "$info" | grep "Device" | cut -d"'" -f2 | head -n $dev_id | tail -1 | xargs` + platform=`echo "$info" | grep "Device" | cut -d":" -f2 | head -n $dev_id | tail -1 | xargs` + name=`echo "$info" | grep "Platform" | cut -d":" -f2 | head -n $dev_id | tail -1 | xargs` + echo "\"device_id\":\"$id\",\"name\":\"$name\",\"platform\":\"$platform\"" + done +} + ######################### function log() { ######################### @@ -37,7 +52,7 @@ function log() { ########################## function run_benchmark() { ########################## - OUT=$(python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $1 2>&1 | tee $WORK_DIR/out.log) + OUT=$(python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $1 2>&1 | tee -a $WORK_DIR/out.log) RESULT=`echo "$OUT" | grep 'particles\*turns/seconds'` if [ "$RESULT" == "" ]; then log error "Failed to parse the output. Failed run?"; @@ -48,7 +63,14 @@ function run_benchmark() { function get_json() { ########################## dev_line=`echo "$DEVICES" | grep "\"device_id\":\"$1\""` - echo "{\"copies\":\"1\",\"threads_per_copy\":\"$TURNS\",\"events_per_thread\":\"$PARTICLES\",\"wl-scores\":{\"sim\":\"$2\"},\"device\":{$dev_line}}" + echo "{\"copies\":\"1\",\"threads_per_copy\":\"$TURNS\",\"events_per_thread\":\"$PARTICLES\",\"wl-scores\":{\"simpletrack\":\"$2\"},\"device\":{$dev_line}}" +} + +########################## +function get_yaml() { +########################## + dev_line=`echo "$DEVICES" | grep "\"device_id\":\"$1\""` + echo -e "- wl-scores: $2\n id: \"$1\"\n name: \"$(echo "$dev_line" | grep "device_id\":\"$1" | cut -d"\"" -f8)\"\n platform: \"$(echo "$dev_line" | grep "device_id\":\"$1" | cut -d"\"" -f12)\"" } ################################### @@ -65,7 +87,9 @@ CLINFO_OUT=`echo "$(clinfo | tee $WORK_DIR/clinfo.log)"` if [ `echo $CLINFO_OUT | grep 'Number of platforms' | awk '{print $4}'` -eq 0 ]; then log error "No platforms found. Exiting.."; fi -DEVICES="$(gen_devices | tee $WORK_DIR/devices.log)" +echo -e "args:\n number_of_particles: (p,$PARTICLES)\n number_of_turns: (t,$TURNS)\ndevice:" > $WORK_DIR/summary.yaml + +DEVICES="$(get_devices | tee $WORK_DIR/devices.log)" log silent "Devices found:\n$DEVICES" case $BENCHMARK in @@ -73,10 +97,13 @@ case $BENCHMARK in log info "Running benchmark for ${#list[@]} device(s)"; for dev in "${list[@]}" do - OUT=$(run_benchmark $dev); get_json $dev $OUT | tee -a $WORK_DIR/summary.json - done ;; + OUT=$(run_benchmark $dev); + get_json $dev $OUT | tee -a $WORK_DIR/summary.json; + get_yaml $dev $OUT >> $WORK_DIR/summary.yaml; + done ; cat $WORK_DIR/summary.yaml;; device) log info "Running benchmark for $DEVICE device"; - OUT=$(run_benchmark $DEVICE); get_json $DEVICE $OUT | tee -a $WORK_DIR/summary.json ;; + OUT=$(run_benchmark $DEVICE); get_json $DEVICE $OUT | tee -a $WORK_DIR/summary.json ; + get_yaml $DEVICE $OUT >> $WORK_DIR/summary.yaml ; cat $WORK_DIR/summary.yaml ;; *) python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $DEVICE 2>&1 | tee -a $WORK_DIR/out.log; esac