From 48d36caabb09f2456a1d7ad64acb7aa099277eda Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Sun, 23 Apr 2017 19:37:16 +0800 Subject: Save logs before collecting Change-Id: I0e39103ef917fa7ea86d5c47de0cc71c37fca74c Signed-off-by: Yujun Zhang --- resources/ansible_roles/ramspeed/tasks/main.yml | 35 +++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'resources/ansible_roles/ramspeed/tasks') diff --git a/resources/ansible_roles/ramspeed/tasks/main.yml b/resources/ansible_roles/ramspeed/tasks/main.yml index 2ecf4279..bdb23b6c 100644 --- a/resources/ansible_roles/ramspeed/tasks/main.yml +++ b/resources/ansible_roles/ramspeed/tasks/main.yml @@ -11,14 +11,12 @@ file: path: "{{ workdir }}" state: directory - tags: [setup] - name: downloading ramsmp get_url: url: http://www.alasir.com/software/ramspeed/ramsmp-3.5.0.tar.gz dest: "{{ workdir }}" checksum: "sha256:39fb15493fb3c293575746d56f6ab9faaa1d876d8b1f0d8e5a4042d2ace95839" - tags: [setup] - name: extracting ramsmp # TODO(yujunz) unarchive may not work with long path (local: macOS, workdir: /root/qtip-workdir-20170423-0836/) @@ -32,51 +30,60 @@ args: chdir: "{{ workdir }}/ramsmp-3.5.0" creates: ramsmp - tags: [setup] - name: intmem benchmarking command: ./ramsmp -b 3 -l 5 -p 1 args: chdir: "{{ workdir }}/ramsmp-3.5.0" - register: ramsmp_intmem_out - tags: [run] + register: ramsmp_int_out - name: floatmem benchmarking command: ./ramsmp -b 6 -l 5 -p 1 args: chdir: "{{ workdir }}/ramsmp-3.5.0" - register: ramsmp_floatmem_out - tags: [run] + register: ramsmp_float_out + +- name: generating log filename + set_fact: + int_logfile: "{{ qtip_results }}/ramsmp-int.log" + float_logfile: "{{ qtip_results }}/ramsmp-float.log" + +- name: saving integer output to log + copy: + content: "{{ ramsmp_int_out.stdout }}" + dest: "{{ int_logfile }}" + delegate_to: localhost + +- name: saving floating point output to log + copy: + content: "{{ ramsmp_float_out.stdout }}" + dest: "{{ float_logfile }}" + delegate_to: localhost - name: collect integer memory metrics from ramspeed collect: - string: "{{ ramsmp_intmem_out.stdout }}" + string: "{{ lookup('file', int_logfile) }}" patterns: - '^INTEGER\s+BatchRun\s+Copy:\s+?(?P\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+Scale:\s+?(?P\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+Add:\s+?(?P\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+Triad:\s+?(?P\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+AVERAGE:\s+?(?P\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 }}" + string: "{{ lookup('file', float_logfile) }}" patterns: - '^FL-POINT\s+BatchRun\s+Copy:\s+?(?P\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+Scale:\s+?(?P\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+Add:\s+?(?P\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+Triad:\s+?(?P\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+AVERAGE:\s+?(?P\d+\.\d+)\sMB/s$' - dump: 'ramsmp-floatmem.log' register: floatmem_metrics - tags: [collect] - name: create memory metrics report template: src: "memory-metrics.j2" dest: "{{ qtip_results }}/memory-metrics" delegate_to: localhost - tags: [report] -- cgit 1.2.3-korg