Skip to content

Commit

Permalink
👌 IMPROVE: minor improvements (#12)
Browse files Browse the repository at this point in the history
- add retry for source download (in case of transient connection issues)
- ensure correct pip is used (in case of python2 being the default)
- Ensure setuptools is up-to-date (for pyyaml installation)
- Ensure tests are re-run if the executable is re-compiled
- Make test cpu count configurable
  • Loading branch information
chrisjsewell authored Nov 29, 2020
1 parent 975e800 commit eb54108
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ bigdft_topdir: "{{ bigdft_code_folder }}/bigdft-suite"
# bigdft_src: bigdft-suite-{{ bigdft_version }}
# bigdft_src_archive: "{{ bigdft_src }}.tar.gz"
# bigdft_url: "https://gitlab.com/l_sim/bigdft-suite/-/archive/{{ bigdft_version }}/{{ bigdft_src_archive }}"
bigdft_test_cpus: 2
bigdft_executables:
- name: bigdft
folder: "{{ bigdft_prefix }}/bin"
Expand Down
11 changes: 8 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
force: true
version: "{{ bigdft_version }}"
register: bigdft_downloaded
until: bigdft_downloaded is not failed
retries: 3
delay: 5

- name: Create build dir
file:
Expand All @@ -53,10 +56,12 @@

- name: Install python six package
pip:
name: six
version: "1.15"
executable: pip3
name:
- "setuptools>=47"
- "six~=1.15.0"

- name: Make bigdft executables
- name: Compile bigdft executables
become: true
command: "{{ bigdft_python_path }} ../bundler/jhbuild.py --no-interact --exit-on-error --conditions=+babel -f ./buildrc build spred"
args:
Expand Down
11 changes: 9 additions & 2 deletions tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
args:
chdir: "{{ bigdft_topdir }}/build/bigdft/tests/DFT/cubic"
creates: "{{ bigdft_topdir }}/build/bigdft/tests/DFT/cubic/C-test"
- name: run test
command: "mpirun --allow-run-as-root --oversubscribe --mca btl_vader_single_copy_mechanism none -np 2 bigdft"

- name: Remove test log on re-compile
when: bigdft_make.changed
file:
path: "{{ bigdft_topdir }}/build/bigdft/tests/DFT/cubic/C-test/log.yaml"
state: absent

- name: run test suite
command: "mpirun --allow-run-as-root --oversubscribe --mca btl_vader_single_copy_mechanism none -np {{ bigdft_test_cpus }} bigdft"
become: true
args:
chdir: "{{ bigdft_topdir }}/build/bigdft/tests/DFT/cubic/C-test"
Expand Down

0 comments on commit eb54108

Please sign in to comment.