[torqueusers] qdel with regulat expressions

Chris Evert chris.evert at geokinetics.com
Mon Aug 13 15:03:22 MDT 2012


Grigory,

A perl script to print job ids when job name contains arg 1:

#!/usr/bin/perl
use strict;
my $id;
my $re;

$re = $ARGV[0];
open F, "qstat -f|";
while (<F>) {
	m/^Job Id: (.*)/ && ($id = $1);
	if (m/Job_Name = (.*)/) {
		print "$id\n" if ($1 =~ m/$re/);
	}
}
close F;


Perhaps I should have checked for non-existent $ARGV[0] or print usage. 
  Left as exercise for the reader.

Enjoy,
Chris

On 08/13/2012 03:44 PM, Grigory Shamov wrote:
> Hi,
>
> Oops, I was wrong. qselect returns list of JobIDs that indeed can be passed to grep but for no use. It can select by names, with qselect -N parameter, but doesnt accept globs there? So one can try to choose jobs by other parameters of qselect (submission time etc) if they are known!
>
> --
> Grigory Shamov
>
> --- On Mon, 8/13/12, Mahmood Naderan <nt_mahmood at yahoo.com> wrote:
>
>> From: Mahmood Naderan <nt_mahmood at yahoo.com>
>> Subject: Re: [torqueusers] qdel with regulat expressions
>> To: "Grigory Shamov" <gas5x at yahoo.com>
>> Cc: "Torque Users Mailing List" <torqueusers at supercluster.org>
>> Date: Monday, August 13, 2012, 7:54 AM
>>> qselect -u naderan | grep
>> something | xargs qdel
>>
>> That is also good. Thanks...
>>
>> Regards,
>> Mahmood
>>
>>
>> ----- Original Message -----
>> From: Grigory Shamov <gas5x at yahoo.com>
>> To: Mahmood Naderan <nt_mahmood at yahoo.com>;
>> Torque Users Mailing List <torqueusers at supercluster.org>
>> Cc:
>> Sent: Monday, August 13, 2012 2:54 PM
>> Subject: Re: [torqueusers] qdel with regulat expressions
>>
>> Hi Mahmood,
>>
>> You could use qselect, then Unix commands to form the list,
>> with glob or regex expressions, and then xargs it to qdel.
>>
>> qselect -u naderan | grep something | xargs qdel
>>
>> --
>> Grigory Shamov
>>
>> --- On Mon, 8/13/12, Mahmood Naderan <nt_mahmood at yahoo.com>
>> wrote:
>>
>>> From: Mahmood Naderan <nt_mahmood at yahoo.com>
>>> Subject: [torqueusers] qdel with regulat expressions
>>> To: "torque cluster" <torqueusers at supercluster.org>
>>> Date: Monday, August 13, 2012, 5:27 AM
>>> Hi,
>>> Assume these jobs are running:
>>>
>>> set1-model1
>>> set1-model2
>>> set2-model1
>>> set1-model4
>>> set2-model7
>>>
>>> Now assume I want to delete set1*
>>> Is there any way to delete the jobs with regular
>>> expressions?
>>> Currently I have to use "qdel 54151 54686 56588"
>>>
>>> Regards,
>>> Mahmood
>>>
>>> _______________________________________________
>>> torqueusers mailing list
>>> torqueusers at supercluster.org
>>> http://www.supercluster.org/mailman/listinfo/torqueusers
>>>
>>
>>
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torqueusers
>


More information about the torqueusers mailing list