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

Re: [HTCondor-users] problem with SubmitResult object



sorry for long and possibly confusing message.
recap:
 I have a submitResult object. How do I call schedd.spool() ?
 Documentation says :
    the list returned by the jobs() method on the submit result object

 But submitResult object does not have a jobs() method

Stefano

On 29/05/2024 19:01, Stefano Belforte wrote:
Hi. I am trying to move to new way of submitting in python bindings
https://htcondor.readthedocs.io/en/latest/apis/python-bindings/api/htcondor.html#interacting-with-schedulers

But am facing an unexpected obstacle which I do not know how to solve.
Can you help ?

I am using bindings from HTCondor 23.7.2

Since in context of CMS CRAB we submit to remote schedulers,
I have to use

submitResult = schedd.submit(submit_object,...)
schedd.spool(the correct arg !)

So far we have been using the old format
clusterId = schedd.submit(classAd, returnAd)
schedd.spool(returnAd)

I have converted my code which used to pass a classAd object
to create a submit object and I think I getting there since
I get a SubmitResult object with the expected content
(Pdb) type(submitResult)
<class 'htcondor.htcondor.SubmitResult'>
(Pdb) submitResult.cluster()
104893441
(Pdb) submitResult.first_proc()
0
(Pdb) submitResult.num_procs()
1
Pdb) type(submitResult.clusterad())
<class 'classad.classad.ClassAd'>

But I can't find a proper argument for schedd.spool()
the documentation says:

spool(ad_list) â None :

ÂÂÂ Spools the files specified in a list of job ClassAds to the condor_schedd.

 ÂÂÂ Parameters

ÂÂÂÂÂÂÂ ad_list (list[ClassAds]) â A list of job descriptions; typically, this is the list returned by the jobs() method on the submit result object.
 ÂÂÂ Raises

 ÂÂÂÂÂÂÂ RuntimeError â if there are any errors.


Note the :
typically, this is the list returned by the jobs() method on the submit result object.

But the submit result object does not have a jobs() method !!

I tried
schedd.spool(submitResult.clusterad()) , but (abbreviated)
Boost error:Â did not match C++ signature:

I tried with a list, but
(Pdb) schedd.spool([submitResult.clusterad()])
*** htcondor.HTCondorIOError: DCSchedd::spoolJobFiles:1:Job ad 0 did not have a proc id
(Pdb)

submitResult.clusterad() has a 'ClusterId' attribute but indeed not a ProcId nor Proc not "proc id"
(Pdb) submitResult.clusterad()['clusterid']
104893441
(Pdb) submitResult.clusterad()['procid']
*** KeyError: 'procid'
(Pdb) submitResult.clusterad()['proc']
*** KeyError: 'proc'
(Pdb) submitResult.clusterad()['proc id']
*** KeyError: 'proc id'
(Pdb)


I am out of ideas

Thanks
Stefano