[GE users] Script for accounting(8) file analysis

Nikhil Mulley mulleyn at deshaw.com
Mon Jun 12 11:27:19 BST 2006


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Hi, I use classic spooling in the sense of plain text files, so will 
this script work in this case too ?

Andreas Haas wrote:
> On Fri, 9 Jun 2006, Simon Gao wrote:
>
>   
>> Andreas,
>>
>> Your script works great.
>>     
>
> :-)
>
>   
>> However, is it possible to add
>> sorting into your script so when running with "-u", users
>> are listed in descending order based on njobs or runtime?
>> maybe another argument like "-s"?
>>     
>
> Sure enough. See PrintableHash::print_all()
>
>       def print_all(name)
>          first = true
>          self.keys.sort.each do |debitable|
>             self[debitable].print_debitable(debitable, first, self.size, name)
>             if first == true
>                first = false
>             end
>          end
>       end
>
> where sorting is currently done for user/project/queue/etc.
> I haven't tried, yet I believe changing it to
>
>       def print_all(name)
>
>          ary = Array.new
>          self.each_pair { |k,v| ary.push([k,v]) }
>
>          ary.sort!{ |x,y|  x[1].jobs <=> y[1].jobs }
>          first = true
>          ary.each { |v|
>             v[1].print_debitable(v[0], first, self.size, name)
>             if first == true
>                first = false
>             end
>          }
>       end
>
> would already do part of what you want.
>
> Regards,
> Andreas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail: users-help at gridengine.sunsource.net
>
>   




More information about the gridengine-users mailing list