Hi,
Am 23.04.2014 um 23:21 schrieb Tim Landscheidt:
> how do I find out the host a particular job is currently
> running on?
>
> "qstat -j 1897" (for example) only lists the requested
> queue. "qhost -u tools.wikilint" works, but is very un-
> friendly to parse in a shell script.
>
> Do I have to pipe "qhost -u tools.wikilint -xml" to an XML
> parser, or is there a more convenient way to get the host?
Another approach could be to use a prolog to add the assignment of nodes to the
context of the job (the nodes need to be submit hosts though):
#!/bin/sh
. /usr/sge/default/common/settings.sh
if [ $NSLOTS -eq 1 ]; then
qalter -ac NODES=$(hostname):1 $JOB_ID
else
qalter -ac NODES=$(awk '{slots[$1]+=$2} END { for (host in slots) { printf
entry?"+":""; printf host":"slots[host]; entry=1 }}' $PE_HOSTFILE) $JOB_ID
fi
and you get:
$ qstat -j 11425
==============================================================
job_number: 11425
...
context: NODES=node14:2+node02:2
-- Reuti
> Tim
>
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users