[GE users] Some Hopefully Useful Scripts

gmareels guy.mareels at gmail.com
Wed May 20 13:40:19 BST 2009


    [ 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 Chris,

thanks for the useful scripts. I ran into some trouble though when running the user_jobs_stats.sh script:
I ran:
./user_job_stats.sh 1000 total
And got plenty of following errors:
./user_job_stats.sh: line 172: [: 17.179: integer expression expected
./user_job_stats.sh: line 172: [: 29827.706: integer expression expected
...
It displays the table with the user data ok, (with non-integer total CPU time), but it is quite messy.

When I run without the 'total' argument, I get a large number of following errors:
expr: non-numeric argument
expr: non-numeric argument
expr: non-numeric argument
expr: non-numeric argument
...
And also the avg. idle % in the final sentence is not calculated.

Can you discover why I get these errors?

Many thanks,
Guy


On Mon, May 18, 2009 at 9:51 AM, olesen <Mark.Olesen at emcontechnologies.com<mailto:Mark.Olesen at emcontechnologies.com>> wrote:
Hi Chris,

> At the request of some people I've worked with, I've just posted a
> couple of scripts I've written for SGE on gridengine.info<http://gridengine.info/>.
> Here's some descriptions and links, and I'll attach the files here as
> well,

Thanks for making your scripts available. It's nice to see.

Adding my two cents...

alias qcd would be simpler with sed instead of grep/awk (I hope I got
the backslashing right).

# Csh:
alias qcd cd\ \`qstat\ -j\ \!\*\|sed -ne \'s/^cwd: *//p\'\`

for POSIX sh, you'd need a function instead of an alias:
qcd(){
  set -- $(qstat -j ${1:-0} | sed -ne 's/^cwd: *//p')
  [ "$#" -ge 1 ] && cd "$1"
}

or for the less paranoid user, without error checking
qcd(){
  cd $(qstat -j $1 | sed -ne 's/^cwd: *//p')
}


The same thing (using sed instead of grep/awk) would apply to qtail.


> -- Change Queue State --
> A very short script that enables or disables all queue instances on
> the node its run on.

I don't think you need qselect. I've never had a problem with using
wildcards directly:
Eg,
  qmod -e *@$HOSTNAME
or
  qmod -d *@$HOSTNAME

If you want to hide this complexity a bit, I'd use tiny scripts
'qenable/qdisable' that could take a list of hosts, or use $HOSTNAME in
the absence of arguments.

> Thanks,
> Chris

Cheers,
/mark

This e-mail message and any attachments may contain
legally privileged, confidential or proprietary Information,
or information otherwise protected by law of EMCON
Technologies, its affiliates, or third parties. This notice
serves as marking of its "Confidential" status as defined
in any confidentiality agreements concerning the sender
and recipient. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of this
message to the intended recipient(s), you are hereby
notified that any dissemination, distribution or copying
of this e-mail message is strictly prohibited.
If you have received this message in error, please
immediately notify the sender and delete this e-mail
message from your computer.

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=196928

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net<mailto:users-unsubscribe at gridengine.sunsource.net>].




More information about the gridengine-users mailing list