NorduGrid | Condor configuration

# Condor configuration Instructions for NorduGrid/ARC Sites

## Basic installation

Install Condor on the Grid Manager (GM) node and configure it as a submit machine. Next, you must add the following to the node's Condor configuration (`CONDOR_IDS` can also be an environment variable):

MAIL = <ARC_install_prefix>/libexec/finish-condor-job
CONDOR_IDS = 0.0

The `MAIL` attribute will instruct Condor to run the specified program on job completion. The default on Condor is to run `/bin/mail` to notify the user, but in this case, it is the GM that needs the notification. Therefore, `/bin/mail` is replaced with a program especially written for talking to the GM.

`CONDOR_IDS` has to be 0.0, so that the above notification program can access the Grid job's session directories (needed to extract the job exit code from the Condor log).

The next step is to modify `arc.conf`. In the `[common]` section, the following should be set:

1. `lrms="condor"`
2. `condor_location` should be set to the Condor install prefix (i.e., the directory containing Condor's `bin`, `sbin`, etc).
3. `condor_config` should have the same value as the environment variable `CONDOR_CONFIG` (but don't try to use the environment variable directly as `$CONDOR_CONFIG`, since it will probably not be defined when `arc.conf` is parsed!)

The next thing to do is to make sure that no normal users are allowed to submit Condor jobs from this node. For one thing, it would not work for the user, since Condor will try to notify the GM instead of the job owner on job completion. Worse, it would fool the information system into believing that the user jobs came from the Grid. If you don't allow normal user logins on the GM machine, then you don't have to do anything. If you for some reason want to allow users to log into the GM machine, simply don't allow them to execute the condor_submit program. This can be done by putting all local Unix users allocated to the Grid in a single group, e.g. 'griduser', and then setting the file ownership and permissions on condor_submit like this:

chgrp griduser $condor_location/bin/condor_submit
chmod 750 $condor_location/bin/condor_submit

## Adding runtime environments to Condor

After you've added the runtime environment script to the runtime directory on the Grid manager ('`runtimedir`' in`arc.conf`), and installed the runtime environments on the execute nodes, you need to tell these machines to report the runtime environments they provide. This is accomplished by adding a parameter to their local Condor configuration file, and then adding that parameter to `STARTD_EXPRS`. For example, to add the environment `ATLAS-1.1.0`:

ATLAS_1_1_0 = True
STARTD_EXPRS = ATLAS_1_1_0, $(STARTD_EXPRS)

NOTE: The parameter name may only contain letters, digits and underscores – characters in the runtime environment name that is not in this set must be translated to underscores. (Names are case insensitive, so it doesn't matter whether you say `Atlas_1_1_0` or `ATLAS_1_1_0`.)

## Customizing Condor's ranking algorithm

If you are not happy with the way Condor picks out nodes when running jobs, you can define your own ranking algorithm by setting the `condor_rank` attribute in `arc.conf`'s `[common]` section. `condor_rank` should be set to a ClassAd float expression that you could use in the Rank attribute in a Condor job description. For example:

condor_rank="(1-LoadAvg/2)*(1-LoadAvg/2)*Memory/1000*KFlops/1000000"

See the following sections in the Condor manual for more information:

9 condor_submit
  Information on the Rank attribute which condor_rank translates directly into.
2.5.2.1 ClassAd Machine Attributes
  The full list of all ClassAd attributes.
4.1 Condor's ClassAd Mechanism
  The syntax of ClassAd expresions.