Skip to content

Commit be9aeda

Browse files
Merge pull request #105 from oci-hpc/2.10.2_ds_mpivars
add mpivars.sh file for ubuntu
2 parents 56b757c + 2dea06a commit be9aeda

File tree

8 files changed

+61
-0
lines changed

8 files changed

+61
-0
lines changed

playbooks/new_nodes.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
- limits
3434
- mpi-hostfiles
3535
- boot-volume
36+
- mpivars
3637

3738
- hosts: compute
3839
become: true

playbooks/resize_add.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
- ssh
3232
- limits
3333
- boot-volume
34+
- mpivars
3435

3536
- hosts: compute_to_add
3637
become: true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# defaults file for mpivars
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
# tasks file for mpivars
3+
- include: ubuntu.yml
4+
when: ansible_distribution == 'Ubuntu'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
- name: Get the openmpi version
3+
shell:
4+
cmd: ls /usr/mpi/gcc/
5+
warn: false
6+
register: openmpi
7+
failed_when: false
8+
9+
10+
- name: Check if mpivars.sh exists
11+
stat:
12+
path: /usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/bin/mpivars.sh
13+
register: mpivars
14+
when: openmpi.stdout_lines[0] != ""
15+
16+
17+
- name: Create mpivars.sh
18+
become: true
19+
template:
20+
src: mpivars.j2
21+
dest: /usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/bin/mpivars.sh
22+
force: yes
23+
owner: root
24+
group: root
25+
when: openmpi.stdout_lines[0] != "" and not mpivars.stat.exists
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# NOTE: This is an automatically-generated file! (generated by the
2+
# Open MPI/SHMEM RPM). Any changes made here will be lost if the RPM is
3+
# uninstalled or upgraded.
4+
5+
# PATH
6+
if test -z "`echo $PATH | grep /usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/bin`"; then
7+
PATH=/usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/bin:${PATH}
8+
export PATH
9+
fi
10+
11+
# LD_LIBRARY_PATH
12+
if test -z "`echo $LD_LIBRARY_PATH | grep /usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/lib`"; then
13+
LD_LIBRARY_PATH=/usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
14+
export LD_LIBRARY_PATH
15+
fi
16+
17+
# MANPATH
18+
if test -z "`echo $MANPATH | grep /usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/share/man`"; then
19+
MANPATH=/usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}/share/man:${MANPATH}
20+
export MANPATH
21+
fi
22+
23+
# MPI_ROOT
24+
MPI_ROOT=/usr/mpi/gcc/{{ openmpi.stdout_lines[0] }}
25+
export MPI_ROOT
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# vars file for mpivars

playbooks/site.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- mpi-hostfiles
3636
- etc-hosts
3737
- boot-volume
38+
- mpivars
3839

3940
- hosts: all
4041
become: true

0 commit comments

Comments
 (0)