Skip to content

Commit

Permalink
Merge pull request #1 from DiamondLightSource/hostfile-fix
Browse files Browse the repository at this point in the history
Update process-hostfile.sh
  • Loading branch information
GMW99 authored Sep 10, 2020
2 parents a7de6c7 + 1944f10 commit a065071
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions distrac/process-hostfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ case $i in
;;
esac
done
# Read hostfile and put the amount of hosts in amountOfHosts.num
echo `awk -F '[,]' ' {print NF}' $hostfile` > $folder/amountOfHosts.num
# Convert the hostfile to a column of hosts and store in $folder/hostlist
tr , '\n' < $hostfile > $folder/hostfile
# Make sure the first host in hostfile is the headnode
sed -i "/\b\("$HOSTNAME"\)\b/d" $folder/hostfile
sed -i "1 i$HOSTNAME" $folder/hostfile

echo "$(printf "$HOSTNAME \n"; cat $folder/hostfile)" > $folder/hostfile
# Read hostfile and put the amount of hosts in amountOfHosts.num
cat $folder/hostfile | wc -l > $folder/amountOfHosts.num

0 comments on commit a065071

Please sign in to comment.