GithubHelp home page GithubHelp logo

python-torque's Introduction

Count number of jobs in queue

from torque import PBS
pbs = PBS()
pbs.fastpoll()
print '{0} jobs are in the queue.'.format(len(pbs))
from torque import PBS
pbs = PBS()
print pbs.ruptime()

Find jobs on a certain node

from torque import PBS
pbs = PBS()
pbs.poll()

nodelist = ['n9/']

for job in pbs:
  for node in nodelist:

      if node in job.get('exec_host',[]):
          print '%(euser)-12s %(Job Id)30s %(exec_host)s' % job

pbsnodes

from torque import PBS
pbs = PBS()
print pbs.pbsnodes()

find jobs

from torque import PBS
pbs = PBS()
pbs.fastpoll()
print pbs.findjobs(euser='jkitchin')

Print memory usage and requested on jobs

from torque import PBS
pbs = PBS()
pbs.poll()
#print pbs[0]

print '| jobid | user | requested mem | used mem | used vmem |\n|-'
for job in pbs:
    if job['job_state'] == 'R':
        mem = int(job.get('resources_used.mem')[0:-2]) / 1024 / 1024
        vmem = int(job['resources_used.vmem'][0:-2]) / 1024 / 1024
        req = job['Resource_List.mem']
        euser = job['euser']
        print "|{job[Job Id]} | {euser} | {req} | {mem} gb | {vmem} gb | ".format(job=job,
                                                                                  euser=euser,
                                                                                  mem=mem,
                                                                                  vmem=vmem,
                                                                                  req=req)

nodelist

from torque import PBS
pbs = PBS()
pbs.poll()

import xmltodict
print pbs.findnodes()[10]

python-torque's People

Contributors

jkitchin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-torque's Issues

How to install htp module?

When I try to import torque in python shell, the below info will be shown:
import torque
Traceback (most recent call last):
File "", line 1, in
File "torque/init.py", line 17, in
from torque import *
File "torque/torque.py", line 11, in
from htp.ssh import ssh
ImportError: No module named htp.ssh
How could I fix this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.