-
Notifications
You must be signed in to change notification settings - Fork 517
/
setup-torque
executable file
·45 lines (33 loc) · 1.29 KB
/
setup-torque
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [ ! -e ~/machines ]; then
echo "A list of machines must be provided in ~/machines"
echo "Exiting..."
exit 1
fi
namenode=$(hostname)
echo "Install Torque"
mpiexec.openmpi -hostfile ~/machines -pernode \
sudo apt-get --yes install torque-server torque-scheduler \
torque-client torque-common torque-mom
echo "Configuring Server"
sudo bash -c "echo $namenode > /etc/torque/server_name"
sudo cp ~/machines /var/spool/torque/server_priv/nodes
sudo qterm
sudo pbs_server
echo "Configuring MOM on remote machines"
echo "\$pbsserver $namenode" > /tmp/config_mom
mpiexec.openmpi -hostfile ~/machines -pernode \
scp $namenode:/tmp/config_mom /tmp/config
mpiexec.openmpi -hostfile ~/machines -pernode \
sudo cp /tmp/config /var/spool/torque/mom_priv/.
mpiexec.openmpi -hostfile ~/machines -pernode sudo momctl -s
mpiexec.openmpi -hostfile ~/machines -pernode sudo pbs_mom
echo "Configuring queue manager"
sudo qmgr -c 'create queue batch'
sudo qmgr -c 'set queue batch queue_type = Execution'
sudo qmgr -c 'set queue batch resources_default.nodes = 1'
sudo qmgr -c 'set queue batch enabled = True'
sudo qmgr -c 'set queue batch started = True'
sudo qmgr -c 'set server scheduling = True'
sudo qmgr -c 'set server default_queue = batch'
sudo qmgr -c 'set server log_events = 511'