Machine Constraints and Preferences

Just as with jobs, machines can also place constraints and preferences on the jobs that they would like to run. For simplicity, we will only change the START and Rank expressions which control when and which jobs may claim a machine.

Example 1: Allowing/Disallowing Users

Preliminary: Please change to the example0 directory by typing:
%  cd ~/workbook/startd-rank/example1

A simple configuration change to make is allowing only certain users to claim the machine, and disallowing others.

Load up Condor's configuration file into your favorite editor and view the START expression. (For your convenience, the example1 directory has a symbolic link named condor_config.local to the configuration file.)

Now change the expression to

START : Owner != "userLLL"
where userLLL is the login name of the user on the machine to your left. Then quit the editor after saving the configuration file.

To activate the change in configuration, type:

%  condor_reconfig
Now submit the example1.cmd from the previous workbook section by typing:
%  cp ../../submit-rank/example1/example1.cmd .
%  condor_submit example1.cmd

Typing

%  condor_status -run
will show that none of the machines run jobs submitted by their left neighbors.

Example 2: Time based constraints

Preliminary: Please change to the example2 directory by typing:
%  cd ~/workbook/startd-rank/example2

Each machine also advertises local time information in its ClassAd. This information can be used to place time based constraints on the machine. The attributes of interest are: First find the current value of ClockMin on your machine by typing
%  condor_status -l machineXXX
and looking up the value of the ClockMin attribute.

Now load up the configuration file in your editor and edit the START expression to

START : (ClockMin > TTT + 3) && (Owner == "userXXX")
where TTT is the value of ClockMin from condor_status above, and userXXX is your login name.

Reconfigure the machine and submit example2 by typing:

%  condor_reconfig ; condor_submit example2.cmd
You will notice that the machine will run your only job after three minutes have elapsed.

Example 3: Ranks and Preemption

Preliminary: Please change to the example3 directory by typing:
%  cd ~/workbook/startd-rank/example3

Like jobs, machines may also define Rank expressions to express preferences. Machines will preempt their current jobs when they find jobs with a higher rank.

Edit the the configuration file condor_config.local so that the START and Rank expressions look like

START :  TRUE
RANK  :  (Owner == "userXXX") * ImageSize
where userXXX is your login name.

This policy states that any job will be accepted, but jobs submitted by you are preferred, and large jobs submitted by you are especially preferred.

Edit the command file example3a.cmd so that the requirements expression as in example1 will only run on an adjacent machine.

 
Requirements = Name=="machineLLL.ncsa.uiuc.edu" || Name=="machineRRR.ncsa.uiuc.edu"
Now reconfigure the daemon and submit example3a:
%  condor_reconfig ; condor_submit example3a.cmd
This job, like example1 from the previous workbook section, will only run on adjacent machines.

Ensure that your job is running by typing:

%  condor_status -run

Now submit example3b, which does not place any requirement on which machine it will run on:

%  condor_submit example3b.cmd
Wait a few seconds, and type:
%  condor_q ; condor_status -run
You will notice that your machine has preempted the job it was previously running in preference to the second job you submitted.

Finally, submit yet another job example3c, which is similar to example2 except that it has a larger ImageSize:

%  condor_submit example3c.cmd
After a few seconds, you will notice that your machine has preempted the second job in preference to the third.

You may now allow your jobs to complete, or remove them by typing:
%  condor_rm -a