Skip to content

Commit ab4e9bb

Browse files
author
Gabryel Mason-Williams crc99971
committed
Corrected mpirun to work with hostfiles
1 parent ef4f683 commit ab4e9bb

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

distrac/distrac.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ fi
7070

7171
./create-mon.sh -i=$interface -f=$folder
7272
./create-mgr.sh -f=$folder
73-
echo HOSTS:$mpiHosts
74-
module load openmpi/1.4.3
75-
mpirun -H $mpiHosts ./create-gram.sh -s=$size -n=$amount -f=$folder &
73+
echo HOSTS:
74+
cat $folder/hostfile
75+
module load openmpi
76+
mpirun --hostfile $folder/hostfile ./create-gram.sh -s=$size -n=$amount -f=$folder &
7677
wait
7778
if ([ ! -z "$poolname" ] && [ "$rgw" = "false" ])
7879
then

distrac/process-hostfile.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ esac
2020
done
2121
# Read hostfile and put the amount of hosts in amountOfHosts.num
2222
echo `awk -F '[,]' ' {print NF}' $hostfile` > $folder/amountOfHosts.num
23-
# Assign a string of hosts with commas to mpiHosts
24-
mpiHosts=$(cat $hostfile)
23+
# Convert the hostfile to a column of hosts and store in $folder/hostlist
24+
tr , '\n' < $hostfile > $folder/hostfile

distrac/remove-distrac.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ else
3232
source ./uge-hostfile.sh -f=$folder
3333
fi
3434

35-
module load openmpi/1.4.3
35+
module load openmpi
3636
echo "Removing Ceph"
37-
mpirun -H $mpiHosts ./remove-ceph.sh
37+
mpirun --hostfile $folder/hostfile ./remove-ceph.sh
3838
echo "Removing OSDs"
39-
mpirun -H $mpiHosts ./remove-osd.sh
39+
mpirun --hostfile $folder/hostfile ./remove-osd.sh
4040
echo "Removing GRAM"
41-
mpirun -H $mpiHosts ./remove-gram.sh
41+
mpirun --hostfile $folder/hostfile ./remove-gram.sh
4242
echo "Removing Temp Files"
4343
./remove-temp-files.sh -f=$folder
4444
echo "Done"

distrac/remove-temp-files.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ case $i in
1414
esac
1515
done
1616
rm $folder/ceph.*
17+
rm $folder/hostfile
1718
rm $folder/*.num
1819
rmdir $folder

distrac/uge-hostfile.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,5 @@ case $i in
1414
esac
1515
done
1616
# Read UGE PE_HOSTFILE and extract hosts
17-
while read name rest
18-
do
19-
hosts+=($name)
20-
done < <(cat $PE_HOSTFILE)
21-
# Put the amount of hosts in amountOfHosts.num
22-
echo "${#hosts[@]}" > $folder/amountOfHosts.num
23-
# Assign a string of hosts with commas to mpiHosts
24-
mpiHosts=$(IFS=,; echo "${hosts[*]}")
17+
awk '{print $1 }' ${PE_HOSTFILE} | uniq > $folder/hostfile
18+
cat $folder/hostfile | wc -l > $folder/amountOfHosts.num

0 commit comments

Comments
 (0)