Last active
February 17, 2016 22:52
-
-
Save nedgonaes/199a04df92bf69d1fe59 to your computer and use it in GitHub Desktop.
script to setup an mpi cluster node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#install openmpi stuff | |
yum install gcc -y | |
yum install openmpi-devel -y | |
#add new user cluster | |
useradd cluster | |
#copy credentials to cluster users | |
cp -r .ssh /home/cluster/.ssh | |
chown -R cluster:cluster /home/cluster/.ssh | |
#Give sudo privilges to the cluster user | |
echo "cluster ALL=(ALL) ALL" >> /etc/sudoers | |
#set cluster user password to first argument | |
echo -e "${1}\n${1}\n" | passwd cluster | |
#add stuff to path for openmpi to work | |
echo "export PATH=/usr/lib64/openmpi/1.4-gcc/bin:$PATH" >> /home/cluster/.bashrc | |
echo "export LD_LIBRARY_PATH=/usr/lib64/openmpi/1.4-gcc/lib:$LD_LIBRARY_PATH" >> /home/cluster/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment