openhpc / ohpc

OpenHPC Integration, Packaging, and Test Repo
http://openhpc.community
Apache License 2.0
856 stars 187 forks source link

automate some tasks for install recipe in guide #308

Open severinstojanovic opened 8 years ago

severinstojanovic commented 8 years ago

Number of sockets in each compute node

c_sockets="<>"

Number of cores in each compute node socket

c_corespersocket="<>"

Number of threads for each compute node core

c_threadspercore="<>"

Modify the default ohpc version of slurm.conf to have the correct Sockets, CoresPerSocket, and ThreadsPerCore reflecting the compute nodes

cat /etc/slurm/slurm.conf | sed -e "s/Sockets=2/Sockets=${c_sockets}/" > /tmp/slurm1.conf
cat /tmp/slurm1.conf | sed -e "s/CoresPerSocket=8/CoresPerSocket=${c_corespersocket}/" > /tmp/slurm2.conf
cat /tmp/slurm2.conf | sed -e "s/ThreadsPerCore=2/ThreadsPerCore=${c_threadspercore}/" > /tmp/slurm3.conf
mv /tmp/slurm3.conf /etc/slurm/slurm.conf


Disable SELinux

if grep -q "SELINUX=enforcing" /etc/selinux/config ; then cat /etc/selinux/config | sed -e "s/SELINUX=enforcing/SELINUX=disabled/" > /tmp/selinux/config ; mv /tmp/selinux/config /etc/selinux/config ; echo 0 > /selinux/enforce ; fi
if grep -q "SELINUX=permissive" /etc/selinux/config ; then cat /etc/selinux/config | sed -e "s/SELINUX=permissive/SELINUX=disabled/" > /tmp/selinux/config ; mv /tmp/selinux/config /etc/selinux/config ; echo 0 > /selinux/enforce ; fi


Desired addresses for the compute nodes

sms_ip_temp=${sms_ip}
sms_ip_1=${sms_ip_temp%%.*}
sms_ip_temp=${sms_ip_temp#*.*}
sms_ip_2=${sms_ip_temp%%.*}
sms_ip_temp=${sms_ip_temp#*.*}
sms_ip_3=${sms_ip_temp%%.*}
c_ip=()
for ((i=0; i<${num_computes}; i++)) ; do c_ip+=("${sms_ip_1}.${sms_ip_2}.${sms_ip_3}.$(($i+1))") ; done


NTP servers for clock synchronization

ntp_servers=()
ntp_servers+=("< ... >")
ntp_servers+=("< ... >")
ntp_servers+=("< ... >")
ntp_servers+=("< ... >")

Enable NTP services for clock synchronization

systemctl enable ntpd.service
for ((i=0; i<${#ntp_servers[@]}; i++)) ; do echo "server ${ntp_servers[$i]}" >> /etc/ntp.conf ; done
systemctl restart ntpd
github-actions[bot] commented 1 month ago

A friendly reminder that this issue had no activity for 30 days.