diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-20 20:58:13 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-21 13:43:50 +0800 |
commit | 9222ecb462099f667d78494f4886d6c84f8a2310 (patch) | |
tree | 695f9c4448b9a6ba637f33c8feabce0efa46f5bd /resources/roles/ramspeed | |
parent | 441dea324dc2442b746528e0337a539c18b85b2f (diff) |
Reorganize benchmarking tasks into ansible roles which helps to
- group task with related templates and variables
- simplify the main playbook to improve readability
See: http://docs.ansible.com/ansible/playbooks_roles.html
Change-Id: I9d3180edaac83ee9dba85ce5ac14ff574af7a905
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'resources/roles/ramspeed')
-rw-r--r-- | resources/roles/ramspeed/defaults/main.yml | 11 | ||||
-rw-r--r-- | resources/roles/ramspeed/meta/main.yml | 12 | ||||
-rw-r--r-- | resources/roles/ramspeed/tasks/main.yml | 75 |
3 files changed, 98 insertions, 0 deletions
diff --git a/resources/roles/ramspeed/defaults/main.yml b/resources/roles/ramspeed/defaults/main.yml new file mode 100644 index 00000000..0cc06cf6 --- /dev/null +++ b/resources/roles/ramspeed/defaults/main.yml @@ -0,0 +1,11 @@ +############################################################################# +# Copyright (c) 2017 ZTE Corporation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# + +--- +cwd: "{{ ansible_env.HOME }}/qtip/ramspeed" diff --git a/resources/roles/ramspeed/meta/main.yml b/resources/roles/ramspeed/meta/main.yml new file mode 100644 index 00000000..03c96c42 --- /dev/null +++ b/resources/roles/ramspeed/meta/main.yml @@ -0,0 +1,12 @@ +############################################################################# +# Copyright (c) 2017 ZTE Corporation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# + +--- +dependencies: + - { role: development-tools } diff --git a/resources/roles/ramspeed/tasks/main.yml b/resources/roles/ramspeed/tasks/main.yml new file mode 100644 index 00000000..6473d576 --- /dev/null +++ b/resources/roles/ramspeed/tasks/main.yml @@ -0,0 +1,75 @@ +############################################################################## +# Copyright (c) 2017 ZTE Corporation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +- name: making ramspeed working directory + file: + path: "{{ cwd }}" + state: directory + tags: [setup] + +- name: download ramspeed/ramsmp + unarchive: + src: http://www.alasir.com/software/ramspeed/ramsmp-3.5.0.tar.gz + dest: "{{ cwd }}" + remote_src: yes + tags: [setup] + +- name: build ramsmp + command: ./build.sh + args: + chdir: "{{ cwd }}/ramsmp-3.5.0" + creates: ramsmp + tags: [setup] + +- name: intmem benchmarking + command: ./ramsmp -b 3 -l 5 -p 1 + args: + chdir: "{{ cwd }}/ramsmp-3.5.0" + register: ramsmp_intmem_out + tags: [run] + +- name: floatmem benchmarking + command: ./ramsmp -b 6 -l 5 -p 1 + args: + chdir: "{{ cwd }}/ramsmp-3.5.0" + register: ramsmp_floatmem_out + tags: [run] + +- name: collect integer memory metrics from ramspeed + collect: + string: "{{ ramsmp_intmem_out.stdout }}" + patterns: + - '^INTEGER\s+BatchRun\s+Copy:\s+?(?P<integer_copy>\d+\.\d+)\sMB/s$' + - '^INTEGER\s+BatchRun\s+Scale:\s+?(?P<integer_scale>\d+\.\d+)\sMB/s$' + - '^INTEGER\s+BatchRun\s+Add:\s+?(?P<integer_add>\d+\.\d+)\sMB/s$' + - '^INTEGER\s+BatchRun\s+Triad:\s+?(?P<integer_triad>\d+\.\d+)\sMB/s$' + - '^INTEGER\s+BatchRun\s+AVERAGE:\s+?(?P<integer_average>\d+\.\d+)\sMB/s$' + dump: 'ramsmp-intmem.log' + register: intmem_metrics + tags: [collect] + +- name: collect float memory metrics from ramspeed + collect: + string: "{{ ramsmp_floatmem_out.stdout }}" + patterns: + - '^FL-POINT\s+BatchRun\s+Copy:\s+?(?P<float_copy>\d+\.\d+)\sMB/s$' + - '^FL-POINT\s+BatchRun\s+Scale:\s+?(?P<float_scale>\d+\.\d+)\sMB/s$' + - '^FL-POINT\s+BatchRun\s+Add:\s+?(?P<float_add>\d+\.\d+)\sMB/s$' + - '^FL-POINT\s+BatchRun\s+Triad:\s+?(?P<float_triad>\d+\.\d+)\sMB/s$' + - '^FL-POINT\s+BatchRun\s+AVERAGE:\s+?(?P<float_average>\d+\.\d+)\sMB/s$' + dump: 'ramsmp-floatmem.log' + register: floatmem_metrics + tags: [collect] + +- name: create memory metrics report + template: + src: "{{ qtip_resources }}/template/mem-metrics.j2" + dest: "{{ qtip_reports }}/mem-metrics" + delegate_to: localhost + tags: [report] |