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

[HTCondor-users] A useful trick with string lists

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
Principal Engineer
Information Technology
Program Support & Delivery
Integrated Defense Systems
Raytheon Company

+1 978-858-9681   (office)
+1 339-293-9149   (cell)
7-225-9681   (tie line)

50 Apple Hill Drive
Tewksbury, MA 01876 USA

Follow Raytheon On
Twitter YouTube Facebook LinkedIn 

Raytheon Sustainability

This message contains information that may be confidential and privileged. Unless you are the addressee (or authorized to receive mail for the addressee), you should not use, copy or disclose to anyone this message or any information contained in this message. If you have received this message in error, please so advise the sender by reply e-mail and delete this message. Thank you for your cooperation.