Cluster Use Examples
Below are a couple examples to get you started on the cassini cluster. They don't do any useful work, but should highlight some key concepts.
First, start off with a script that you want to run. Let's use this "sleeper" script.
#!/bin/bash
#$ -S /bin/bash
echo -n "This is job ID $JOB_ID running on host name "
hostname
echo "My task no: $SGE_TASK_ID"
sleep 120
echo "Done!!"
Save this script in your home directory as sleeper.sh, make it executable (chmod 700 sleeper.sh).
Now it's time to submit it to the queue for processing. The minimal set of arguments is:
qsub -cwd -o output.log sleeper.sh
After the job runs, you will have an output.log file in your current directory. If you also want to capture any errors, define -e error.log (or any file name of your choice). Review the introduction for instructions on how to submit your job to a specific queue and how to request memory for your job.
If you want to run this job 100 times, you can either submit it as an array job, or qsub it 100 times.
1) Submit as an array job:
qsub -cwd -o output.log -t 1-100 sleeper.sh
2) Submit it 100 times:
for i in `seq 1 100`; do qsub -cwd -o output.log sleeper.sh $i; done
Use qstat to check the status of you job:
qstat -u luki
If you decide that you need to kill a specific job, obtain the job ID from qstat and delete the job with qdel. Running jobs will be aborted immediately, jobs awaiting processing will be simply removed from the queue.
qdel 1234
To remove all your jobs, run:
qdel -u luki
That should get you started!
Enjoy! If you have any questions, email Luki.



