-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-cluster.sh
executable file
·21 lines (19 loc) · 1009 Bytes
/
start-cluster.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
RET="OK"
KEY_FILES_PATH="${HOME}/ssh_keys"
KEY_FILE="${KEY_FILES_PATH}/my-17-key"
REMOTEPATH=/home/sudorgin/bc
#install -d "${KEY_FILES_PATH}"
#ssh-keygen -t rsa -P "" -f ${KEY_FILE} && \
#ssh-copy-id -i ${KEY_FILE}.pub ${REMOTESERVER} || RET="FAILED"
make clean
ssh -i "${KEY_FILE}" $REMOTESERVER "rm -r $REMOTEPATH"
ssh -i "${KEY_FILE}" $REMOTESERVER "install -d $REMOTEPATH" &&
scp -i "${KEY_FILE}" solution_mpi *.cpp *.h Makefile* *.sh $REMOTESERVER:$REMOTEPATH &&
ssh -i "${KEY_FILE}" $REMOTESERVER "cd $REMOTEPATH && make -f Makefile -j6" > /dev/null&&
ssh -i "${KEY_FILE}" $REMOTESERVER "cd $REMOTEPATH && make -f Makefile clean" &&
ssh -i "${KEY_FILE}" $REMOTESERVER "cd $REMOTEPATH && rm Makefile && cp Makefile.mpi Makefile" &&
ssh -i "${KEY_FILE}" $REMOTESERVER "cd $REMOTEPATH && make -f Makefile -j6" &&
ssh -i "${KEY_FILE}" $REMOTESERVER "cd $REMOTEPATH && srun --nodes=8 --ntasks-per-node=1 ./run-cluster.sh" &&
echo "DONE!" || echo "FAIL!"