Save the script above to /home/sgeadmin/ on your StarCluster tales of mystery and imagination ebook and execute the following as the sgeadmin user: [email protected]: qsub -V Your job 6 has been submitted Now that the job has been submitted, lets call qstat periodically until the job has finished since this job.
Run the code on X number of machines using: mpirun -np X -hostfile myhostfile./mpi-executable arg1 arg2.
This integration allows Sun Grid Engine to handle assigning hosts to parallel jobs and to properly account for parallel jobs.
A job script is essentially a bash script that contains some logic and executes any number of external programs/scripts: #!/bin/bash echo "hello from job script!" echo "the manual for royal deluxe canister vacuum date is" date echo "here's /etc/hosts contents cat /etc/hosts echo "finishing job :D" As you can see, [email protected] 1 [email protected]: qstat [email protected]: Now that the job is finished, lets take a look at the output files: [email protected]: ls *.e6.o6 [email protected]: cat.o6 hello from job script!In other words, this rule will greedily take all slots on a given node until the slot requirement for the job is met.Round Robin vs Fill Up Modes Notice the allocation_rule setting in the output of the qconf command in the previous section.To do this, we use the qhost command: [email protected]: qhost hostname arch ncpu load memtot memuse swapto swapus global master lx24-x86.00.7G.7M 896.0M.0 node001 lx24-x86.00.7G.8M 896.0M.0 The output shows the architecture ( arch number of cpus.Then submit the job using the qsub command and the orte parallel environment automatically configured for you by StarCluster: qsub -pe orte./ The -pe option species which parallel environment to use and how many slots to request.Load_avg arch states all.Sgeadmin qw 16:18:43 1 [email protected]: qstat job-ID prior name user state submit/start at queue slots ja-task-ID.55500 jobscript.
The above example requests 24 slots (or processors) using the orte parallel environment.
After a few seconds, the job will transition into a r, or running, state at which point the job will begin executing: [email protected]: qstat job-ID prior name user state submit/start at queue slots ja-task-ID.00000 hostname sgeadmin r 14:58:14 1 [email protected]: Once the job has finished.
The last argument to qsub is the command to be executed ( hostname in this case) Notice that the qsub command, when successful, will print the job number to stdout.OpenMPI Parallel Environment StarCluster by default sets up a parallel environment, called orte, that has been configured for OpenMPI integration within SGE and has a number of slots equal to the total number of processors in the cluster.Lets see how you run this new job [email protected] BIP 0/0/1.00 lx24-x86 Creating a Job Script In the Submitting a Job section we submitted a single command hostname.Sgeadmin qw 16:18:43 1 [email protected]: qstat job-ID prior name user state submit/start at queue slots ja-task-ID.00000 jobscript.OpenMPI supports tight integration with Sun Grid Engine.