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

Re: [HTCondor-users] Complex policies to kill jobs?



On 08/23/2017 09:26 AM, Jose Caballero wrote:
Hi,


I am not sure this is even possible. Unclear to me from the documentation.

Let's say that I have, for example, 10 running jobs and 10 idle jobs.
And I want to kill 15 of them, with the following policies:
-- first, as many idle as possible (in this case, the 10 of them)
-- then, the rest (5) from the running ones, sorted by the time they
started running, killing younger first.

Is there a way to express this type of policies, either with the
command line or -preferable- with the python library?

Do you want this as a one-time command, or as an ongoing policy? If the former, condor_rm doesn't have a rank or limit option, which might be a nice feature request, but as a shell one-liner, a quick hack that doesn't deal with held jobs or other edge cases:

condor_q -nobatch -af clusterid procid jobsstatus JobCurrentStartTime | sort -n -k 3,3r -k 4,4 | awk '{print $1 "." $2}' | tail -15 | xargs condor_rm

should do the trick.

-greg