File: prefer-gpu-to-cpu.rst

package info (click to toggle)
condor 23.9.6%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 60,012 kB
  • sloc: cpp: 528,272; perl: 87,066; python: 42,650; ansic: 29,558; sh: 11,271; javascript: 3,479; ada: 2,319; java: 619; makefile: 615; xml: 613; awk: 268; yacc: 78; fortran: 54; csh: 24
file content (36 lines) | stat: -rw-r--r-- 1,420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Example: Run a Job on a CPU if a GPU is not Available
=====================================================

Some jobs may be able to take advantage of GPU if one is available, but
can run on a CPU if there are no slots with GPUs immediately matchable.
The following submit file will match a job in this case, using
:subcom:`rank` to prefer a GPU when both are available.

.. code-block:: condor-submit

    # This example comes from 
    # https://htcondor.readthedocs.io/en/latest/faq/users/prefer-gpu-to-cpu.html

    ## Execution section. You will need to change these for your job
    executable                  = /bin/sleep
    arguments                   = 600

    ## Requirements section. Also, probably needs customization.
    request_CPUs                = 1
    request_Memory              = 2G
    request_Disk                = 20G
    require_GPUs                = Capability > 4

    ## File transfer section.
    should_transfer_files       = true
    transfer_input_files        = input1, input2

    ## Magic section: don't change anything with rank or request_GPUs unless you
    ## understand why it works.
    rank                        = RequestGPUs
    # If your job requires more than one GPU, you may change both
    # of the '1's in the next line to some other number.
    request_GPUs                = countMatches(RequireGPUs, AvailableGPUs) >= 1 ? 1 : 0

    ## Queue section.
    queue 1