Exemplo n.º 1
0
Arquivo: pbshost.py Projeto: zoidy/puq
 def __init__(self, env,  cpus=0, cpus_per_node=0,
              qname='standby', walltime='1:00:00', modules='', pack=1, qlimit=200):
     Host.__init__(self)
     if cpus <= 0:
         print "You must specify cpus when creating a PBSHost object."
         raise ValueError
     if cpus_per_node <= 0:
         print "You must specify cpus_per_node when creating a PBSHost object."
         raise ValueError
     try:
         fd = open(env, 'r')
     except IOError as e:
         print
         print "Trying to read %s" % env
         print "I/O error(%s): %s" % (e.errno, e.strerror)
         print
         sys.exit(1)
     fd.close()
     self.env = env
     self.cpus = cpus
     self.cpus_per_node = cpus_per_node
     self.qname = qname
     self.walltime = walltime
     self.jobs = []
     self.wqueue = []
     self.wlist = []
     self.modules = modules
     self.pack = pack
     self.scaling = False
     self.jnum = 0
     self.qlimit = qlimit
     # checkjob on Carter is frequently broken
     #self.has_checkjob = (os.system("/bin/bash -c 'checkjob --version 2> /dev/null'") >> 8) == 0
     self.has_checkjob = False
     self.has_torque = os.path.isdir('/var/spool/torque')
Exemplo n.º 2
0
 def __init__(self, venue=None, cpus=1, cpus_per_node=1, walltime=60):
     Host.__init__(self)
     self.cpus = cpus
     self.cpus_per_node = cpus_per_node
     self.hostname = venue
     self.jobs = []
Exemplo n.º 3
0
 def __init__(self, venue=None, cpus=1, cpus_per_node=1, walltime=60):
     Host.__init__(self)
     self.cpus = cpus
     self.cpus_per_node = cpus_per_node
     self.hostname = venue
     self.jobs = []