In HTCondor 8.2 and later you use the classad split function to turn string lists into classad native lists. So You can write this as condor_q -af ‘split(“Undefined,Idle,Running,Removed,Completed,Held,Transferring,Suspended”)[JobStatus]’ From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx]
On Behalf Of Michael Pelletier Even after a few years of working with HTCondor, I’m still getting the hang of lists. I just realized something that other folks may find useful, so I thought I’d send it out. I’ve been fine-tuning the Grid Engine wrapper I wrote so it can better handle various engineering tools which don’t have a native HTCondor or LoadLeveler scheduler interface, and the job-monitoring functionality of these tools is looking
for a Grid Engine qstat-format output, which means that JobStatus has to be translated into the appropriate letter code. What I just realized is that this kind of translation for JobStatus can be done directly in a condor_q –format by using a string list, along these lines: condor_q –format “state %s\n” ‘{ "Undefined", "Idle", "Running", "Removed", "Completed", "Held", "Transferring", "Suspended" }[JobStatus]’ Or for Grid Engine state letter codes: condor_q –format “state %s\n” ‘{ "E", "qw", "r", "d", "--", "h", "t", "s" }[JobStatus]’ You’re declaring a StringList literal and indexing it with the JobStatus attribute of the jobs. Spiffy. I had set up something similar a couple of years ago as a pre-8.4 version of the “queue from” syntax, but I guess I had a failure of
imagination when I forgot I could use it in condor_q as well. Maybe there should be a manual section all about using the List type. Michael V. Pelletier |