icc -o test1 test1.c -lpthread -O1O1 is an optimization flag and you may use other flags.
qsub -I -l nodes=1:ppn=2 -l walltime=00:15:00to start an interactive job on a single node with 2 cores for at most 15 minutes.
Once you run it, it will wait until a node is available, and then it will create an SSH session to that node. Your job will last until you exit that SSH session.
binarynameYou may supply the number of pthreads as an argument so your program may create a given number of threads.
Notes:
Make sure your code does not wait for an input from a user keyboard!
cd ~/path-to-program binaryname
qsub job-script-filewill submit your job to the scheduler and assign it a job number. Be careful when you are submitting multiple jobs with the same output file names since they may get overwritten by subsequent or concurrent jobs.
~tyang/pthreads/pthreads