[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] problem with SubmitResult object



But submitResult object does not have a jobs() method

I'd always assumed that the documentation meant "the Submit object's jobs() method", but I'd never actually tested it; it turns out to be just a little more complicated than that. Full example that seems to work for me follows. (Job will go on hold because it doesn't produce the specified output, but that makes it easier to check if everything got spooled correctly.) Let me know if this works for you.

-- ToddM


#!/usr/env/env python3

import htcondor

collector = htcondor.Collector()
location = collector.locate(htcondor.DaemonTypes.Schedd, "azaphrael.org" )
schedd = htcondor.Schedd(location)

submit = htcondor.Submit("""
    universe = vanilla
    executable = /bin/sleep
    arguments = 1
    transfer_executable = false
    should_transfer_files = true

    transfer_input_files = /tmp/input.txt
    transfer_output_files = output.txt

    queue 1
""")


result = schedd.submit(
    submit,
    spool=True
)

wtaf = submit.jobs(
    count=result.num_procs(),
    clusterid=result.cluster(),
)
schedd.spool(list(wtaf))