In this workbook section, we will express constraints that users generally desire to give a flavor of Condor's mechanisms. However, keep in mind that Condor's flexibility lies in the fact that ClassAds can contain arbitrary expressions: feel free to be creative and try out expressions of your own!
% cd ~/workbook/submit-rank/example1
We will now place some constraints on where the job will run. Users sometimes want their jobs to only run on specific machines that they choose. Assume that you want your job to run only on your neighbors' machines.
Load the submit command file example1.cmd into your favorite editor. You will see the following Requirements expression:
requirements = Name=="machineLLL.ncsa.uiuc.edu" || Name=="machineRRR.ncsa.uiuc.edu"Edit the requirements line and change machineLLL and machineRRR to the machine names of your left and right neighbors.
Now submit example1 by typing:
% condor_submit example1.cmd
You can view the ClassAd of the submitted job by typing
% condor_q -longFind out where your job is running by typing
% condor_status -runand viewing the entry where your username is listed as the RemoteUser of a machine.
% cd ~/workbook/submit-rank/example2
Requirements = (Arch == "INTEL") && (OpSys == "LINUX") Rank = ( Memory>=32 ) * ( 10*Mips + 2*KFlops + 100*Memory + 8*VirtualMemory )The Rank expression states that all machines will less than 32 Mb of memory are weighted equally (at zero), and machines with 32 Mb or more memory are weighted according to their Mips, KFlops, Memory and VirtualMemory.
Submit this example by typing:
% condor_submit example2.cmdand find the machine which is running your job with condor_status
% cd ~/workbook/submit-rank/example3
View the contents of the example3a submit command file. The requirements expression asks for any machine with more than 32Mb of physical memory and more than 100 Mb of virtual memory. Submit this example by typing:
% condor_submit example3a.cmdand find the machine your job runs on by typing:
% condor_status -runIf you find that your job is running on machineXXX, type
% condor_status -long machineXXXand view the ClassAd of machineXXX to verify that it does indeed satisfy the job's constraints.
Similarly, example3b (in the same directory), asks for machines which have a certain MIPS (Million Instructions Per Second) and KFLOPS (Kilo Floating point Operations Per Second) rating. Feel free to edit the command file and edit the expression to include other criteria, and submit it by typing:
% condor_submit example3b.cmdIf you'd like to, use condor_status to find the machine your job is running on, and view the ClassAd of the machine.
% cd ~/workbook/submit-rank/example4
When you view the submit command file example4.cmd, you will see:
rank = Memory > 32This expression evaluates to 1 (i.e., TRUE) when the machine has more than 32 Mb of memory, and 0 (i.e., FALSE) otherwise.
Now submit example4 by typing:
% condor_submit example4.cmdCondor will now find an available machine with the highest Rank value for the job (which in this case, is 1).
% cd ~/workbook/submit-rank/example5
View the Rank expression in the submit command file example5.cmd. The expression reads:
rank = MipsThus, the higher the MIPS rating of the target machine, the better the rank.
Now submit example5 by typing:
% condor_submit example5.cmdand find the machine which is running your job with condor_status