With a (yet unapproved) pull request, the HTCondor-CE is able to add new resource types by modifying only 2 files, the routes table and scheduler attributes customization script. Previously, it required editing a third python script which had very tricky syntax (python, which spit out ClassAds...). In the following examples, I will demonstrate how to use this new feature with GPUs.
default_remote_cerequirements = "RequestGpus == 1"
This attribute is used in the next section, the local submit attributes script.
Local Submit Attributes ScriptThe local submit attributes script translates the remote_cerequirements to the actual scheduler language used at the site. For Crane's GPU configuration, the snippet added for GPUs is:
This snippet checks for the existence of the RequestGpus attribute from the environment, and if detected, will insert several lines into the submit script. It will first add the SLURM line to request a GPU, then it will source the module setup script and load the cuda module.